#include <bits/stdc++.h>
using namespace std;
int main() {
  int T;
  scanf("%d", &T);
  while (T--) {
    long long n, g, b, ans;
    scanf("%lld%lld%lld", &n, &g, &b);
    if (g >= b) {
      printf("%d\n", n);
      continue;
    }
    int day = n / 2;
    if (n % 2 == 1) day++;
    long long a = day / g;
    if (day % g != 0) {
      ans = (g + b) * a + day % g;
      if (a * b < n - day) {
        ans += n - day - a * b;
      }
    } else {
      ans = (g + b) * (a - 1) + g;
      if ((a - 1) * (b) < n - day) ans += n - day - (a - 1) * b;
    }
    printf("%lld\n", ans);
  }
  return 0;
}
