|All-time Popular Problems|
|Minimum Depth of a Binary Tree|
|Even and odd elements at even and odd positions|
|Egg Dropping Puzzle|
|Find first set bit|
|Recursively remove all adjacent duplicates|
|Queue using two Stacks|
|Find the Odd Occurence|
|Longest Palindrome in a String|
|Maximum sum increasing subsequence|
Given a rectangle of dimensions a X b find the minimum number (n) of identical squares of maximum side that can be cut out from that rectangle so that no residue remains in the rectangle. Also find the dimension k of that square.
The first line of the input contains an integer 'T' denoting the number of testcases. Then T test cases follow. Each test case consits of a single line containing two space separated integers a and b denoting the dimensions of the rectangle.
For each test case print n and k (space separated ) in a new line.