#abc318a. A - Full Moon
A - Full Moon
Score : points
问题描述
Takahashi 喜欢满月。
假设今天是第 天。从今天或之后的第一天,他能看到满月的那一天是第 天。此后,每隔 天他就可以看到一次满月,即在第 天、第 天,以此类推。
找出从第 天到第 天(包括第 天和第 天)期间,他能看到满月的天数。
以上为通义千问 qwen-max 翻译,仅供参考。
Problem Statement
Takahashi likes full moons.
Let today be day . The first day on or after today on which he can see a full moon is day . After that, he can see a full moon every days, that is, on day , day , and so on.
Find the number of days between day and day , inclusive, on which he can see a full moon.
Constraints
- All input values are integers.
Input
The input is given from Standard Input in the following format:
Output
Print the answer as an integer.
Sample Input 1
13 3 5
Sample Output 1
3
He can see a full moon on day , , , , and so on.
From day to , he can see a full moon on three days: day , , and .
Sample Input 2
5 6 6
Sample Output 2
0
There may be no days he can see a full moon.
Sample Input 3
200000 314 318
Sample Output 3
628
update @ 2024/3/10 09:04:08