#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  std::cin >> t;
  while (t--) {
    long long int n, g, b;
    std::cin >> n >> g >> b;
    long long int temp = (n / 2 + n % 2);
    long long int g_t = (temp / g + (temp % g != 0));
    long long int g_d = g_t * g, b_d = (g_t - 1) * b;
    long long int g_left = g_d - temp;
    if ((g_d - g_left + b_d) >= n) {
      long long int days = g_d - g_left + b_d;
      std::cout << days << std::endl;
    } else {
      long long int tmp = n - (g_d - g_left + b_d);
      std::cout << g_d - g_left + b_d + tmp << std::endl;
    }
  }
  return 0;
}
