Contest: Task: Related: TaskA TaskC

Score : $700$ points

Find the smallest possible sum of the digits in the decimal notation of a positive multiple of $K$.

- $2 \leq K \leq 10^5$
- $K$ is an integer.

Input is given from Standard Input in the following format:

$K$

Print the smallest possible sum of the digits in the decimal notation of a positive multiple of $K$.

6

3

$12=6×2$ yields the smallest sum.

41

5

$11111=41×271$ yields the smallest sum.

79992

36