#include <bits/stdc++.h>
#pragma GCC optimize("Ofast", "unroll-loops")
using namespace std;
const int N = (int)1e4 + 100;
long long n, m, w = 0;
long long parent[N], color[N], vis[N], temp[105], q[N], d[N];
vector<char> cl;
vector<int> p;
vector<int> comp;
vector<int> top;
bool visited[N];
bool check_polindrom(string word) {
  int len = word.length();
  for (int i = 0; i < len / 2; ++i) {
    if (word[i] != word[len - i - 1]) {
      return false;
    }
  }
  return true;
}
void qsortab(long long a[], long long b[], int l, int r) {
  if (r - l <= 1) return;
  int mid = a[l + rand() % (r - l)];
  int x = l, y = l;
  for (int i = l; i < r; ++i) {
    if (a[i] < mid) {
      swap(a[x], a[i]);
      swap(b[x], b[i]);
      if (x != y) {
        swap(a[y], a[i]);
        swap(b[y], b[i]);
      }
      ++x;
      ++y;
    } else if (a[i] == mid) {
      swap(a[y], a[i]);
      swap(b[y], b[i]);
      ++y;
    }
  }
  qsortab(a, b, l, x);
  qsortab(a, b, y, r);
}
void solve() {
  long long g, b;
  long long x = 0;
  cin >> n >> g >> b;
  x = ((n + 1) / (2 * g)) * (g + b);
  if (((n + 1) / 2) % g != 0) {
    x += ((n + 1) / 2) % g;
  } else {
    x -= b;
  }
  cout << max(n, x) << endl;
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  cout << fixed << setprecision(20);
  int f = 1;
  cin >> f;
  while (f--) {
    solve();
  }
  return 0;
}
