#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  long long need;
  long long total;
  while (t--) {
    long long n, g, b;
    cin >> n >> g >> b;
    need = (n + 1) / 2;
    total = need / g * (g + b);
    if (need % g)
      total += need % g;
    else
      total -= b;
    cout << max(n, total) << endl;
  }
  return 0;
}
