#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int t;
  cin >> t;
  while (t--) {
    long long n, g, b;
    cin >> n >> g >> b;
    long long req, total;
    if (n % 2 != 0)
      req = n / 2 + 1;
    else
      req = n / 2;
    if (req % g == 0)
      total = req + (req / g - 1) * b;
    else
      total = req + (req / g) * b;
    if (total < n) total += (n - total);
    cout << total << endl;
  }
}
