#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int long long n, k, q, ans, mini, maxi, t, last, g, b;
  bool flag;
  cin >> t;
  string s;
  while (t--) {
    cin >> n >> g >> b;
    k = ceil(n / 2.0);
    if (k > g) {
      if (k % g == 0)
        cout << (int long long)max(n, (k / g - 1) * (g + b) + g) << endl;
      else
        cout << (int long long)max((k / g) * (g + b) + k % g, n) << endl;
    } else
      cout << n << endl;
  }
}
