{"problem":{"name":"[ICPC-Hefei 2008 Online] The Luckiest Number","description":{"content":"Chinese people think of '8' as the lucky digit. Bob also likes digit '8'. Moreover, Bob has his own lucky number L. Now he wants to construct his luckiest number which is the minimum among all positiv","description_type":"Markdown"},"platform":"Luogu","limit":{"time_limit":1000,"memory_limit":524288},"difficulty":{"LuoguStyle":"P5"},"is_remote":true,"is_sync":true,"sync_url":null,"sign":"LGP10496"},"statements":[{"statement_type":"Markdown","content":"Chinese people think of '8' as the lucky digit. Bob also likes digit '8'. Moreover, Bob has his own lucky number L. Now he wants to construct his luckiest number which is the minimum among all positive integers that are a multiple of L and consist of only digit '8'.\n\n## Input\n\nThe input consists of multiple test cases. Each test case contains exactly one line containing L(1 ≤ L ≤ 2,000,000,000).\n\nThe last test case is followed by a line containing a zero.\n\n## Output\n\nFor 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.\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"LGP10496","tags":["2008","数论","最大公约数 gcd","ICPC","欧拉函数"],"sample_group":[["8\n11\n16\n0","Case 1: 1\nCase 2: 2\nCase 3: 0"]],"created_at":"2026-03-03 11:09:25"}}