#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int t, z = 1;
  cin >> t;
  cin.ignore();
  while (t--) {
    long long int n, g, b;
    cin >> n >> g >> b;
    long long int target = n / 2;
    if (n & 1) target += 1;
    long long int p = target / g, ans = 0;
    ans += p * g + target % g;
    if (p > 0 && target % g == 0)
      ans += (p - 1) * b;
    else if (p > 0 && target % g != 0)
      ans += p * b;
    if (ans >= n)
      cout << ans << "\n";
    else
      cout << (ans + (n - ans)) << "\n";
  }
}
