Maximum subtraction
Practice
3.7 (13 votes)
Basic math
Easy Medium
Mathematics
Mathematics
Problem
79% Success 3844 Attempts 30 Points 5s Time Limit 256MB Memory 1024 KB Max Code

You are given three integers \(n\), \(m\), and \(k\). In a single move, you can subtract any integer in the range from \(1\) to \(m\) from \(n\), but you are not be allowed to subtract this integer during the next \(k\) moves. What is the minimum number of moves required to make \(n\) strictly smaller than 0?
 

Input format

The first and only line of input contains three integers \(-\) \(n, m, k\)

Output format

Print an integer denoting the answer to the problem.

Constraints 

\(1 \le n, m \le 10^{9}\)

\(1 \le k \le 10^{5}\)

\(k < m\)

Please login to use the editor

You need to be logged in to access the code editor

Loading...

Please wait while we load the editor

Loading...
Results
Custom Input
Run your code to see the output
Submissions
Please login to view your submissions
Similar Problems
Points:30
62 votes
Tags:
MathematicsOpenApprovedEasy-MediumMathamatics
Points:30
15 votes
Tags:
MathematicsEasy-MediumOpenApprovedGreedy algorithmMathamatics
Points:30
1 votes
Tags:
Easy-Medium