Rain sound

3.2

69 votes
Basic Programming, Basics of Implementation, Implementation
Problem

You like the sound of rain only if the sound ranges from l to r units. Every cloud makes s unit of sound. Determine the minimum and the maximum number of clouds that can produce the sound in the provided range.

Input format

  • First line: One integer T denoting the number of test cases
  • Next T lines: Three integers l,r, and s denoting the provided range of the rain sound and the units of sound produced by each cloud

Output format

In T lines, print two space-separated integers that represent the minimum and the maximum number of the clouds that can produce the sound in the provided range.

Note: Print 11 if no answer is available.

Constraints

1T1051lr1091s109

Time Limit: 1
Memory Limit: 256
Source Limit:
Explanation

In the first test of the sample the answer is 23 because 23=6 which is in [5,10] and 33=9 which is also in [5,10]. Also 43=12 which exceeds Parmis's interval and is considered noise.

Editor Image

?