No.810 Number of Remainders
問題文最終更新日: 2018-09-07 18:46:26
English (AI translation)
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence.
Back to the original
yukicoder contest 210
(順位表)
の他の問題:
Problem Statement
You are given integers $L,R,M$.
How many distinct integers are possible as the remainder when an integer between $L$ and $R$, inclusive, is divided by $M$?
Input
L R M
$0 \leq L \leq R \leq 10^9$
$1 \leq M \leq 10^9$
$L,R,M$ are given on one line, separated by spaces.
Output
Output the answer. Print a newline at the end.
Sample
Sample 1
Input
3 5 4
Output
3
The 3 possible values are 0,1,3.
Sample 2
Input
5 8 2
Output
2
The 2 possible values are 0,1.
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。
ats5515