给定一个正整数L,L≤2*10^9。 问至少多少个8连在一起组成的正整数是L的倍数?
The input consists of multiple test cases. Each test case contains exactly one line containing L(1 ≤ L ≤ 2,000,000,000).
The last test case is followed by a line containing a zero.
For each test case, print a line containing the test case number( beginning with 1) followed by a integer which is the length of Bob's luckiest number. If Bob can't construct his luckiest number, print a zero.
8 11 16 0
Case 1: 1 Case 2: 2 Case 3: 0
时间限制 | 1 秒 |
内存限制 | 128 MB |