#include <bits/stdc++.h>
using namespace std;
int main() {
  long long t, n, g, b, i, p, q, m;
  cin >> t;
  while (t--) {
    cin >> n >> g >> b;
    if (n <= g)
      cout << n << endl;
    else {
      if (n % 2 != 0) {
        m = (n / 2) + 1;
      } else
        m = n / 2;
      q = m / g;
      p = ((g + b) * q) - b;
      if (m % g != 0) {
        p = p + b + (m - (q * g));
      }
      if (p > n)
        cout << p << endl;
      else
        cout << n << endl;
    }
  }
  return 0;
}
