AtCoder Beginner Contest 083
B
Some Sums
AtCoder
⌀ 62
原题
← AC →
翻译中…

Problem Statement

翻译中…

Find the sum of the integers between $1$ and $N$ (inclusive), whose sum of digits written in base $10$ is between $A$ and $B$ (inclusive).

翻译中…

Constraints

翻译中…
  • $1 \leq N \leq 10^4$
  • $1 \leq A \leq B \leq 36$
  • All input values are integers.
翻译中…

Input

翻译中…

Input is given from Standard Input in the following format:

翻译中…

N A B

翻译中…

Output

翻译中…

Print the sum of the integers between $1$ and $N$ (inclusive), whose sum of digits written in base $10$ is between $A$ and $B$ (inclusive).

翻译中…

样例

Input #1
20 2 5
Output #1
84
Among the integers not greater than $20$, the ones whose sums of digits are between $2$ and $5$, are: $2,3,4,5,11,12,13,14$ and $20$. We should print the sum of these, $84$.
Input #2
10 1 2
Output #2
13
Input #3
100 4 16
Output #3
4554
题目信息
题号
abc083_b
时间限制
2 s
内存限制
256 MB

题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。