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