At the Academy of Magic, students are learning about spell matrices. Each student is given a rectangular grid of M \times N runes. To cast a spell, a wizard must select a rectangular zone of runes from the grid.
There are two types of spells:
Fire spells — cast using square zones (where width equals height)
Water spells — cast using rectangular zones (where width does not equal height)
For today's assignment, students must determine: given a grid of M \times N runes, how many different fire spells and how many different water spells can be formed?
The first line contains the number of test cases . Each of the following lines contains two integers and (1 \leq K, M, N \leq 100), separated by a space — the dimensions of each rune grid.
For each test case, output in a separate line, separated by a space, first the number of fire spells (square zones) and then the number of water spells (rectangular zones).
Example 1