Limits 1s, 512 MB

Sofia has just arrived in Bangladesh. Rather asking it some dumb questions, lets give it a maze problem to solve.

Sofia is located at the top-left corner of a M×NM \times N grid (marked 'Start' in the diagram below).

It can only move either down or right at any point in time. It is trying to reach the bottom-right corner of the grid (marked 'Finish' in the diagram below).

How many possible unique paths are there?

Sofia could not solve this problem (seems like it's not that smart), as you are one of the best programmers in Bangladesh, you have been given this task to write code of this problem to help Sofia to be smarter.

Input

Input starts with an integer TT (T100T \le 100) denoting the number of test cases. Each case starts with a line containing two integers MM and NN (1M,N251 \le M, N \le 25).

Output

For each case, print the case number and followed by the number of possible unique paths.

Sample

InputOutput
3
2 3
5 7
9 1
Case 1: 3
Case 2: 210
Case 3: 1

Submit

Login to submit.

Statistics

84% Solution Ratio
sakibalaminEarliest, Jan '18
BattlejoninFastest, 0.0s
S_RifatLightest, 0 B
Tarik.amtolyShortest, 273B
Toph uses cookies. By continuing you agree to our Cookie Policy.