#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int t;
  scanf("%d", &t);
  while (t--) {
    int n, g, b, tot, m;
    long long ans2;
    scanf("%d%d%d", &n, &g, &b);
    m = n / 2 + (n & 1);
    tot = g + b;
    int cnt = m / g, mod = m % g;
    long long ans = (long long)cnt * tot;
    if (mod == 0)
      ans -= b;
    else
      ans += mod;
    ans2 = ans - m;
    if (ans2 < n - m) ans += n - m - ans2;
    printf("%I64d\n", ans);
  }
  return 0;
}
