#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int t;
  cin >> t;
  while (t--) {
    long long int total, good, bad;
    cin >> total >> good >> bad;
    if (good >= bad)
      cout << total;
    else {
      long long int good_day = (total + 1) / 2, bad_day;
      if (good_day % good == 0) {
        bad_day = max(total - good_day, ((good_day / good) - 1) * bad);
      } else {
        bad_day = max(total - good_day, ((good_day / good)) * bad);
      }
      cout << good_day + bad_day;
    }
    cout << endl;
  }
}
