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