#include <bits/stdc++.h>
using namespace std;
int T, n, a, b;
bool check(long long t) {
  long long p = t / (a + b);
  long long t1 = p * a + min(t - p * (a + b), 1LL * a);
  if (t1 >= n - n / 2) return true;
  return false;
}
int main() {
  scanf("%d", &T);
  while (T--) {
    scanf("%d%d%d", &n, &a, &b);
    long long l = n, r = 1e18;
    while (l < r) {
      long long mid = (l + r) >> 1LL;
      if (check(mid))
        r = mid;
      else
        l = mid + 1;
    }
    printf("%lld\n", l);
  }
  return 0;
}
