#include <bits/stdc++.h>
int main() {
  long long int T, j, n, g, b, p, q, r, s, t, m, o;
  scanf("%lld", &T);
  for (j = 1; j <= T; j = j + 1) {
    scanf("%lld %lld %lld", &n, &g, &b);
    long long int sum = 0, pum = 0;
    if (n % 2 == 0) {
      p = n / 2;
      m = n / g;
      q = p / g;
      r = p % g;
      if (m == 0) {
        sum = n;
      } else if (r == 0) {
        pum = (q * g) + ((q - 1) * b);
        s = (q - 1) * b;
        if (p - s > 0) {
          sum = pum + (p - s);
        } else {
          sum = pum;
        }
      } else if (r != 0) {
        pum = (q * g) + (q * b) + r;
        s = q * b;
        if (p - s > 0) {
          sum = pum + (p - s);
        } else {
          sum = pum;
        }
      }
    } else if (n % 2 != 0) {
      p = (n / 2) + 1;
      o = n / 2;
      m = n / g;
      q = p / g;
      r = p % g;
      if (m == 0) {
        sum = n;
      } else if (r == 0) {
        pum = (q * g) + ((q - 1) * b);
        s = (q - 1) * b;
        if (o - s > 0) {
          sum = pum + (o - s);
        } else {
          sum = pum;
        }
      } else if (r != 0) {
        pum = (q * g) + (q * b) + r;
        s = q * b;
        if (o - s > 0) {
          sum = pum + (o - s);
        } else {
          sum = pum;
        }
      }
    }
    printf("%lld\n", sum);
  }
}
