#include <bits/stdc++.h>
#pragma warning(disable : 4996)
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  long long t;
  cin >> t;
  while (t--) {
    long long n, g, b;
    cin >> n >> g >> b;
    long long need = n / 2 + n % 2;
    long long ret = (need / g) * (g + b);
    if (need % g == 0)
      ret -= b;
    else
      ret += need % g;
    cout << max(ret, n) << "\n";
  }
  return 0;
}
