#include <bits/stdc++.h>
using namespace std;
bool cmp(long long a, long long b) { return a > b; }
int main() {
  long long t;
  cin >> t;
  while (t--) {
    long long n, g, b;
    cin >> n >> g >> b;
    long long bad = n / 2;
    long long good = n - bad;
    long long cnt = 0;
    int j, i = 0;
    long long gdays = 0;
    i = good % g;
    j = good / g;
    gdays = good;
    long long x = 0;
    if (j > 0) {
      if (i == 0)
        x = (j - 1) * b;
      else {
        x = j * b;
      }
    }
    gdays += x;
    if (j > 0 && bad <= x)
      cnt = gdays;
    else {
      cnt = gdays + (bad - x);
    }
    cout << cnt << endl;
  }
  return 0;
}
