#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int N;
  cin >> N;
  while (N--) {
    long long n, g, b;
    cin >> n >> g >> b;
    long long l = 0, r = 1e18, req = (n + 1) / 2, mid;
    while (l < r) {
      mid = (r + l) / 2;
      if ((mid / (g + b) * g + min(mid % (g + b), g)) >= req) {
        r = mid;
      } else {
        l = mid + 1;
      }
    }
    if (l < n) {
      cout << n << '\n';
    } else {
      cout << l << '\n';
    }
  }
}
