#include <bits/stdc++.h>
using namespace std;
double const pi = 3.1415926536;
int main() {
  int t;
  cin >> t;
  while (t--) {
    long long n, g, b;
    cin >> n >> g >> b;
    long long norm = (n + 1) / 2;
    long long u;
    if (norm % g == 0) {
      cout << max(n, norm + (norm / g - 1) * b) << endl;
    } else {
      cout << max(n, norm + (norm / g) * b) << endl;
    }
  }
}
