#include <bits/stdc++.h>
using namespace std;
template <typename Number>
Number gcd(Number u, Number v) {
  while (v != 0) {
    Number r = u % v;
    u = v;
    v = r;
  }
  return u;
}
long long int binSearch(vector<long long int> v, long long int l,
                        long long int r, long long int x) {
  if (r >= l) {
    long long int mid = l + (r - l) / 2;
    if (v[mid] == x) return mid;
    if (v[mid] > x) return binSearch(v, l, mid - 1, x);
    return binSearch(v, mid + 1, r, x);
  }
  return -1;
}
void solve() {
  long long int n, g, b, o;
  cin >> n >> g >> b;
  o = n;
  n = ceil((double)n / 2);
  long long int ans = 0;
  if (n <= g) {
    cout << o << endl;
  } else {
    if (n % g == 0) {
      ans += (n / g);
      cout << max(o, ((ans - 1) * (g + b) + g)) << endl;
    } else {
      ans += (n / g);
      n -= ((ans) * (g));
      cout << max(o, ((ans) * (g + b) + n)) << endl;
    }
  }
  return;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long int t;
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
