Due to the coronavirus pandemic, city authorities obligated citizens to keep a social distance. The mayor of the city Semyon wants to light up Gluharniki park so that people could see each other even at night to keep the social distance.

The park is a rectangular table with $n$ rows and $m$ columns, where the cells of the table are squares, and the boundaries between the cells are streets. External borders are also streets. Every street has length $1$. For example, park with $n=m=2$ has $12$ streets.

You were assigned to develop a plan for lighting the park. You can put lanterns in the middle of the streets. The lamp lights two squares near it (or only one square if it stands on the border of the park).

 [Image] The park sizes are: $n=4$, $m=5$. The lighted squares are marked yellow. Please note that all streets have length $1$. Lanterns are placed in the middle of the streets. In the picture not all the squares are lit. 

Semyon wants to spend the least possible amount of money on lighting but also wants people throughout the park to keep a social distance. So he asks you to find the minimum number of lanterns that are required to light all the squares.


-----Input-----

The first line contains a single integer $t$ ($1 \le t \le 10^4$) — the number of test cases in the input. Then $t$ test cases follow.

Each test case is a line containing two integers $n$, $m$ ($1 \le n, m \le 10^4$) — park sizes.


-----Output-----

Print $t$ answers to the test cases. Each answer must be a single integer — the minimum number of lanterns that are required to light all the squares.


-----Example-----
Input
5
1 1
1 3
2 2
3 3
5 3

Output
1
2
2
5
8



-----Note-----

Possible optimal arrangement of the lanterns for the $2$-nd test case of input data example: [Image]

Possible optimal arrangement of the lanterns for the $3$-rd test case of input data example: [Image]

Difficulty: interview

Starter code:

Solutions:
q = int(input())
for i in range(q):
	a,b = map(int,input().split())
	print((a*b+1)//2)

t = int(input())
for kek in range(t):
    (n, m) = map(int, input().split())
    print(n*m%2 + n*m//2)

t = int(input())

for _ in range(t):
    n, m = [int(x) for x in input().split()]
    print((n*m + 1)//2)


def solve():
    x, y = map(int, input().split())
    print((x * y + 1) // 2)


for i in range(int(input())):
    solve()

for t in range(int(input())):
    a, b = list(map(int, input().split()))
    print((a * b + 1) // 2)

import math
import sys
input = sys.stdin.readline

for _ in range(int(input())):
    n, m = list(map(int, input().split()))
    print(math.ceil(n*m/2))





import sys
input = sys.stdin.readline
for f in range(int(input())):
    n,m=map(int,input().split())
    x=n*m
    x+=1
    x//=2
    print(x)

for _ in range(int(input())):
    n, m = map(int, input().split())
    ans = n // 2 * m
    if n % 2 == 1:
        ans += m // 2
        if m % 2 == 1:
            ans += 1
    print(ans)

import sys
max_int = 1000000001  # 10^9+1
min_int = -max_int

t = int(sys.stdin.readline())

for _ in range(t):
    n, m = list(map(int, sys.stdin.readline().split()))
    print( (n*m + 1 )//2)



import sys
readline = sys.stdin.readline

T = int(readline())
Ans = [None]*T
for qu in range(T):
    n, m = map(int, readline().split())
    Ans[qu] = -((-n*m)//2)
print('\n'.join(map(str, Ans)))

for t in range(int(input())):
    n, m = map(int,input().split())
    print((n * m) // 2 + (n*m)%2)

t = int(input())
for _ in range(t):
    n, m = list(map(int, input().split()))
    print((n*m+1)//2)


t = int(input())
for q in range(t):
	n, m = list(map(int, input().split()))
	print(n * m // 2 + n * m % 2)


v = int(input())
for i in range(v):
    a = [int(x) for x in input().split()]
    c = a[0]*a[1]
    if(c%2==1): 
        c+=1
    print(int(c/2))

t = int(input())
for _ in range(t):
    n, m = list(map(int, input().split()))
    print((n * m + 1) // 2)


from math import sqrt

t = int(input())


for qq in range(t):
    n, m = [int(i) for i in input().split()]
    print((n * m) // 2 + (n * m) % 2)


t = int(input())
for _ in range(t):
    n, m = list(map(int, input().split()))
    print(-((-n * m) // 2))


for _ in range(int(input())):
    n, m = list(map(int, input().split()))
    t = n*m
    print((t+1)//2)


T = int(input())

for _ in range(T):
    a,b = map(int,input().split())
    
    if a%2 == 1 and b%2 == 1:
        print(a*b//2+1)
    else:
        print(a*b//2)

# Contest No.: 645
# Problem No.: A
# Solver:      JEMINI
# Date:        20200526

import sys
import heapq

def main():
    t = int(input())
    for _ in range(t):
        n, m = map(int, sys.stdin.readline().split())
        if n * m % 2:
            print(n * m // 2 + 1)
        else:
            print(n * m // 2)
    return

def __starting_point():
    main()
__starting_point()

def read_int():
    return int(input())


def read_ints():
    return list(map(int, input().split(' ')))


t = read_int()
for case_num in range(t):
    n, m = read_ints()
    print((n * m + 1) // 2)


for _ in range(int(input())):
    n, m = list(map(int, input().split()))
    print((n * m + 1) // 2)