#include <bits/stdc++.h>
using namespace std;
int main() {
  int T;
  cin >> T;
  while (T--) {
    long long n, g, b;
    cin >> n >> g >> b;
    long long good;
    long long ans = 0;
    if (n % 2 == 0) {
      good = n / 2;
    } else
      good = n / 2 + 1;
    long long good_segs;
    if (good % g == 0) {
      good_segs = good / g;
      ans += good_segs * g;
    } else {
      ans += good;
      good_segs = good / g + 1;
    }
    if ((good_segs - 1) * b >= n / 2) {
      ans += (good_segs - 1) * b;
    } else {
      ans += (n / 2);
    }
    cout << ans << endl;
  }
}
