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.
First line consists of T test cases. Only line of every test case consists of 2 integers A and B.
Print the value of no of rooms required.