#include <bits/stdc++.h>
using namespace std;
const int M = (int)1e2;
int main() {
  int T;
  scanf("%d", &T);
  for (int ca = 1; ca <= T; ++ca) {
    int n, g, b;
    scanf("%d %d %d", &n, &g, &b);
    long long l = 0, r = (long long)1e18, mid, tmp = (n + 1) / 2;
    while (l < r) {
      mid = (l + r) >> 1;
      if (tmp <= mid / (b + g) * g + min(mid % (g + b), 1ll * g))
        r = mid;
      else
        l = mid + 1;
    }
    printf("%lld\n", max(n * 1ll, r));
  }
  return 0;
}
