Spell Matrices#566

Spell Matrices

0.5 seconds
64 megabytes
Very easy

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:

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?

Input

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.

Output

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).

Examples

Example 1

Loading
Loading