#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline void read(T &x) {
  bool b = 0;
  char c;
  while (!isdigit(c = getchar()) && c != '-')
    ;
  if (c == '-') c = getchar(), b = 1;
  x = c - 48;
  while (isdigit(c = getchar())) x = (x << 3) + (x << 1) + c - 48;
  if (b) x = -x;
}
template <typename T>
inline void wrip(T x) {
  if (x > 9) wrip(x / 10);
  putchar(x % 10 + 48);
}
template <typename T>
inline void write(T x) {
  if (x < 0) putchar('-'), x = -x;
  wrip(x);
  putchar(' ');
}
template <typename T>
inline void writeln(T x) {
  if (x < 0) putchar('-'), x = -x;
  wrip(x);
  putchar('\n');
}
inline char readch() {
  char c;
  do c = getchar();
  while (c == '\n' || c == ' ');
  return c;
}
inline void reads(string &s) {
  char c;
  s = "";
  do c = getchar();
  while (c == ' ' || c == '\n');
  do {
    s += c;
    c = getchar();
  } while (c != ' ' && c != '\n');
}
const long double pi = acos(-1);
const int inf = 1e9, mod = 1e9 + 7, N = 1e6 + 11;
int n, a[N], b[N];
string s;
int main() {
  int ntest;
  read(ntest);
  while (ntest--) {
    long long n, g, b, h, m, res;
    read(n);
    read(g);
    read(b);
    m = (n + 1) / 2;
    if (g >= m || g >= b) {
      cout << n << '\n';
      continue;
    }
    h = (m - 1) / g + 1;
    res = (h - 1) * b + m;
    if (res < n) res = n;
    cout << res << '\n';
  }
}
