#include <bits/stdc++.h>
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
const long long MAX = 5100000;
const long long INF = 1LL << 60;
const long long mod = 1000000007LL;
using namespace std;
int main() {
  long long t;
  scanf("%lld", &t);
  while (t--) {
    long long n, g, b;
    scanf("%lld %lld %lld", &n, &g, &b);
    long long req = (n + 1) / 2;
    long long cnt = req / g;
    if (req % g == 0) {
      cnt--;
    }
    long long r = req - cnt * g;
    long long res = cnt * (g + b) + r;
    chmax(res, n);
    printf("%lld\n", res);
  }
  return 0;
}
