| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 4 초 | 2048 MB | 12 | 0 | 0 | 0.000% |
Consider numbers in base $b$ where all digits are equal to $a$ with 1ドル \leq a < b$. We call a triple $(n, a, b)$ an infinity triple if infinitely many of those numbers are divisible by $n$.
For example, $(3, 9, 10)$ is an infinity triple because infinitely many of the numbers 9ドル,ドル 99ドル,ドル 999ドル,ドル $\ldots$ are divisible by 3ドル$. The triple $(7, 9, 10)$ is also an infinity triple, but $(5, 9, 10)$ is not.
Given $m,ドル count the number of infinity triples with 1ドル \leq n \leq m$ and 1ドル \leq a < b \leq m$.
The input contains one integer $m$ (2ドル \leq m \leq 10^5$).
Output one integer, the number of infinity triples with 1ドル \leq n \leq m$ and 1ドル \leq a < b \leq m$.
2
1
3
6
42
25055
In the first sample, $(1, 1, 2)$ is the only infinity triple.
In the second sample, the infinity triples are $(1, 1, 2), (1, 1, 3), (1, 2, 3), (2, 1, 3), (2, 2, 3),$ and $(3, 1, 2)$.