BETA

Difficulty Level:

Easy

Total Submissions: 122 Accuracy:

49.18%

Required Rooms
     

A seminar of Artificial Intelligence is going on,and the number of participants from Foreign is A, while from India is B. All the participants would be staying in the same hotel.In each room equal number of participants have to stay( can be 1 in a room).Also foreign and Indian cannot stay in the same room. Find the minimum number of rooms required,if in each room the same number of participants are to be seated.

Input:
First line consists of T test cases. Only line of every test case consists of 2 integers A and B.

Output:
Print the value of no of rooms required.

Constraints:
1<=T<=200
1<=A,B<=1000

Example:
Input:

5
60  84
50  30
8  11
6  10
1  2
Output:
12
8
0
8
3

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

Contributor: Sangeet Singh

Set Default Code

					   
It is recommended to 'Compile & Test' your code before clicking 'Submit'!

Compilation/Execution Result:

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