#K86627. Maximum People Seating on Benches

    ID: 36907 Type: Default 1000ms 256MiB

Maximum People Seating on Benches

Maximum People Seating on Benches

You are given B benches and each bench has S seats. Following the seating guidelines, the maximum number of people that can be seated is determined by the formula:

\(\text{max people} = \left\lfloor \frac{B+1}{2} \right\rfloor \times \left\lfloor \frac{S+1}{2} \right\rfloor\)

Your task is to compute this value for multiple test cases. For each test case, you will be given two integers representing the number of benches (B) and the number of seats per bench (S). Note that if either B or S is zero, then no one can be seated.

inputFormat

The input begins with an integer T representing the number of test cases. This is followed by T lines, each containing two space-separated integers B and S.

T
B1 S1
B2 S2
... 
BT ST

outputFormat

For each test case, output a single line containing the maximum number of people that can be seated according to the guidelines described above.

## sample
5
1 5
3 3
4 4
2 2
5 1
3

4 4 1 3

</p>