#include <bits/stdc++.h>
using namespace std;
void test() {
  long long n, g, b;
  cin >> n >> g >> b;
  long long req = n / 2;
  if (n % 2 != 0) req++;
  long long cycle = req / g;
  long long rem = req % g;
  if (rem == 0) {
    cycle--;
    rem = g;
  }
  long long tot = cycle * (g + b);
  tot = tot + rem;
  long long left = n - tot;
  if (left < 0) left = 0;
  tot = tot + left;
  cout << tot << "\n";
}
int main() {
  int t = 1;
  cin >> t;
  while (t-- > 0) {
    test();
  }
}
