Substring

Time Limit: 2000ms
Memory Limit: 62768KB
This problem will be judged on HDU. Original ID: 3925
64-bit integer IO format: %I64d      Java class name: Main

Description

Give you two number a, b. Output the smallest number that can be added to a to contain the number b as a substring.

Input

The first line contains a single positive integer T( T <= 500 ), indicates the number of test cases.
For each test case: Two number a,b;
  0 <= a <= 10^100, 0 <= b <= 10^7

Output

For each test case: output the case number as shown and the smallest number that satisfy the description.

Sample Input

2
9 1
9 2

Sample Output

Case #1: 1
Case #2: 3

Source

Language: 
Theme: 
Share Code? 

Powered by NB231 | Current Style: .