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

12

8

0

8

3

Ibrahim Nash | 119 |

Ryan Yang | 87 |

Robin Kendrick | 83 |

aristotle | 79 |

bz24244 | 79 |

Lam Ngoc Pham | 476 |

All Is Well | 399 |

Prateek Gole | 385 |

Divvya Sinha | 374 |

Ibrahim Nash | 359 |

akhayrutdinov | 3873 |

sanjay05 | 3366 |

Michael Riegger | 2035 |

Jasleen Kaur 2 | 2012 |

Quandray | 1982 |