Problems
We have a string 0145217, two possible divisions are
014 5 21 7 and 0 14 52 17. Each digit must be used in exactly one
substring, and each substring must be non-empty. If
Given a positive integer 014,
21, and 7 represent integers divisible by 52 and 17 are consecutive substrings
and neither represents an integer divisible by 0145217 as
0145217 is divisible by any
Given
Input
The first line of the input gives the number of test cases,
Output
For each test case, output one line containing Case #,
where
Example
3
0145217 7
100100 10
5555 12
Case #1: 16
Case #2: 30
Case #3: 1