Mr.Lin was preparing to bully the employee JQ on this day. He caught JQ to play gobang with him. Because of Mr.Lin was too weak, he lost several gobang. Finally, Mr.Lin was so angry. He took a knife and cut off each side of the board . Now the question is coming. How many cases have Mr.Lin cut the chessboard into squares and rectangles?
计算n*m的棋盘里面包含多少个正方形,多少个长方形
because of 我不知道咋在样例弄图片,所以
the sample like this
and we get answer have two squares and one rectangle such as
There multiple test cases in the input (more than 1e5)
each test case contains two positive integers n, m stand for the length and width of chessboard.
Input data Guarantee less than 2^63
One line for each test case
Two integers indicates the number of squares and the number of rectangles
Output data Guarantee less than 2^63
1 2
2 1