#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long int n, g, b;
  cin >> n >> g >> b;
  long long int avg = (n + 1) / 2;
  long long int days = (avg / g) * (g + b);
  if (avg % g == 0)
    days -= b;
  else
    days += avg % g;
  cout << max(days, n) << "\n";
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  int t = 1;
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
