#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int a, b, c, d, e, f, t;
  cin >> t;
  while (t--) {
    cin >> a >> b >> c;
    if (a <= b) {
      cout << a << endl;
    } else {
      d = a / 2;
      if (a % 2 != 0) {
        d++;
      }
      e = d / b;
      if (d % b != 0) {
        e++;
      }
      e--;
      f = e * c + e * b + (d - e * b);
      if (f <= a) {
        cout << a << endl;
      } else {
        cout << f << endl;
      }
    }
  }
}
