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