#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  int t;
  scanf("%d", &t);
  while (t--) {
    ll n, g, b;
    scanf("%lld%lld%lld", &n, &g, &b);
    ll half = (n + 1) / 2;
    if (g >= n) {
      printf("%lld\n", n);
      continue;
    }
    ll x = half / g + (half % g != 0);
    printf("%lld\n", max(n, (x - 1) * 1LL * b + half));
  }
}
