#t216. 苹果和虫子
苹果和虫子
Apples and a Worm
Problem Description
You bought a box of apples, but unfortunately a worm got mixed in when you bought them. The worm can eat one apple every hours, and it will not start another apple before finishing the current one. After hours, how many whole apples do you still have left? (The input data guarantees .)
Input Format
The input is a single line containing , and (all non-negative integers).
Output Format
Output a single line containing the number of apples left.
Sample Input
10 4 9
Sample Output
7
Hint
- Apples eaten: after hours, at one apple per hours — but a "half-eaten" apple also counts as gone, so think about when you need to round up.
- The answer can never be negative; think about why (the data guarantee in the statement).
- Try the official hint: complete it without any branch statements, relying only on the nature of integer division.
int-type integers truncate the fractional part of a floating-point number directly.
This problem can be solved without any branch statements.