#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    long long n, g, b, sm = 0, temp = 0;
    cin >> n >> g >> b;
    sm = (n + 1) / 2;
    temp = max(n - sm, (sm - 1) / g * b);
    cout << sm + temp << endl;
  }
}
