#include <bits/stdc++.h>
using namespace std;
long long n, g, b;
bool poss(long long mid, long long req) {
  long long q = mid / (g + b);
  long long r = mid % (g + b);
  long long gd = q * g;
  long long rg = min(g, r);
  gd += rg;
  if (gd >= req) {
    return true;
  } else {
    return false;
  }
}
int main() {
  long long t;
  cin >> t;
  while (t--) {
    cin >> n >> g >> b;
    long long req = ceil((n * 1.0) / 2);
    long long l = n, r = 1e18;
    long long ans;
    while (l <= r) {
      long long mid = (l + r) / 2;
      if (poss(mid, req)) {
        ans = mid;
        r = mid - 1;
      } else {
        l = mid + 1;
      }
    }
    cout << ans << '\n';
  }
  return 0;
}
