#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
const double eps = 1e-8;
const int inf = 1e9;
const long long INF = 1e18;
const int mod = 1e9 + 7;
const int N = 1e5 + 5;
void solve() {
  int a, b;
  cin >> a >> b;
  cout << (a * b + 1) / 2 << "\n";
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int t = 1;
  cin >> t;
  for (int tc = 1; tc <= t; tc++) solve();
  return 0;
}
