#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5, mod = 1e9 + 7;
int main() {
  int t;
  cin >> t;
  while (t--) {
    long long n, g, b;
    cin >> n >> g >> b;
    if (g >= b)
      cout << n << '\n';
    else {
      long long ans = (n + 1) / 2;
      ans = (ans + g - 1) / g - 1;
      ans *= b;
      cout << max(n * 1LL, ans + (n + 1) / 2) << "\n";
    }
  }
  return 0;
}
