#include <bits/stdc++.h>   using namespace std;   string vow =  aeiou ;   long long month[] = {-1, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};   const long long dxhorse[] = {-2, -2, -1, -1, 1, 1, 2, 2};   const long long dyhorse[] = {1, -1, 2, -2, 2, -2, 1, -1};   const long long dx4[] = {-1, 0, 1, 0};   const long long dy4[] = {0, 1, 0, -1};   const long long dx8[] = {-1, -1, -1, 0, 0, 1, 1, 1};   const long long dy8[] = {-1, 0, 1, -1, 1, -1, 0, 1};   const long double pie = 3.1415926535897932384626;   const long long special_prime = 982451653l;   const long long mod = 1e9 + 7;   const long long inf = 2e18;   template <class T>   istream &operator>>(istream &in, vector<T> &a) {     for (auto &i : a) cin >> i;     return in;   }   template <class T>   ostream &operator<<(ostream &out, const vector<T> &a) {     for (auto &i : a) cout << i <<    ;     return out;   }   template <class T, class U>   ostream &operator<<(ostream &out, const map<T, U> &a) {     for (auto &i : a) cout <<  (  << i.first <<  ,   << i.second <<  ) n ;     return out;   }   template <class T, class U>   ostream &operator<<(ostream &out, const unordered_map<T, U> &a) {     for (auto &i : a) cout <<  (  << i.first <<  ,   << i.second <<  ) n ;     return out;   }   long long GCD(long long a, long long b) {     if (!b) return a;     return GCD(b, a % b);   }   long long LCM(long long a, long long b) { return (a * b) / GCD(a, b); }   bool comp(long long a, long long b) { return a > b; }   void sieve(vector<long long> &prime) {     prime[0] = false;     prime[1] = false;     for (long long p = 2; p * p <= 99999; p++) {       if (prime[p] == true) {         for (long long i = p * p; i <= 99999; i += p) prime[i] = false;       }     }   }   void solve() {     long long n, g, b;     cin >> n >> g >> b;     long long d = n / 2 + n % 2;     if (d % g)       cout << max(n, (d / g) * (g + b) + d % g) <<   n ;     else       cout << max((d / g) * (g + b) - b, n) <<   n ;   }   int32_t main() {     ios_base::sync_with_stdio(false);     cin.tie(0);     cout.tie(0);     long long t = 1;     cin >> t;     cout << setprecision(15) << fixed;     for (long long i = 1; i <= t; i++) solve();   }   