#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long t;
  cin >> t;
  while (t--) {
    long long n, g, b;
    cin >> n >> g >> b;
    long long goodn;
    goodn = (n % 2 == 0) ? n / 2 : n / 2 + 1;
    long long temp1 = goodn / g;
    long long temp2 = goodn % g;
    long long impdays = 0;
    if (temp2 == 0) {
      impdays = temp1 * g + ((temp1 > 0) ? temp1 - 1 : 0) * b;
    } else {
      impdays = temp1 * g + (temp1)*b + temp2;
    }
    if (n >= impdays) {
      cout << n << endl;
    } else {
      cout << impdays << endl;
    }
  }
  return 0;
}
