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