#include <bits/stdc++.h>
using namespace std;
class abc {
 public:
  long long int x, y;
};
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long int tests;
  cin >> tests;
  for (long long int gg = 0; gg < tests; gg++) {
    long long int n, g, b;
    cin >> n >> g >> b;
    long long int half = n / 2;
    if (n % 2 != 0) {
      half++;
    }
    long long int a1 = half / (g);
    if (half % g != 0) {
      long long int ans = (g + b) * (a1);
      long long int rr = half % g;
      ans += min(g, rr);
      cout << max(ans, n) << "\n";
    } else {
      if (a1 == 0) {
        long long int ans = min(g, half);
        cout << max(ans, n) << "\n";
      } else {
        long long int ans = (g + b) * (a1 - 1);
        ans += g;
        cout << max(ans, n) << "\n";
      }
    }
  }
}
