#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t;
  cin >> t;
  while (t--) {
    long long int n, g, b;
    cin >> n >> g >> b;
    long long int x = (n + 1) / 2;
    long long int out;
    if (n <= g)
      cout << n << endl;
    else {
      if (x % g == 0) {
        out = x + (x / g - 1) * b;
        if (out < n)
          cout << n << endl;
        else
          cout << out << endl;
      } else {
        out = x + (x / g) * b;
        if (out < n)
          cout << n << endl;
        else
          cout << out << endl;
      }
    }
  }
}
