#P13584. [NWRRC 2023] Divisibility Trick

[NWRRC 2023] Divisibility Trick

题目描述

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~dd. To do this, she wants to show Dmitry an example of a positive integer nn such that nn is divisible by dd, and the sum of the digits of nn is also divisible by dd. Help her to find such a number.

输入格式

The only line contains a single integer dd (1d10001\le d\le 1000).

输出格式

Print a positive integer nn divisible by dd such that the sum of its digits is also divisible by dd.

The value of nn must consist of at most 10610^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.

3
3
13
1898
1
239

提示

In the first example, 33 is divisible by 33, and its sum of digits, 33, is also divisible by 33.

In the second example, 18981898 is divisible by 1313, and its sum of digits, 1+8+9+8=261 + 8 + 9 + 8 = 26, is also divisible by 1313.

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