Language: C++

#include<bits/stdc++.h>
#define db double
#define ui unsigned int
#define ll long long
#define ull unsiged ll
#define rep(i,l,r) for(int i=l;i<=r;i++)
#define per(i,r,l)for(int i=r;i>=l;i--)
#define pb push_back
#define pp pop_back
#define pii pair<int,int>
#define pll pair<ll,ll>
#define mod 1e9+7
#define vii vector<int>
#define vll vector<ll>
#define vpp vector<pii>
#define inf  INT_MAX
#define lnf LLONG_MAX
#define mii map<int,int>
#define mll map<ll,ll>
#define mil map<int,ll>
#define umii unordered_map<int,int>
#define umll unordered_map<ll,ll>
#define si(n) scanf("%d",&n)
#define sl(n) scanf("%lld",&n)
using namespace std;
const int maxn = 2e5 + 7;
const db pi=3.1415926535898;
ll a[maxn],b[maxn];
ll modulo(ll num, ll MOD = mod) { return ((num%MOD) + MOD) % MOD; }
ll power(ll b, ll e, ll MOD = mod) { ll ans = 1; while (e) { if (e&1) ans = (ans*b) % MOD; b = (b*b) % MOD; e /= 2; } return ans; }
ll inv(ll num, ll MOD = mod) { return power(modulo(num), MOD - 2, MOD); }
ll gcd(ll a, ll b) { return ((b == 0) ? a : gcd(b, a%b)); }
struct node
{
  ll x,y,val;
}c[maxn];
bool cmp(node a,node b)
{
  return a.val>b.val;
}
int main()
{
	ios::sync_with_stdio(0);cin.tie(0);
	int t,n,m;
	cin>>n>>m;
	rep(i,1,n)cin>>a[i];
	rep(i,1,n)cin>>b[i];
	sort(a+1,a+n+1);
	sort(b+1,b+n+1);
	per(i,n,1)
	{
	  c[i].x=a[i];
	  c[i].y=b[n-i+1];
	  c[i].val=a[i]*b[n-i+1];
	}
	sort(c+1,c+n+1,cmp);
	ll ans=c[1].val;
	ll l=0;
	ll mins=1e18;
	while(l<=ans)
  {
    //cout<<"ss"<<l<<endl;
    ll u=0;
    ll mi=(l+ans)/2;
    ll ant=0;
    //cout<<"mi="<<mi<<endl;
    rep(i,1,n)
    {
      if(c[i].val<=mi)
      ant=max(ant,c[i].val);
      else {
          ll v=c[i].x-mi/c[i].y;
      //    cout<<c[i].x<<" "<<c[i].y<<" "<<c[i].val<<" "<<c[i].val-v*c[i].y<<endl;
        u+=v;
        ant=max(ant,c[i].val-v*c[i].y);
      }

    }
    if(u<=m)
    {
      mins=min(mins,ant);
      mins=max(0,mins);
      ans=mi-1;
    }
    else {
      l=mi+1;
    }
  }
  cout<<mins<<endl;
	//cout<<b[i]<<" ";

}


Compiler output:
a.cc: In function 'int main()':
a.cc:82:15: error: no matching function for call to 'max(int, long long int&)'
   82 |       mins=max(0,mins);
      |            ~~~^~~~~~~~
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:82:15: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
   82 |       mins=max(0,mins);
      |            ~~~^~~~~~~~
/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:82:15: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   82 |       mins=max(0,mins);
      |            ~~~^~~~~~~~