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