#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
const long long INF = 1e18;
const int INFTY = 2147483643;
const long double PI = 4 * atan((long double)1);
struct pair_hash {
  template <class T1, class T2>
  std::size_t operator()(const std::pair<T1, T2> &pair) const {
    return std::hash<T1>()(pair.first) ^ std::hash<T2>()(pair.second);
  }
};
void setIO() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
long long T;
int main(void) {
  setIO();
  cin >> T;
  while (T--) {
    long long N, G, B;
    long long ans = 0;
    cin >> N >> G >> B;
    long long goal = (N + 1) / 2;
    long long cycle = B + G;
    long long numcyclesneeded = goal / G;
    bool flag = false;
    if (goal % G != 0) {
    } else {
      flag = true;
    }
    ans += (numcyclesneeded * cycle) + (goal % G);
    if (flag) ans -= B;
    ans = ((ans) > (N) ? (ans) : (N));
    cout << ans << endl;
  }
}
