#include <bits/stdc++.h>
using namespace std;
template <class code>
inline code read(const code &a) {
  code x = 0;
  short w = 0;
  char ch = 0;
  while (!isdigit(ch)) {
    w |= ch == '-';
    ch = getchar();
  }
  while (isdigit(ch)) {
    x = (x << 3) + (x << 1) + (ch ^ 48);
    ch = getchar();
  }
  return w ? -x : x;
}
int main() {
  int t = read(t);
  while (t--) {
    unsigned long long n = read(n);
    unsigned long long g = read(g);
    unsigned long long b = read(b);
    unsigned long long l = (n + 1) / 2;
    unsigned long long tot = g + b;
    unsigned long long q1 = l / g, q2 = l % g;
    if (q2 == 0) q2 = g, q1--;
    unsigned long long ans = max(q1 * tot + q2, n);
    printf("%lld\n", ans);
  }
  return 0;
}
