#include <bits/stdc++.h>
using namespace std;
int main() {
  long long t;
  cin >> t;
  while (t--) {
    long long n, g, b, x, y, ans;
    cin >> n >> g >> b;
    if (g >= (n + 1) / 2) {
      cout << n << endl;
      continue;
    }
    x = (n + 1) / 2;
    y = ceil(1.0 * x / g);
    ans = x + (y - 1) * b;
    if (ans < n) ans = n;
    cout << ans << endl;
  }
}
