#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1.0);
int main() {
  ios::sync_with_stdio(false);
  int t;
  cin >> t;
  while (t--) {
    long long n, g, b;
    long long ans = 0;
    cin >> n >> g >> b;
    long long tn = n;
    n = (n + 1) / 2;
    long long sum = g + b;
    if (n <= g)
      ans = tn;
    else {
      long long tt = n / g;
      n %= g;
      if (n == 0) {
        tt--;
        ans = tt * sum + g;
        ans = max(ans, tn);
      } else {
        ans = tt * sum + n;
        ans = max(ans, tn);
      }
    }
    cout << ans << endl;
  }
  return 0;
}
