Arya and Bran are playing a game. Initially, two positive integers
For example, if the numbers are initially
- Arya replaces
with , leaving on the blackboard. - Bran replaces
with , leaving on the blackboard. - Arya replaces
with , leaving on the blackboard. - Bran replaces one
with , and loses.
We will say
Given four integers
Input Specification
The first line of the input gives the number of test cases,
Output Specification
For each test case, output one line containing Case #x: y
, where
Limits
Memory limit: 1 GB.
Small Dataset
Time limit: 30 seconds.
Large Dataset
Time limit: 90 seconds.
No additional constraints.
Sample Input
3
5 5 8 8
11 11 2 2
1 6 1 6
Sample Output
Case #1: 0
Case #2: 1
Case #3: 20
Note
This problem has different time limits for different batches. If you exceed the Time Limit for any batch, the judge will incorrectly display >90.000s
regardless of the actual time taken. Refer to the Limits section for batch-specific time limits.
Comments