Language: C++

#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <iomanip>
using namespace std;
using i64 = int64_t;
#define rep(i, j, n) for(int i = (j); i < (n); ++i)
#define rrep(i, j, n) for(int i = (n) - 1; (j) <= i; --i)
constexpr i64 MOD = 1000000007;
constexpr i64 INF = 1LL << 60;


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

	i64 n, a, b; cin >> n >> a >> b;
	i64* h = new i64[n];
	rep(i, 0, n) cin >> h[i];

	auto f = [&](i64 x) {
		i64 res = 0;
		rep(i, 0, n) res += max(0LL, ((h[i] - b * x) + a - b - 1) / (a - b));
		return x >= res;
	};

	i64 ng = 0, ok = 1 << 30;
	while (ok - ng > 1) {
		i64 mid = (ok + ng) >> 1;
		if (f(mid)) ok = mid;
		else ng = mid;
	}
	cout << ok;
	delete[] h;
	return 0;
}

Compiler output:
a.cc: In lambda function:
a.cc:25:40: error: no matching function for call to 'max(long long int, i64)'
   25 |                 rep(i, 0, n) res += max(0LL, ((h[i] - b * x) + a - b - 1) / (a - b));
      |                                     ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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:25:40: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'i64' {aka 'long int'})
   25 |                 rep(i, 0, n) res += max(0LL, ((h[i] - b * x) + a - b - 1) / (a - b));
      |                                     ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/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:2:
/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:25:40: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   25 |                 rep(i, 0, n) res += max(0LL, ((h[i] - b * x) + a - b - 1) / (a - b));
      |                                     ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~