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