問題一覧 > 通常問題

No.810 Number of Remainders

レベル : / AI推定難易度 : 167 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 412
作問者 : ats5515 / テスター : ciel
お気に入りにしたユーザー ProblemId : 2426 / 自分の提出
問題文最終更新日: 2018-09-07 18:46:26
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もしくは右上の雲マークをクリックしてアカウントを作成してください。