#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int t;
  cin >> t;
  while (t--) {
    long long n, g, b, n_days;
    cin >> n >> g >> b;
    long long least = (n / 2 + n % 2);
    n_days = (least % g) ? (g + b) * (least / g) + least % g
                         : (g + b) * ((least - 1) / g) + g;
    cout << max(n, n_days) << '\n';
  }
  return 0;
}
