#include <bits/stdc++.h>
using namespace std;
long long read() {
  long long x = 0, f = 1;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    x = x * 10 + c - '0';
    c = getchar();
  }
  return x * f;
}
int main() {
  int T = read();
  while (T--) {
    long long n = read(), g = read(), b = read();
    if (g >= b) {
      printf("%I64d\n", n);
      continue;
    }
    int m = (n + 1) / 2;
    long long k = (m + g - 1) / g;
    long long t = (k - 1) * (g + b);
    long long ans = t + m - (k - 1) * g;
    printf("%I64d\n", max(ans, n));
  }
  return 0;
}
