Big Digits
You are given two integers A i B (0 <= A <= B <= 10<sup>18</sup>). You have to find out how many integers from the interval [ A, B ] have the sum of all its digits to be equal to some given integer S.
InputYou should read the input from the standard input. In one line you are given two integers A, B (0 <= A <= B <= 10^18) i S (0 <= S <= 191) separated by a space.
OutputTo the standard output, output one integer representing the number of integers from the interval [ A, B ] whose sum of all digits equals to S.
Input:
Output:
1 100 8Output:
9Input:
Output:
5551 987654 25Output:
53055Submit solution
Coming laterThe grading service will be connected in a later migration step. You can inspect the task and your previous results now.