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
import sys

data        = sys.stdin.readlines()

numTrials   = data.pop(0)
matrices    = [[int(numString) for numString in row.rstrip().split(" ")] for row in data]

for matrix in matrices:
    rows, columns   = matrix[0], matrix[1]
    
    if rows > columns:
        square                  = columns
        extraRows               = rows - columns
        evenSquareRows          = square//2
        oddSquareRows           = square//2 + square%2
        
        squareEvens             = evenSquareRows*(evenSquareRows+1)
        squareOdds              = (oddSquareRows-1)*(oddSquareRows+1)+1

        startsEven              = ((square + 1) % 2 == 0)
        endsEven                = (rows % 2 == 0)

        if startsEven:
            if endsEven:
                evenExtraRows   = extraRows//2+1
                oddExtraRows    = extraRows//2
            else:
                evenExtraRows   = extraRows//2
                oddExtraRows    = extraRows//2
        else:
            if endsEven:
                evenExtraRows   = extraRows//2
                oddExtraRows    = extraRows//2
            else:
                evenExtraRows   = extraRows//2
                oddExtraRows    = extraRows//2+1

        extraEvens              = square * evenExtraRows
        extraOdds               = square * oddExtraRows 

        evens                   = squareEvens + extraEvens
        odds                    = squareOdds + extraOdds
    
    else:
        evenRows                = rows//2
        oddRows                 = rows//2 + rows%2

        evens                   = evenRows*(evenRows+1)
        odds                    = (oddRows-1)*(oddRows+1)+1

    sys.stdout.write(str(evens) + " " + str(odds) + "\n")