#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e5;
const int MAXD = 21;
const int INF = 1e9;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int q;
  cin >> q;
  for (int t = 0; t < q; ++t) {
    long long n, g, b;
    cin >> n >> g >> b;
    if (g >= b) {
      cout << n << endl;
    } else {
      long long ng = (n + 1) / 2;
      long long ans = (ng / g) * (g + b) + (ng % g);
      if ((ng % g) == 0) {
        ans -= b;
      }
      ans = max(ans, n);
      cout << ans << endl;
    }
  }
  return 0;
}
