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