#include <bits/stdc++.h>
using namespace std;
const long long maxn = 1e6 + 5;
int main() {
  long long T, n, g, b, t, len, ans;
  scanf("%lld", &T);
  while (T--) {
    scanf("%lld %lld %lld", &n, &g, &b);
    len = (n + 1) / 2;
    t = len / g;
    if (len % g != 0) t++;
    ans = t * g + (t - 1) * b;
    ans -= (t * g - len);
    if (ans < n)
      printf("%lld\n", n);
    else
      printf("%lld\n", ans);
  }
  return 0;
}
