#include <bits/stdc++.h>
using namespace std;
using namespace std::chrono;
const int M = 1e9 + 7;
void darcarys() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
bool isprime(long long int a) {
  if (a == 1) return false;
  if (a == 2) return true;
  if (a % 2 == 0) return false;
  for (long long int i = 3; (i * i) <= a; i += 2) {
    if (a % i == 0) return false;
  }
  return true;
}
signed main() {
  darcarys();
  int t;
  cin >> t;
  while (t--) {
    long long int n, g, b;
    cin >> n >> g >> b;
    long long int ans = 0;
    long long int needG = (n + 1) / 2;
    long long int totalG = needG / g * (b + g);
    if (needG % g == 0)
      totalG -= b;
    else
      totalG += needG % g;
    cout << max(n, totalG) << "\n";
  }
  return 0;
}
