#include <bits/stdc++.h>
using namespace std;
int dx[] = {0, 0, 1, -1, -1, -1, 1, 1};
int dy[] = {1, -1, 0, 0, -1, 1, 1, -1};
template <class T>
inline T biton(T n, T pos) {
  return n | ((T)1 << pos);
}
template <class T>
inline T bitoff(T n, T pos) {
  return n & ~((T)1 << pos);
}
template <class T>
inline T ison(T n, T pos) {
  return (bool)(n & ((T)1 << pos));
}
template <class T>
inline T gcd(T a, T b) {
  while (b) {
    a %= b;
    swap(a, b);
  }
  return a;
}
inline int nxt() {
  int aaa;
  scanf("%d", &aaa);
  return aaa;
}
inline long long lxt() {
  long long aaa;
  scanf("%lld", &aaa);
  return aaa;
}
inline double dxt() {
  double aaa;
  scanf("%lf", &aaa);
  return aaa;
}
template <class T>
inline T bigmod(T p, T e, T m) {
  T ret = 1;
  for (; e > 0; e >>= 1) {
    if (e & 1) ret = (ret * p) % m;
    p = (p * p) % m;
  }
  return (T)ret;
}
void solve() {
  long long n = lxt(), g = lxt(), b = lxt();
  long long cnt = 0, sum = 0;
  long long x = n / 2;
  if (n % 2 == 1) x += 1;
  if (n <= g) {
    cout << n << endl;
    return;
  }
  long long r = x % g;
  long long d = x / g;
  if (r == 0)
    sum += (d * g) + ((d - 1) * b);
  else
    sum += (d * g) + (d * b) + r;
  cout << max(sum, n) << endl;
}
int main() {
  cout.setf(ios::fixed);
  cout.precision(10);
  int tc = nxt();
  while (tc--) {
    solve();
  }
  return 0;
}
