#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int test;
  cin >> test;
  while (test--) {
    long long int n, g, b;
    cin >> n >> g >> b;
    if (ceil(n / 2.0) <= g || g >= b) {
      cout << n << endl;
      continue;
    }
    long long int good = ceil(n / 2.0);
    long long int k = (good / g);
    long long int extra = (good % g);
    long long int req = (k * g) + (k * b);
    if (extra == 0)
      req -= b;
    else
      req += extra;
    if (req < n) req = n;
    cout << req << endl;
  }
}
