#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long int n, g, b;
  cin >> n >> g >> b;
  long long int z = (n + 1) / 2;
  long long int x = z / g;
  long long int y = z % g;
  long long int ans;
  if (y == 0) {
    ans = x * (g + b) - b;
  } else {
    ans = x * (g + b) + y;
  }
  if (ans >= n) {
    cout << ans << "\n";
  } else {
    cout << n << "\n";
  }
}
int main() {
  int t;
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
