#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    long double n, m;
    cin >> n >> m;
    long long int val = ceil(n * m / 2);
    cout << val << "\n";
  }
}
