#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 5;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  if (fopen("A"
            ".INP",
            "r")) {
    freopen(
        "A"
        ".INP",
        "r", stdin);
    freopen(
        "A"
        ".OUT",
        "w", stdout);
  }
  int t;
  cin >> t;
  while (t--) {
    int n, g, b;
    cin >> n >> g >> b;
    int need = n / 2 + n % 2;
    if (need % g == 0)
      cout << max((long long)n, (long long)(need / g - 1) * (g + b) + g)
           << '\n';
    else
      cout << max((long long)n, (long long)(need / g) * (g + b) + need % g)
           << '\n';
  }
}
