#include <bits/stdc++.h>
using namespace std;
int main() {
  int T;
  cin >> T;
  while (T--) {
    long long n, g, b;
    cin >> n >> g >> b;
    if (n <= g) {
      cout << n << "\n";
      continue;
    }
    long long half = (n / 2) + (n % 2);
    long long gcomp = half / g;
    long long ngc = g * gcomp;
    long long grem = max(half - ngc, 0LL);
    long long brem = max(n - half - ((gcomp - 1) * b), 0LL);
    if (!grem && !brem) {
      cout << gcomp * g + ((gcomp - 1) * b) << "\n";
    } else if (!grem && brem) {
      cout << gcomp * g + ((gcomp - 1) * b) + brem << "\n";
    } else if (grem && !brem) {
      cout << gcomp * g + ((gcomp - 1) * b) + b + grem << "\n";
    } else {
      brem = max(brem - b, 0LL);
      cout << gcomp * g + ((gcomp - 1) * b) + b + grem + brem << "\n";
    }
  }
}
