#include <bits/stdc++.h>
using namespace std;
int t;
long long int res[10001];
int main() {
  cin >> t;
  for (int i = 0; i < t; i++) {
    long long int n, g, b;
    cin >> n >> g >> b;
    long long int kaf = n / 2;
    long long int saghf = n - kaf;
    long long int res1 = (saghf / g) * (g + b);
    if ((saghf % g) > 0) {
      res1 = res1 + saghf % g;
    } else {
      res1 = res1 - b;
    }
    if (res1 < n) res1 = n;
    res[i] = res1;
  }
  for (int i = 0; i < t; i++) cout << res[i] << endl;
}
