#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    long long n, g, b;
    cin >> n >> g >> b;
    long long req = ceil(double(n) / 2);
    long long x = floor(double(req) / g);
    long long temp = x * (g + b);
    if (req % g) {
      temp += (req) % g;
    } else {
      temp -= b;
    }
    long long ans = max(n, temp);
    cout << ans << endl;
  }
}
