#include <bits/stdc++.h>
using namespace std;
long long modF = 1e9 + 7;
long long INF = 1e11;
long long ceil(long long a, long long b) {
  long long res = a / b;
  if (a % b != 0) res++;
  return res;
}
void solve() {
  long long n, g, b;
  cin >> n >> g >> b;
  long long req = ceil(n, 2);
  long long ng = ceil(req, g);
  long long bb = ng - 1;
  long long bdb = bb * b;
  long long ans = 0;
  if (bdb >= n - req) {
    cout << (b)*bb + req << "\n";
  } else {
    cout << n << "\n";
  }
}
signed main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long T;
  cin >> T;
  while (T--) {
    solve();
  }
  return 0;
}
