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

30599번 - Divisibility Trick 스페셜 저지다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 1024 MB26716713167.526%

문제

Dmitry has recently learned a simple rule to check if an integer is divisible by 3. An integer is divisible by 3 if the sum of its digits is divisible by 3.

Later he also learned that the same rule can be used to check if an integer is divisible by 9. An integer is divisible by 9 if the sum of its digits is divisible by 9.

Dmitry's elder sister Daria wants to trick him by showing that the same rule can be applied to any divisor $d$. To do this, she wants to show Dmitry an example of a positive integer $n$ such that $n$ is divisible by $d,ドル and the sum of the digits of $n$ is also divisible by $d$. Help her to find such a number.

입력

The only line contains a single integer $d$ (1ドル\le d\le 1000$).

출력

Print a positive integer $n$ divisible by $d$ such that the sum of its digits is also divisible by $d$.

The value of $n$ must consist of at most 10ドル^6$ digits and must not have leading zeroes. It can be shown that such an integer always exists. If there are multiple answers, print any of them.

제한

예제 입력 1

3

예제 출력 1

3

예제 입력 2

13

예제 출력 2

1898

예제 입력 3

1

예제 출력 3

239

노트

In the first example, 3ドル$ is divisible by 3ドル,ドル and its sum of digits, 3ドル,ドル is also divisible by 3ドル$.

In the second example, 1898ドル$ is divisible by 13ドル,ドル and its sum of digits, 1ドル + 8 + 9 + 8 = 26,ドル is also divisible by 13ドル$.

In the third example, any positive integer satisfies the conditions.

출처

ICPC > Regionals > Northern Eurasia > Northwestern Russia Regional Contest > ICPC 2023-2024 Northwestern Russia Regional Contest D번

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

출처

대학교 대회

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

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