#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, g, r, rg, eg, hn, b, nb, t;
  cin >> t;
  while (t--) {
    cin >> n >> g >> b;
    hn = (n + 1) / 2;
    rg = hn / g;
    eg = hn % g;
    nb = rg + !!eg - 1;
    r = rg * g + eg + nb * b;
    if (r >= n) {
      cout << r << endl;
    } else {
      cout << n << endl;
    }
  }
}
