You are given two positive integers $A$ and $B$. Find the number of pairs of positive integers $(X, Y)$ such that $1 \le X \le A$, $1 \le Y \le B$ and $X + Y$ is even.
-----Input-----
- The first line of the input contains a single integer $T$ denoting the number of test cases. The description of $T$ test cases follows.
- The first and only line of each test case contains two space-separated integers $A$ and $B$.
-----Output-----
For each test case, print a single line containing one integer ― the number of valid pairs.
-----Constraints-----
- $1 \le T \le 1,000$
- $1 \le A, B \le 10^9$
-----Subtasks-----
Subtask #1 (10 points): $A, B \le 10$
Subtask #2 (10 points): $A, B \le 1,000$
Subtask #3 (80 points): original constraints
-----Example Input-----
4
1 1
2 3
4 6
8 9
-----Example Output-----
1
3
12
36
# cook your dish here
t = int(input())

for i in range(t):
 a,b = list(map(int,input().split()))
 
 #x=min(a,b)
 #y=max(a,b)
 count=0

 # for i in range(1,a+1):
 #     for j in range(1,b+1):
   
 #         if (i+j) %2 ==0:
 #             count+=1
 
 x = list(range(1,a+1))
 y = list(range(1,b+1))
 #print(x)
 #print(y)
 
 if len(x) % 2 != 0:
  even_x = len(x)//2
  odd_x = len(x)//2 +1
 else:
  even_x = len(x)//2
  odd_x = len(x)//2
  
 if len(y) % 2 !=0:
  even_y = len(y)//2
  odd_y = len(y)//2 +1
 else:
  even_y = len(y)//2
  odd_y = len(y)//2
  
 #print("even_x & even_y : ",even_x,even_y)
 #print("odd_x & odd_y : ",odd_x,odd_y)
 count = (even_x * even_y) + (odd_x * odd_y)
 
 
 print(count)

# cook your dish here
t = int(input())

for i in range(t):
 a,b = list(map(int,input().split()))
 
 #x=min(a,b)
 #y=max(a,b)
 count=0

 # for i in range(1,a+1):
 #     for j in range(1,b+1):
   
 #         if (i+j) %2 ==0:
 #             count+=1
 
 x = list(range(1,a+1))
 y = list(range(1,b+1))
 #print(x)
 #print(y)
 
 if len(x) % 2 != 0:
  even_x = len(x)//2
  odd_x = len(x)//2 +1
 else:
  even_x = len(x)//2
  odd_x = len(x)//2
  
 if len(y) % 2 !=0:
  even_y = len(y)//2
  odd_y = len(y)//2 +1
 else:
  even_y = len(y)//2
  odd_y = len(y)//2
  
 #print("even_x & even_y : ",even_x,even_y)
 #print("odd_x & odd_y : ",odd_x,odd_y)
 count = (even_x * even_y) + (odd_x * odd_y)
 
 
 print(count)
