Find the smallest possible sum of the digits in the decimal notation of a positive multiple of K.
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
Subtask | Score |
---|---|
1 | 30 |
2 | 70 |
3 | 0 |