#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long int n, g, b, x;
  cin >> n >> g >> b;
  if (n % 2 == 0)
    x = (n / 2);
  else
    x = n / 2 + 1;
  if (x <= g) {
    cout << n << "\n";
    ;
    return;
  }
  long long int day = 0;
  long long int half = x / g;
  long long int h = half * g;
  long long int l = (half - 1) * b;
  day = h + l;
  if (h < x) {
    day += b;
    if (day + g > n)
      day += (x - h);
    else
      day += g;
  }
  while (day < n) {
    if (day + b >= n) {
      day += (n - day);
      break;
    } else
      day += b;
    if (day + g >= n) {
      day += (n - day);
      break;
    } else
      day += g;
  }
  cout << day << "\n";
  ;
}
int main() {
  int t = 1;
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
