#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long t;
  cin >> t;
  while (t--) {
    long long n, g, b;
    cin >> n >> g >> b;
    long long ans = (n + 1) / 2;
    ans /= g;
    long long fias;
    long long so = (n + 1) / 2;
    if ((so) % g == 0) {
      fias = ans * g + (ans - 1) * b;
    } else {
      fias = (ans * g + ans * b) + ((n + 1) / 2) % g;
    }
    fias = max(fias, n);
    cout << fias << "\n";
  }
}
