P27880 [洛谷] [GESP202309 Level 1] Xiaoming's Lucky Number
普及-
题目描述

Problem Description

All positive integers with a unit digit of $k$, as well as all multiples of $k$, are referred to by Xiaoming as "lucky numbers of $k$". Xiaoming wants to know the sum of all lucky numbers of $k$ between positive integers $L$ and $R$ (including $L$ and $R$). Can you help him?

Input Format

The input consists of three lines. The first line contains a positive integer $k$. The second line contains a positive integer $L$. The third line contains a positive integer $R$. It is guaranteed that $2 \le k \le 9$ and $1 \le L \le R \le 1000$.

Output Format

Output a single line with the sum of the lucky numbers as described.

Sample Input and Output

Sample Input #1

7
1
10

Sample Output #1

7

Sample Input #2

7
10
20

Sample Output #2

31

Notes

Sample Explanation 1

Between $1$ and $10$, there is only one lucky number of $7$: $7$. Since $7$ is both a multiple of $7$ and has a unit digit of $7$, the result is $7$.

Sample Explanation 2

Between $10$ and $20$, there are two lucky numbers of $7$: $14$ and $17$. $14$ is a multiple of $7$, and $17$ has a unit digit of $7$. Therefore, the result is $31$.

输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输入
7 1 10
样例输出
7