There are just three simple rules:
1) Follow the output format specification exactly, don't output anything extra, like "input: " or "output: ". Judge is only a dumb robot who compares output files byte-wise, and those words don't make much sense to it.
Instead of "output: ", you're supposed to print "Case 1: ", "Case 2: ", etc. in this particular problem.
2) Follow the input format specification exactly.
The first line of input gives you the number of test cases, T.
Then T test cases follow. Each test case consists of 2 integers a and b in two separate lines.
Your program must process all the test cases present in the input.
3) Solve the problem correctly, within its time and memory limits. Your program looks good here.