Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < n; ++i)
#define ALL(v) v.begin(), v.end()
typedef long long ll;
typedef pair<int, int> P;
const int INF = 1000000001;

ll n,a,b,c;
bool bin(vector<ll> h,ll t)
{
   ll at= 0;
   rep(i,n)
   {
      h[i] -= t*b;
      at += (max(0,h[i])+c-1)/c;
   }
   if(at>t)
   {
      return false;
   }
   return true;
}

int main()
{
   
   cin >> n >> a >> b;
   c = a - b;
   vector<llogbf128> h(n);
   rep(i,n)cin >> h[i];
   int left = -1,right = INF;
   while(1)
   {
      ll mid = (left+right)/2;
      if(bin(h,mid))
      {
         right = mid;
      }
      else
      {
         left = mid;
      }
      //cout<<left<<';'<<right<<endl;
      if(right-left<=1)break;
   }
   cout<<right<<endl;
   return 0;
}

Compiler output:
a.cc: In function 'bool bin(std::vector<long long int>, ll)':
a.cc:16:17: error: no matching function for call to 'max(int, __gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type&)'
   16 |       at += (max(0,h[i])+c-1)/c;
      |              ~~~^~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:16:17: note:   deduced conflicting types for parameter 'const _Tp' ('int' and '__gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type' {aka 'long long int'})
   16 |       at += (max(0,h[i])+c-1)/c;
      |              ~~~^~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:16:17: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   16 |       at += (max(0,h[i])+c-1)/c;
      |              ~~~^~~~~~~~
a.cc: In function 'int main()':
a.cc:30:20: error: type/value mismatch at argument 1 in template parameter list for 'template<class _Tp, class _Alloc> class std::vector'
   30 |    vector<llogbf128> h(n);
      |                    ^
a.cc:30:20: note:   expected a type, got 'llogbf128'
a.cc:30:20: error: template argument 2 is invalid
a.cc:31:20: error: invalid types 'int[int]' for array subscript
   31 |    rep(i,n)cin >> h[i];
      |                    ^
a.cc:36:14: error: could not convert 'h' from 'int' to 'std::vector<long long int>'
   36 |       if(bin(h,mid))
      |              ^
      |              |
      |              int