#Q168. 「一本通 5.3 练习 1」数字游戏

「一本通 5.3 练习 1」数字游戏

Description

Due to the recent popularity of number games in the science association, someone has named a new type of modulo number. These numbers must satisfy the condition that the sum of their digits modulo NN equals 00. Now, everyone is playing a new game: given a closed integer interval [a,b][a, b], determine how many such modulo numbers exist within this interval.

Input Format

There are multiple test cases in the input. Each case consists of three numbers: aa, bb, and NN.

Output Format

For each test case, output a single line indicating the count of numbers whose digit sum modulo NN equals 00.

Sample 1

1 19 9

2

Data Range and Hint

For all test cases, 1a,b23111\le a,b\le 2^{31}-1 and 1N<1001\le N\lt 100.