#include <bits/stdc++.h>
using namespace std;
int main() {
  int t, n, b, g, z;
  cin >> t;
  while (t--) {
    cin >> n >> g >> b;
    int w;
    if (n % 2 == 0) {
      w = n / 2;
      if (w % g == 0) {
        z = w / g;
      } else {
        z = w / g + 1;
      }
    } else {
      w = n / 2 + 1;
      if (w % g == 0) {
        z = w / g;
      } else {
        z = w / g + 1;
      }
    }
    long long finish = 0;
    if (w <= g) {
      finish = n;
    } else {
      long long reqh = 0;
      int count = 0;
      finish = z * (long long)g;
      reqh = finish;
      finish = finish + (z - 1) * (long long)b;
      if (finish <= n) {
        finish = finish + (n - finish);
      } else {
        if (reqh > w) {
          finish = finish - (reqh - w);
          if (finish < n) {
            finish = finish + (n - finish);
          }
        }
      }
    }
    cout << finish << endl;
  }
  return 0;
}
