#include <bits/stdc++.h>
using namespace std;
deque<int> st;
int net[500000];
int N, M;
int main() {
  int t;
  cin >> t;
  while (t--) {
    long long n, g, b;
    cin >> n >> g >> b;
    long long mn = (n + 1) / 2;
    long long pr = mn / g;
    long long pro = (pr) * (g + b);
    pro += (mn % g == 0) ? -b : mn % g;
    cout << max(n, pro) << endl;
  }
}
