100 #ABC083B. [ABC083B] Some Sums

[ABC083B] Some Sums

Score : 200200 points

Problem Statement

Find the sum of the integers between 11 and NN (inclusive), whose sum of digits written in base 1010 is between AA and BB (inclusive).

Constraints

  • 1N1041 \leq N \leq 10^4
  • 1AB361 \leq A \leq B \leq 36
  • All input values are integers.

Input

Input is given from Standard Input in the following format:

NN AA BB

Output

Print the sum of the integers between 11 and NN (inclusive), whose sum of digits written in base 1010 is between AA and BB (inclusive).

20 2 5
84

Among the integers not greater than 2020, the ones whose sums of digits are between 22 and 55, are: 2,3,4,5,11,12,13,142,3,4,5,11,12,13,14 and 2020. We should print the sum of these, 8484.

10 1 2
13
100 4 16
4554