#include <bits/stdc++.h>
using namespace std;
long long int min(long long int a, long long int b) { return a >= b ? b : a; }
long long int gcdd(long long int a, long long int b) {
  if (b == 0) return a;
  return gcdd(b, a % b);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int t;
  cin >> t;
  while (t--) {
    long long int n, g, b, good_req, rem_good, bad_req, rem_bad, total_required;
    cin >> n >> g >> b;
    good_req = (n + 1) / 2;
    total_required = (good_req / g) * (g + b);
    if (good_req % g)
      total_required += good_req % g;
    else
      total_required -= b;
    cout << max(n, total_required) << "\n";
  }
  return 0;
}
