#include <bits/stdc++.h>
using namespace std;
const int N = 105;
int n, g, b;
void preprocessing() { scanf("%d%d%d", &n, &g, &b); }
void solve() {
  long long m = n;
  n = (n + 1) / 2;
  long long t = n / g;
  cout << max(n + (t - (t * g == n)) * b, m) << endl;
}
int main() {
  int T;
  scanf("%d", &T);
  for (int Case = 0; Case < T; ++Case) {
    preprocessing();
    solve();
  }
  return 0;
}
