#include <bits/stdc++.h>
int T, n, g, b;
int main() {
  scanf("%d", &T);
  while (T--) {
    scanf("%d%d%d", &n, &g, &b);
    int good = ceil((double)n / 2.0);
    long long T = good / g, ans;
    if (T * g == good) {
      ans = T * g + (T - 1) * b;
      if (n - good > (T - 1) * b) ans += n - good - (T - 1) * b;
    } else {
      ans = T * b + good;
      if (n - good > T * b) ans += n - good - T * b;
    }
    printf("%lld\n", ans);
  }
}
