#include <bits/stdc++.h>
using namespace std;
const long long one = 1;
const long long INF = 2e18;
const long long MOD = 1e9 + 7;
const long long N = 40040 + 10;
const long long nul = 0;
long long f(long long mid, long long g, long long b) {
  long long ans = (mid / (g + b)) * g;
  mid %= (g + b);
  ans += min(mid, g);
  return ans;
}
signed main() {
  long long q;
  cin >> q;
  while (q--) {
    long long n, g, b;
    cin >> n >> g >> b;
    long long l = 0, r = INF;
    long long x = (n - 1) / 2 + 1;
    while (r - l > 1) {
      long long mid = (l + r) / 2;
      if (f(mid, g, b) >= x)
        r = mid;
      else
        l = mid;
    }
    cout << max(r, n) << endl;
  }
}
