func_code_string: #include <bits/stdc++.h>   using namespace std;   int middle(int a, int b, int c) {     if ((a <= b && b <= c) || (c <= b && b <= a))       return b;     else if ((b <= a && a <= c) || (c <= a && a <= b))       return a;     else       return c;   }   template <typename KeyType, typename ValueType>   std::pair<KeyType, ValueType> get_max(const std::map<KeyType, ValueType> &x) {     using pairtype = std::pair<KeyType, ValueType>;     return *std::max_element(x.begin(), x.end(),                              [](const pairtype &p1, const pairtype &p2) {                                return p1.second < p2.second;                              });   }   static inline bool isvowel(char ch) {     static const std::string vowels( aeiouEAIOU );     return vowels.end() != std::find(vowels.begin(), vowels.end(), ch);   }   template <typename Map>   bool map_compare(Map const &lhs, Map const &rhs) {     return lhs.size() == rhs.size() &&            std::equal(lhs.begin(), lhs.end(), rhs.begin());   }   int main() {     ios::sync_with_stdio(0);     cin.tie(0);     cout.tie(0);     long long t;     cin >> t;     while (t--) {       long long n, g, b;       cin >> n >> g >> b;       long long mid = (n + 1) / 2;       long long ans = ((mid - 1) / g) * (g + b);       if (mid % g == 0)         ans += g;       else         ans += (mid % g);       cout << max(ans, n) << endl;     }     return 0;   }   