| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 1 초 | 256 MB | 83 | 39 | 37 | 48.684% |
For a positive integer $n,ドル let $f(n)$ be the sum of squares of its digits in the decimal notation. Given are three integers $k, a, b$. Your task is to determine the number of such natural numbers $n,ドル that $a \le n \le b$ and $n$ is the solution of the equation \[ k\cdot f(n) = n. \]
The first and only line of the input contains three integers of the task statement: $k, a, b,ドル (1ドル \le k, a, b \le 10^{18},ドル $a \le b$).
Your program should output a single integer: the number of integral solutions of the given equation contained in the range $[a,b]$.
51 5000 10000
3
In the example, the only positive integers $n$ from the range $[5000,10000]$ satisfying the equation for $k=51$ are 7293ドル,ドル 7854ドル$ and 7905ドル$.