Tea for the Celebration
Limits: 2 sec., 256 MiB
At least \(s\) liters of tea must be brought to a school celebration. The tea is poured into bottles, each of which holds \(k\) liters. A bottle may also be filled only partially.
The bottles are delivered by trucks. One truck can carry at most \(m\) bottles, but it may also go partially loaded.
What is the minimum number of trucks needed to bring \(s\) liters of tea to the celebration?
Input
The only line contains three integers \(s\), \(k\) and \(m\) – how many liters of tea are needed, how many liters one bottle holds, and how many bottles one truck carries.
Output
In the only line, print one integer – the minimum number of trucks.
Constraints
\(1 \le s, k, m \le 10^9\),
\(k \cdot m \le 10^9\).
The scoring consists of the following blocks:
1 point for each example from the statement,
20 points: \(s\) is divisible by \(k \cdot m\),
25 points: \(m = 1\),
25 points: \(s\) is not divisible by \(k\),
27 points: no additional constraints.
You get the points for a block only if your program passes all tests of the block.
Samples
| Input (stdin) | Output (stdout) |
|---|---|
| 12 2 3 | 2 |
| Input (stdin) | Output (stdout) |
|---|---|
| 10 3 2 | 2 |
| Input (stdin) | Output (stdout) |
|---|---|
| 7 10 5 | 1 |
Notes
In the first example, 6 full bottles of 2 liters are needed, and 2 trucks with 3 bottles each carry them.
In the second example, three bottles of 3 liters are not enough, so 4 bottles are needed (the last one is filled with 1 liter). One truck carries only 2 bottles, so 2 trucks are needed.
In the third example, all the tea fits into one bottle, which is carried by one truck.
Submit a solution
| Element Type | Created | Who | Problem | Compiler | Result | Time (sec.) | Memory (MiB) | # | Actions |
|---|
| Element Type | Created | Who | Problem | Compiler | Result | Time (sec.) | Memory (MiB) | # | Actions |
|---|