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