Language: C++

#include<iostream>
#include<cstdio>
#include<string>
#include<algorithm>
#include<utility>
#include<numeric>
#include<vector>
#include<map>
#include<unordered_map>
#include<set>
#include<tuple>
#include<stack>
#include<queue>
#include<functional>
#include<iterator>
#include<cmath>
#include<cctype>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> P;

const int INF = 1e9;
const ll LINF = 1e18;
const int MOD = INF+7;

struct edge{int to,cost;};

void dump(ll *b,int n){
	for(int i=0;i<n;i++){
		cout << b[i] << " ";
	}
	cout << "\n";
}

bool judge(){

}

int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);

	int n;
	ll a,b;
	cin >> n >> a >> b;
	a-=b;

	int h[n];
	ll M=0;
	for(int i=0;i<n;i++){
		cin >> h[i];
		M=max(M,h[i]);
	}

	ll l=0,r=M,mid;
	int H;
	ll numc;
	bool ok;
	ll ans=(ll)1e15;;
	for(int i=0;i<100;i++){
		ok=true;
		mid = (l+r)/2;
		numc=mid;
		for(int j=0;j<n;j++){
			H=h[j];
			H-=b*mid;
			if(H>0){
				numc -= H/a;
				if(H%a!=0) numc--;
			}
			if(numc<0){
				ok=false;
				break;
			}
		}
		if(ok){
			ans=min(ans,mid);
			r=mid;
		}else l=mid;
	}
	cout  << ans << "\n";
	return 0;
}

Compiler output:
a.cc: In function 'bool judge()':
a.cc:40:1: warning: no return statement in function returning non-void [-Wreturn-type]
   40 | }
      | ^
a.cc: In function 'int main()':
a.cc:55:22: error: no matching function for call to 'max(ll&, int&)'
   55 |                 M=max(M,h[i]);
      |                   ~~~^~~~~~~~
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 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:55:22: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   55 |                 M=max(M,h[i]);
      |                   ~~~^~~~~~~~
/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,
                 from a.cc:4:
/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:55:22: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   55 |                 M=max(M,h[i]);
      |                   ~~~^~~~~~~~