#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long int t, ca;
  t = 1;
  cin >> t;
  for (ca = 1; ca <= t; ca++) {
    long long int a, b, c, xx, tday, div, ans, xy, cou;
    cin >> a >> b >> c;
    if (b >= c) {
      cout << a << endl;
    } else {
      xx = 2 * b;
      if (a % xx == 0)
        xy = (a / xx) - 1;
      else
        xy = (a / xx);
      a = a - xx * xy;
      cou = (c - b) * xy;
      ans = (b + c) * xy;
      if (cou * 2 >= a) {
        ans = ans + (a + 1) / 2;
        a = 0;
      } else {
        a = a - 2 * cou;
        ans = ans + cou;
      }
      ans = ans + a;
      cout << ans << endl;
    }
  }
}
