As you all know that it is high time for good and bad boys to do good and bad things in the upcoming Good and Bad tournament. Since the bad boys like to fight with good boys even if they are in the same team in the tournament. That’s why the tournament authority has decided not to mix up bad boys with good boys. Now the tournament authority is having some trouble with the bad boys and the authority needs your help to form the teams for the upcoming tournament since you are the badest boy in the town right now. You will know in advance the total number of boys and the number of bad boys among them. You have to follow the following rules to form the teams:
There can be two types of team.
With only bad boys as member (Bad Teams)
With only good boys as member as (Good Teams)
Each Bad Team must have the same number of member
Each Good Team Must have the same number of member
There must be at least one Bad Team and one Good Team
The number of members in a Good Team must be greater than the number of member in a Bad Team.
Now you have to tell the authority, how many numbers of ways you can form the teams for the tournament satisfying the condition mentioned above.
Input starts with an integer (), denoting the number of test cases.
Each case contains two integer () and (), where represents the total number of boys and represents the number of bad boys.
For each case print the case number and the number of ways the teams can be formed.
Input | Output |
---|---|
2 6 2 10 7 | Case 1: 3 Case 2: 1 |