#include <bits/stdc++.h>
using namespace std;
int main() {
  long long t;
  cin >> t;
  while (t--) {
    long long n, g, b;
    cin >> n >> g >> b;
    long long k = ceil(n / 2.0);
    if (g >= b) {
      cout << n << endl;
    } else {
      long long sum = 0;
      if (k <= g) {
        sum = k;
      } else {
        sum = k / g * b;
        sum += k;
        if (k % g == 0) {
          sum -= b;
        }
      }
      cout << max(n, sum) << endl;
    }
  }
}
