Language: C++

#include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;
long long le,ans,ri,n,k;
int a[200010],f[200010],tt;
inline int read(){
	char ch=getchar();int o=0;
	while(!isdigit(ch)) ch=getchar();
	while(isdigit(ch)) o=(o<<3)+(o<<1)+(ch^48),ch=getchar();
	return o;
} 
inline bool check(long long x){
	int sum=0;
	for(register int i=1;i<=n;i++){
		int tt=0;
		while((a[i]-tt)*f[i]>x){
			tt++;
		}
		sum+=tt;
	}
	if(sum>k) return 0;
	return 1;
}
inline bool cmp(int a,int b){
	return a<b;
}
inline bool cmp1(int a,int b){
	return a>b;
}
int main(){
	n=read(),k=read();
	for(register int i=1;i<=n;i++) a[i]=read(),ri=max(ri,a[i]);
	for(register int i=1;i<=n;i++) f[i]=read(),tt=max(tt,f[i]);
	sort(f+1,f+n+1,cmp);sort(a+1,a+n+1,cmp1);
	ri=ri*tt;
	while(le<=ri){
		long long mid=(le+ri)>>1;
		if(check(mid)) ans=mid,ri=mid-1;
		else le=mid+1; 
	} 
	cout<<ans<<endl;	
}

Compiler output:
a.cc: In function 'bool check(long long int)':
a.cc:15:26: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   15 |         for(register int i=1;i<=n;i++){
      |                          ^
a.cc: In function 'int main()':
a.cc:33:26: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   33 |         for(register int i=1;i<=n;i++) a[i]=read(),ri=max(ri,a[i]);
      |                          ^
a.cc:33:58: error: no matching function for call to 'max(long long int&, int&)'
   33 |         for(register int i=1;i<=n;i++) a[i]=read(),ri=max(ri,a[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:33:58: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   33 |         for(register int i=1;i<=n;i++) a[i]=read(),ri=max(ri,a[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:3:
/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:33:58: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   33 |         for(register int i=1;i<=n;i++) a[i]=read(),ri=max(ri,a[i]);
      |                                                       ~~~^~~~~~~~~
a.cc:34:26: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   34 |         for(register int i=1;i<=n;i++) f[i]=read(),tt=max(tt,f[i]);
      |                          ^