#include <bits/stdc++.h>
using namespace std;
int main() {
  int cs = 1;
  int cn = 1;
  cin >> cs;
  int x = cs;
  while (cs--) {
    long long int ans = 0;
    long long int n, a, b;
    cin >> n >> a >> b;
    long long int fhalf = (n + 1) / 2;
    long long int totalg = fhalf / a * (a + b);
    totalg += (fhalf % a == 0) ? (-b) : fhalf % a;
    ans = max(totalg, n);
    cout << ans << endl;
  }
}
