We have the following matrix 
1 0 0 0 0 0 ...
2 2 0 0 0 0 ...
3 3 3 0 0 0 ...
4 4 4 4 0 0 ... 
5 5 5 5 5 0 ... 
6 6 6 6 6 6 ...
and so on ... 

The matrix is created as follows, first row contains one 1 and rest 0's, second row contains 2 twos and rest zeros, third row contains 3 threes and so on.

Given R and C, calculate the count of even and odd numbers in sub matrix [R,C] .
0 is neither odd nor even and 1 based indexing is used i.e. matrix [1,1]=1 

Input:
First line contains number of test cases T.Each test case contains two integers R and C.

Output
For each test case print count of even and odd numbers in sub matrix [R,C].

Constraints:
1 ≤ T ≤ 100000  
1 ≤ R ≤ 100000 
1 ≤ C ≤ 100000  

SAMPLE INPUT
3
2 3
6 7
10 10

SAMPLE OUTPUT
2 1
12 9
30 25
def calc(m, n):
	if m <= n:
		if m % 2 == 0:
			n_even_rows = n_odd_rows = int(m / 2)
		else:
			n_even_rows = int(m / 2)
			n_odd_rows = n_even_rows + 1
		return n_even_rows * (n_even_rows + 1), n_odd_rows * n_odd_rows

	n_even, n_odd = calc(n, n)

	n_remaining_rows = m - n

	if n_remaining_rows % 2 == 0:
		n_remaining_even_kind = n_remaining_odd_kind = n * int(n_remaining_rows / 2)
	else:
		if (n + 1) % 2 == 0:
			n_remaining_even_kind = n * (int(n_remaining_rows / 2) + 1)
			n_remaining_odd_kind = n * int(n_remaining_rows / 2)
		else:
			n_remaining_odd_kind = n * (int(n_remaining_rows / 2) + 1)
			n_remaining_even_kind = n * int(n_remaining_rows / 2)
	return n_even + n_remaining_even_kind, n_odd + n_remaining_odd_kind

cases = int(raw_input())

for case in range(cases):
	m, n = [int(x) for x in raw_input().split()]
	n_even, n_odd = calc(m, n)
	print int(n_even), int(n_odd)