There are n * m students standing in a matrix of n rows and m columns. Select 3 students from the matrix and draw a rope to form a closed polygon. If a student stands in a closed polygon (excluding the edges) made of rope, then the student is selected.
Now I need you to help me figure out how many students have been selected?
First line contains a positive integer t (t <= 10), the number of test cases.
In each test case, the first line contains three integers n, m.
For each test case output a single line containing a positive integer, number of selected students.
2 5 5 2 2 2 4 4 3 2 2 1 1 1 2 2 2
1 0