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