#include <bits/stdc++.h>
using namespace std;
long long int n, g, b, half;
bool check(long long int val) {
  long long int temp = val / (g + b);
  long long int ans = val - temp * (g + b);
  temp *= g;
  temp += min(g, ans);
  return (temp >= half);
}
void solve() {
  long long int i, j, val, ans;
  cin >> n >> g >> b;
  long long int lo = n, hi = 1e18;
  long long int mid;
  half = ceil(n / 2.0);
  while (lo <= hi) {
    mid = (lo + hi) / 2;
    if (check(mid)) {
      ans = mid;
      hi = mid - 1;
    } else {
      lo = mid + 1;
    }
  }
  cout << ans << '\n';
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long int t = 1;
  cin >> t;
  while (t--) solve();
  return 0;
}
