URI Online Judge | 1630


By Jeferson Tiepo, UNOESC BR Brazil

Timelimit: 1

Marcos works for a construction company, his task is to surround with stakes the sites where buildings will be constructed. There are two restrictions regarding these stakes distribution, they should be placed in a way the distance between two stakes is always the same, and the second restriction is that Marcos should use the smallest possible number of stakes. Marcos is your friend and he has asked you to develop a program to help him.


There will be several test cases, each test case is described in a line by two numbers X and Y (1 ≤ X, Y ≤ 100000000), which represent the dimensions of the site. The input end is indicated by end of file.


For each test case print a line with the minimum number of stakes needed to surround the site. 

Sample Input Sample Output

2 2
3 3
2 5
8 3
76 50