#include <bits/stdc++.h>
using namespace std;
template <class T>
using minheap = priority_queue<T, vector<T>, greater<T>>;
template <typename T>
void setmax(T& a, T b) {
  a = max(a, b);
};
template <typename T>
void setmin(T& a, T b) {
  a = min(a, b);
};
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t;
  cin >> t;
  while (t--) {
    long long n, g, b;
    cin >> n >> g >> b;
    long long period = g + b;
    long long lo = 1, hi = 1e18, ans = hi;
    while (lo <= hi) {
      long long mid = (lo + hi) / 2;
      long long good = g * (mid / period) + min(g, mid % period);
      long long bad = b * (mid / period) + max(0ll, mid % period - g);
      if (good + bad >= n && 2 * good >= n) {
        ans = mid;
        hi = mid - 1;
      } else {
        lo = mid + 1;
      }
    }
    cout << ans << '\n';
  }
  return 0;
}
