#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e9 + 7;
signed main() {
  std::ios::sync_with_stdio(0);
  std::cin.tie(0);
  ;
  long long t;
  cin >> t;
  while (t--) {
    long long n, g, b;
    cin >> n >> g >> b;
    long long l = n, r = (long long)1e18 + 7;
    while (l <= r) {
      long long m = (l + r) / 2;
      long long good = m / (g + b) * g;
      good += min(g, m % (g + b));
      if (good >= (n + 1) / 2)
        r = m - 1;
      else
        l = m + 1;
    }
    cout << l << endl;
  }
}
