#P2261. [CQOI2007] 余数求和
[CQOI2007] 余数求和
Description
Given positive integers and , please compute
where denotes the remainder when is divided by .
Input Format
The input contains a single line with two integers, and .
Output Format
Output one line with one integer representing the answer.
10 5
29
Hint
Sample 1 Explanation
$G(10, 5) = 0 + 1 + 2 + 1 + 0 + 5 + 5 + 5 + 5 + 5 = 29$.
Constraints
- For 30% of the testdata, it is guaranteed that .
- For 60% of the testdata, it is guaranteed that .
- For 100% of the testdata, it is guaranteed that .
Added a set of hack testdata on 2024/2/13.
Translated by ChatGPT 5
京公网安备 11011102002149号