#include <bits/stdc++.h>
using namespace std;
long const M = 1e9 + 7;
const long mxN = 1e5 + 2;
const long mxNN = 1e6 + 2;
void solve() {
  long long n, g, b;
  cin >> n >> g >> b;
  long long k = (n + 1) / 2;
  long long ans = (k - 1) / g;
  long long rem = k % g;
  ans = ans * (g + b) + ((rem) ? rem : g);
  cout << max(n, ans) << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long t;
  cin >> t;
  while (t--) solve();
  return 0;
}
