#include <bits/stdc++.h>
using namespace std;
bool isPrime(long long int n) {
  if (n <= 1) return false;
  if (n <= 3) return true;
  if (n % 2 == 0 || n % 3 == 0) return false;
  long long int p = sqrt(n);
  for (int i = 5; i <= p; i += 6)
    if (n % i == 0 || n % (i + 2) == 0) return false;
  return true;
}
long long int b2d(string n) {
  string num = n;
  long long int dec_value = 0;
  long long int base = 1;
  long long int len = num.length();
  for (int i = len - 1; i >= 0; i--) {
    if (num[i] == '1') dec_value += base;
    base = base * 2;
  }
  return dec_value;
}
int f, f1, f2;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t = 1;
  cin >> t;
  while (t--) {
    long long int n, g, b;
    cin >> n >> g >> b;
    long long int n1 = n % 2 ? n + 1 : n;
    long long int ans = 0;
    if (g >= b || n1 / 2 <= g)
      cout << n << endl;
    else {
      n1 = n1 / 2;
      n1 -= g;
      ans += g;
      ans += (g + b) * (n1 / g);
      if (n1 % g) ans += b + n1 % g;
      ans = max(ans, n);
      cout << ans << endl;
    }
  }
}
