#include <bits/stdc++.h>
using namespace std;
int main() {
  long long z, x, a, b, sum = 0, good, bad;
  long double y;
  cin >> z;
  for (long long i = 0; i < z; i++) {
    cin >> x >> a >> b;
    good = ceil(x / 2.0);
    y = ceil(good / (long double)a);
    y--;
    bad = y * b;
    sum = bad + good;
    if (sum >= x)
      cout << sum << endl;
    else if (sum < x)
      cout << x << endl;
  }
  return 0;
}
