#include <bits/stdc++.h>
const int N = 1e6 + 10;
const int mod = 1e7 + 9;
const int maxn = 0x3f3f3f3f;
const int minn = 0xc0c0c0c0;
const int inf = 99999999;
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t;
  cin >> t;
  while (t--) {
    long long n, a, b;
    cin >> n >> a >> b;
    long long ask = (n + 1) / 2, sum;
    if (ask % a == 0)
      sum = (ask / a - 1) * (a + b) + (ask - (ask / a - 1) * a);
    else
      sum = (ask / a) * (a + b) + ask % a;
    if (sum < n) sum = n;
    cout << sum << endl;
  }
  return 0;
}
