#include <bits/stdc++.h>
const long long mod = 1000000007;
const long long mod1 = 998244353;
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 rep = (n / 2) + (n % 2 == 1);
    long long l = 1, h = 1000000000000000000;
    long long ans = h;
    while (l <= h) {
      long long m = (h - l) / 2 + l;
      long long day = m / (g + b);
      day *= g;
      if (m % (g + b) > g)
        day += g;
      else
        day += m % (g + b);
      if (day >= rep and m >= n) {
        ans = m;
        h = m - 1;
      } else
        l = m + 1;
    }
    cout << ans << endl;
  }
}
