#include <bits/stdc++.h>
using namespace std;
int xx[4] = {0, 0, 1, -1};
int yy[4] = {-1, 1, 0, 0};
int fn_test(int x) {
  int y;
  if (x <= 1) {
    y = x;
  } else
    y = fn_test(x - 5);
  printf("%d\n", x);
  return y;
}
int main() {
  long long t;
  scanf("%lld", &t);
  ;
  while (t--) {
    long long n, g, b;
    scanf("%lld %lld %lld", &n, &g, &b);
    long long gx = n;
    n = ceil(n / 2.0);
    if (g >= n)
      cout << gx << endl;
    else {
      long long q = ceil(n / (double)g);
      long long res = 0;
      res = g * q + b * (q - 1);
      if ((q * g) > n) {
        res -= ((q * g) - n);
      }
      if (res < gx) res = gx;
      cout << res << endl;
    }
  }
}
