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