#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    long long n, g, b;
    cin >> n >> g >> b;
    long long sure_fire = (n + 1) / 2;
    long long sum = 0;
    if (g >= b) {
      sum = n;
    } else {
      long long a1 = (sure_fire + g - 1) / g;
      sum = (a1 - 1) * (g + b);
      long long a2 = n - sure_fire - (a1 - 1) * b;
      if (a2 < 0) a2 = 0;
      sure_fire -= (a1 - 1) * g;
      sum += sure_fire + a2;
    }
    cout << sum << endl;
  }
  return 0;
}
