开始 2023-03-19 13:00:00

初等数论-4

结束 2023-04-02 15:00:00
Contest is over.
当前 2025-03-20 03:06:49

A. The Luckiest Number

描述

给定一个正整数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

Submit

登录

注册
时间限制 1 秒
内存限制 128 MB
提交