| TheForces Round #31 (Div2.9-Forces) |
|---|
| Finished |
There is a chessboard containing $$$n$$$ rows and $$$m$$$ columns. Cell at the $$$i^{th}$$$ row and $$$j^{th}$$$ column is denoted as $$$(i,j)$$$. Cell $$$(i,j)$$$ is colored white if $$$(i+j)$$$ is even; otherwise, it is colored black.
Your task is to place the maximum kings on white cells such that no two kings attack each other.
Two kings will attack each other if their cells are adjacent by edge or corner.
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 10^4$$$). The description of the test cases follows.
The first line of each testcase contains two space-separated integers $$$n$$$ and $$$m$$$ ($$$1 \le n,m \le 100$$$).
For each test case, print a single integer — the maximum number of kings placed on the given chessboard which satisfies the given condition.
62 36 14 47 86 74 9
2 3 4 16 12 10
| Name |
|---|


