Logo
(追記) (追記ここまで)

33295번 - Infinity Triples 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
4 초 2048 MB12000.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$.

제한

예제 입력 1

2

예제 출력 1

1

예제 입력 2

3

예제 출력 2

6

예제 입력 3

42

예제 출력 3

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)$.

출처

Camp > Petrozavodsk Programming Camp > Summer 2024 > Day 5: Der Kontest D번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /