#include <bits/stdc++.h>
using namespace std;
long double pi = 3.14159265358979323;
const double EPS = 1e-12;
const int N = 1e6 + 5;
const int mod = 1e9 + 7;
long long n, g, b;
bool check(long long mid) {
  long long cnt = mid / (g + b);
  long long val = cnt * g;
  long long p = mid % (g + b);
  val += min(g, p);
  return val >= (n + 1) / 2;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  long long t;
  cin >> t;
  while (t--) {
    cin >> n >> g >> b;
    long long lo = n, hi = 1e18;
    while (lo <= hi) {
      long long mid = (lo + hi) / 2;
      if (check(mid)) {
        hi = mid - 1;
      } else
        lo = mid + 1;
    }
    cout << hi + 1 << "\n";
  }
  return 0;
}
