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