#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll inf = 1e18;
const int N = 2 * 1e5 + 10;
ll res;
ll a[N];
bool ok(ll m, ll n, ll g, ll b) {
  ll gg = (n + 1) / 2;
  ll have = g * (m / (g + b)) + min(g, m % (g + b));
  return have >= gg;
}
void solve() {
  ll n, g, b;
  cin >> n >> g >> b;
  ll lo = n - 1, hi = inf;
  while (lo + 1 < hi) {
    ll m = lo + hi >> 1LL;
    if (ok(m, n, g, b))
      hi = m;
    else
      lo = m;
  }
  cout << hi << "\n";
}
int main(int argc, char const *argv[]) {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  ll t = 1;
  cin >> t;
  while (t--) {
    solve();
  }
}
