#include <bits/stdc++.h>
using namespace std;
int main() {
  int tc = 1;
  cin >> tc;
  while (tc--) {
    long long n, g, b;
    cin >> n >> g >> b;
    if ((n + 1) / 2 <= g)
      cout << n << endl;
    else {
      long long orig = n;
      n = (n + 1) / 2;
      long long res = (n / g) * (g + b);
      if (n % g != 0)
        res += (n % g);
      else
        res -= b;
      cout << max(res, orig) << endl;
    }
  }
  return 0;
}
