#include <bits/stdc++.h>
namespace wdnmd {
inline int read() {
  int 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 << 1) + (x << 3) + (c ^ 48);
    c = getchar();
  }
  return f * x;
}
inline void read(int &x) { x = read(); }
inline void read(int &x, int &y) { x = read(), y = read(); }
inline void read(int &x, int &y, int &z) { x = read(), y = read(), z = read(); }
inline void read(int &x, int &y, int &z, int &w) {
  x = read(), y = read(), z = read(), w = read();
}
inline long long readl() {
  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 << 1) + (x << 3) + (c ^ 48);
    c = getchar();
  }
  return f * x;
}
inline void read(long long &x) { x = readl(); }
inline void read(long long &x, long long &y) { x = readl(), y = readl(); }
inline void read(long long &x, long long &y, long long &z) {
  x = readl(), y = readl(), z = readl();
}
inline void read(long long &x, long long &y, long long &z, long long &w) {
  x = readl(), y = readl(), z = readl(), w = readl();
}
inline void writeln(int x) { printf("%d\n", x); }
inline void writeln(int x, int y) { printf("%d %d\n", x, y); }
inline void writeln(int x, int y, int z) { printf("%d %d %d\n", x, y, z); }
inline void writeln(int x, int y, int z, int w) {
  printf("%d %d %d %d\n", x, y, z, w);
}
inline void writeln(long long x) { printf("%lld\n", x); }
inline void writeln(long long x, long long y) { printf("%lld %lld\n", x, y); }
inline void writeln(long long x, long long y, long long z) {
  printf("%lld %lld %lld\n", x, y, z);
}
inline void writeln(long long x, long long y, long long z, long long w) {
  printf("%lld %lld %lld %lld\n", x, y, z, w);
}
inline void write(int x) { printf("%d", x); }
inline void write(int x, int y) { printf("%d %d", x, y); }
inline void write(int x, int y, int z) { printf("%d %d %d", x, y, z); }
inline void write(int x, int y, int z, int w) {
  printf("%d %d %d %d", x, y, z, w);
}
inline void write(long long x) { printf("%lld", x); }
inline void write(long long x, long long y) { printf("%lld %lld\n", x, y); }
inline void write(long long x, long long y, long long z) {
  printf("%lld %lld %lld\n", x, y, z);
}
inline void write(long long x, long long y, long long z, long long w) {
  printf("%lld %lld %lld %lld\n", x, y, z, w);
}
inline void write_(int x) { printf("%d ", x); }
inline void write_(long long x) { printf("%lld ", x); }
int gcd(int a, int b) { return b ? gcd(b, a & b) : a; }
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
inline int lowbit(int x) { return x & (-x); }
inline long long lowbit(long long x) { return x & (-x); }
inline long long qmi(int a, int k, int p) {
  long long res = 1 % p, base = a;
  while (k) {
    if (k & 1) res = res * base % p;
    base = base * base % p;
    k >>= 1;
  }
  return res;
}
inline long long qmi(int a, int k) {
  long long res = 1, base = a;
  while (k) {
    if (k & 1) res = res * base;
    base = base * base;
    k >>= 1;
  }
  return res;
}
template <typename T>
void chmin(T &x, const T &y) {
  if (x > y) x = y;
}
template <typename T>
void chmin(T &x, const T &y, const T &z) {
  if (x > y) x = y;
  if (x > z) x = z;
}
template <typename T>
void chmin(T &x, const T &y, const T &z, const T &w) {
  if (x > y) x = y;
  if (x > z) x = z;
  if (x > w) x = w;
}
template <typename T>
void chmax(T &x, const T &y) {
  if (x < y) x = y;
}
template <typename T>
void chmax(T &x, const T &y, const T &z) {
  if (x < y) x = y;
  if (x < z) x = z;
}
template <typename T>
void chmax(T &x, const T &y, const T &z, const T &w) {
  if (x < y) x = y;
  if (x < z) x = z;
  if (x < w) x = w;
}
}  // namespace wdnmd
using namespace wdnmd;
using namespace std;
const int N = 200050, M = 1000010, INF = 0x3f3f3f3f, MOD = 1000;
int main() {
  int cas = read();
  while (cas--) {
    int n, g, b;
    read(n, g, b);
    int need = (n + 1) / 2;
    int k1 = need / g;
    int ar = need - k1 * g;
    long long res;
    if (ar == 0) {
      res = (long long)(k1 - 1) * (g + b) + (long long)g;
      res = max(res, (long long)(n));
      writeln(res);
    } else {
      res = (long long)(k1) * (g + b) + ar;
      res = max(res, (long long)(n));
      writeln(res);
    }
  }
  return 0;
}
