#include <bits/stdc++.h>
const int MOD = (int)1e9 + 7;
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t;
  cin >> t;
  while (t--) {
    long long n, g, b;
    cin >> n >> g >> b;
    long long tot = g + b;
    long long req = n / 2;
    if (n % 2 == 1) req++;
    long long ses = req / g;
    if (ses == 0) {
      cout << n << endl;
      continue;
    }
    if (req % g != 0) ses++;
    long long used = ((ses - 1) * g);
    long long days = ((ses - 1) * tot) + (req - used);
    long long baki = n - req;
    if ((ses - 1) * b >= baki) {
      cout << days << endl;
    } else {
      long long bilai = 0;
      bilai = (ses - 1) * b;
      baki = baki - bilai;
      cout << days + baki << endl;
    }
  }
  return 0;
}
