Joey is a food lover, but Monica is concerned about his health and thus refuses to give him any more food. But on Joey's request she agrees to give him more food only if he solves this problem. You have number of C's and number of S's. You need to find the maximum number of words of "SCC" which can be formed from this. Note: 2 C's can form a S.
The first line of inputs contains the number of test cases.
The Only line of each input contains the number of C's (a) and S's (b).
Print the maximum number of words obtained.