#include <bits/stdc++.h>
using namespace std;
int main() {
  long long t;
  cin >> t;
  while (t--) {
    long long n, g, b;
    cin >> n >> g >> b;
    long long mid = (n + 1) / 2;
    if (mid <= g) {
      cout << n << "\n";
      continue;
    }
    if (mid % g == 0) {
      long long ans = (mid / g) * (g + b) - b;
      if (ans < n) ans += n - ans;
      cout << ans << "\n";
    } else {
      long long ans = (mid / g) * (g + b) + mid % g;
      if (ans < n) ans += n - ans;
      cout << ans << "\n";
    }
  }
  return 0;
}
