Tianjin University Online Judge
Contests Virtual Contests Problems Submit Runs Status Rank List Forum

1375.   Ones
Time Limit: 1.0 Seconds   Memory Limit: 65536K
Total Runs: 2749   Accepted Runs: 1301



Given any integer 0 ≤ n ≤ 10000 not divisible by 2 or 5, some multiple of n is a number which in decimal notation is a sequence of 1's. How many digits are in the smallest such a multiple of n?

Sample Input

3 
7 
9901

Output for Sample Input

3
6
12


Source: Waterloo Local Contest Jun. 2, 2001
Submit   List    Runs   Forum   Statistics

Tianjin University Online Judge v1.3.0
Maintance:Fxz. Developer: SuperHacker, G.D.Retop, Fxz