Help Joey
Submissions: 1220   Accuracy:

19.72%

  Difficulty: Basic   Marks: 1

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.

Input:
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).

Output:
Print the maximum number of words obtained.

Constraints:
1<=T<=1000
1<=a,b<=10^8

Example:
Input:

2
2 1
3 1
Output:
1
1

** For More Input/Output Examples Use 'Expected Output' option **

Contributor: Saksham Raj Seth
Author: saksham seth


If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.



Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.


to report an issue on this page.