Rain sound
Practice
3.2 (69 votes)
Basic programming
Basics of implementation
Implementation
Problem
90% Success 27399 Attempts 10 Points 1s Time Limit 256MB Memory 1024 KB Max Code
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 \(-1 -1\) if no answer is available.
Constraints
\(1 \leq T \leq 10^{5}\\ 1 \leq l \leq r \leq 10^{9}\\ 1 \leq s \leq 10^{9}\)
Submissions
Please login to view your submissions
Similar Problems
Points:10
258 votes
Tags:
Brute-force searchEasy
Points:10
273 votes
Points:10
89 votes
Tags:
ImplementationBasic Programming
Editorial