Timer is Running

Required Rooms
##### Submissions: 793   Accuracy: 57.27%   Difficulty: Easy   Marks: 2

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 **

Author: Sangeet Singh

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.