#include <bits/stdc++.h>
using namespace std;
bool debug = false;
vector<int> G[(3 * 100000 + 42)];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int T;
  cin >> T;
  while (T--) {
    long long n, g, b;
    cin >> n >> g >> b;
    long long req = (n + 1) / 2;
    if (g >= req) {
      cout << max(n, req) << "\n";
      continue;
    }
    long long tmp = req / g;
    long long days = tmp * g + max((tmp - 1), 0LL) * b;
    int need = req % g;
    if (need) need += b;
    cout << max(days + need, n) << "\n";
  }
  return 0;
}
