#include <bits/stdc++.h>
using namespace std;
static const int WHITE = 0;
static const int GRAY = 1;
static const int BLACK = 2;
static const int INF = 0x3f3f3f3f;
long long Pow(long long a, long long b, long long mod) {
  if (b == 0) return 1 % mod;
  long long sum = 1;
  a = a % mod;
  while (b > 0) {
    if (b % 2 == 1) sum = (sum * a) % mod;
    b /= 2;
    a = (a * a) % mod;
  }
  return sum;
}
int main() {
  int T;
  cin >> T;
  while (T--) {
    long long n, g, b;
    long long gr, br;
    long long ans = 0;
    cin >> n >> g >> b;
    if (n % 2 == 0) {
      gr = n / 2;
      br = n / 2;
    } else {
      gr = n / 2 + 1;
      br = n - gr;
    }
    if (gr - g < 0)
      cout << n << endl;
    else {
      gr -= g;
      ans += g;
      long long zhouqi;
      long long gday, bday;
      if (gr % g == 0) {
        zhouqi = gr / g;
        gday = zhouqi * g;
        bday = zhouqi * b;
      } else {
        zhouqi = gr / g;
        gr = gr - g * zhouqi;
        gday = zhouqi * g + gr;
        bday = (zhouqi + 1) * b;
      }
      ans = ans + gday + bday;
      if (br > bday) ans += br - bday;
      cout << ans << endl;
    }
  }
  return 0;
}
