criyle/codenet-compile-errors huggingface dataset:
Language: C++

#include <iostream>

using namespace std;

int main()
{
	float a;
	float b;
	float x;
	cin >> a >> b >> x;
	float theta=atan2(3 * a*a*b - x, a*a*a);
	cout << 2 * 3.1415926535*theta << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:21: error: 'atan2' was not declared in this scope
   11 |         float theta=atan2(3 * a*a*b - x, a*a*a);
      |                     ^~~~~
Language: C++

#include <iostream>
#include <cstdio>
#include <algorithm>
using namespace std;
const double pi = 3.1415926535;
int a;
int main()
{

    double a,b;
    double x;
    cin >> a >> b >> x ;
    if(a*a*b/2<=x){
        x=a*a*b-x;
        x/=a;
        x/=a;
        x*=2;
        //cout << a*a*b/x << endl;
        double R=sqrt(x*x+a*a);
        printf("%.10f\n",acos(a/R)*180/pi);
    }
    else{
        x/=a;
        x/=b;
        x*=2;
        double R=sqrt(x*x+b*b);
        printf("%.10f",asin(b/R)/pi*180);
    }

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:18: error: 'sqrt' was not declared in this scope
   19 |         double R=sqrt(x*x+a*a);
      |                  ^~~~
a.cc:20:26: error: 'acos' was not declared in this scope
   20 |         printf("%.10f\n",acos(a/R)*180/pi);
      |                          ^~~~
a.cc:26:18: error: 'sqrt' was not declared in this scope
   26 |         double R=sqrt(x*x+b*b);
      |                  ^~~~
a.cc:27:24: error: 'asin' was not declared in this scope
   27 |         printf("%.10f",asin(b/R)/pi*180);
      |                        ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main(){
  double a, b, x, y;
  
  cin >> a >> b >> x;
  
  y = 2*(pow(a,2)**b - x);
  y /= pow(a,3);
  y *= 180/M_PI;
  
  cout << y << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:19: error: invalid type argument of unary '*' (have 'double')
    9 |   y = 2*(pow(a,2)**b - x);
      |                   ^~
Language: C++

#include <vector>
#include <iostream>
#include <stack>
#include <string>
#include <algorithm>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <map>
#include <set>
#include <iomanip>
#include <limits>

using namespace std;
typedef long long ll;
typedef vector<int> VI;
typedef pair<ll, ll> P;

#define rep(a,n) for(int a = 0;a < n;a++)

const double PI = 3.14159265358979323846;

int main(void)
{
	double a, b, x;
	cin >> a >> b >> x;
	auto t = a* a* b / 2;
	cout << std::setprecision(15);
	if (t >= x) {
		auto c = x / (a * b) * 2;
		auto d = atan2(c, b) / PI * 180;
		cout << (90 - d) << endl;
		return 0;
	}
	else {
		auto r = x - t;
		auto c = r / (a * a) * 2;
		auto d = atan2(b - c, a) / PI * 180;
		cout << d << endl;
		return 0;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:26: error: 'atan2' was not declared in this scope
   31 |                 auto d = atan2(c, b) / PI * 180;
      |                          ^~~~~
a.cc:38:26: error: 'atan2' was not declared in this scope
   38 |                 auto d = atan2(b - c, a) / PI * 180;
      |                          ^~~~~
Language: C++

#include <bits/stdc++.h>
#define fi first
#define se second
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define srep(i,s,t) for (int i = s; i < t; ++i)
#define rng(a) a.begin(),a.end()
#define rrng(a) a.rbegin(),a.rend()
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define limit(x,l,r) max(l,min(x,r))
#define lims(x,l,r) (x = max(l,min(x,r)))
#define isin(x,l,r) ((l) <= (x) && (x) < (r))
#define pb push_back
#define eb emplace_back
#define all(c) begin(c),end(c)
#define sz(x) (int)(x).size()
#define pcnt __builtin_popcountll
#define uni(x) x.erase(unique(rng(x)),x.end())
#define snuke srand((unsigned)clock()+(unsigned)time(NULL));
#define show(x) cout<<#x<<" = "<<x<<endl;
#define PQ(T) priority_queue<T,v(T),greater<T> >
#define bn(x) ((1<<x)-1)
#define dup(x,y) (((x)+(y)-1)/(y))
#define newline puts("")
#define v(T) vector<T>
#define vv(T) v(v(T))
using namespace std;
typedef long long int ll;
typedef unsigned uint;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef tuple<int,int,int> T;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
typedef vector<T> vt;
//最大公約数
ll gcd(ll x, ll y) {
  return y ? gcd(y, x % y) : x;
}
//最小公倍数
ll lcm(ll x, ll y) {
  return x/gcd(x, y)*y;
}
//素因数分解
vector<pair<ll,int>> factorize(ll n) {
  vector<pair<ll,int>> res;
  for (ll i = 2; i*i <= n; ++i) {
    if (n%i) continue;
    res.emplace_back(i,0);
    while (n%i == 0) {
      n /= i;
      res.back().second++;
    }
  }
  if (n != 1) res.emplace_back(n,1);
  return res;
}
 
 
 
 
int main() {
  int a,b,x;
  cin>>a>>b>>x;
  int kyokai=a*a*b/2;

  int menseki=x/a;

  if(x>kyokai){//台形

  }else{//三角形
      int cos=
  }


}



Compiler output:
a.cc: In function 'int main()':
a.cc:77:3: error: expected primary-expression before '}' token
   77 |   }
      |   ^
Language: C++

#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
using namespace std;

#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)

double a, b, x;
bool KK[101];

int main() {

	cin >> a >> b >> x;

	double ans = 0;
	if (a * b / 2 * a <= x)//あまり傾けられない
	{
		ans = (a*a*b - x) / (a*a*a/2);
		ans = atan(ans);	
	}
	else
	{
		ans = atan(a*b*b/2 / x);
	}

	double M_PI = 3.141592653589793;

	ans = ans / M_PI * 180.00000;

	cout << ans << endl;
	
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:23: error: 'atan' was not declared in this scope
   20 |                 ans = atan(ans);
      |                       ^~~~
a.cc:24:23: error: 'atan' was not declared in this scope
   24 |                 ans = atan(a*b*b/2 / x);
      |                       ^~~~
Language: C++

#include <queue>
#include <iostream>
#include <cmath>
#include <cstdlib>
#include <algorithm>
#include <stack>
#include <string>
#include <vector>
#include <map>
#include <functional>
#include <set>

#define rep(i, n) for(int i = 0; i < (n); i++)
#define MAX(a, b) (((a) < (b)) ? (b) : (a))
#define MIN(a, b) (((a) < (b)) ? (a) : (b))

using namespace std;
typedef long long int ll;
typedef pair<ll, ll> pll;
typedef pair<int, int> pint;
const ll inf = (1LL << 60);
//const ll mod = 1000000007;
ll max(ll a, ll b) {
	if (a < b)
		return b;
	else
		return a;

}

ll min(ll a, ll b) {

	if (a < b)
		return a;
	else
		return b;

}


int main() {
	double a, b, x;
	double M_PI = 3.141592653589793;
	cin >> a >> b >> x;

	if (x <= a * a * b / 2) {

		double t = 2 * x / (b * a);

		printf("%.10f", 180.0 / M_PI * atan(b / t));
		
	}

	else {
		double h = 2 * (a * a * b - x) / (a * a);

		printf("%.10f", 180.0 / M_PI * atan(h / a));


	}

	
	return 0;
}

Compiler output:
In file included from /usr/include/c++/14/cmath:47,
                 from a.cc:3:
a.cc: In function 'int main()':
a.cc:43:16: error: expected unqualified-id before numeric constant
   43 |         double M_PI = 3.141592653589793;
      |                ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main(){
  double a, b, x;
  const double PI = numbers::pi; 
  cin >> a >> b >> x;
  double tmp = b * a - x / a;
  double len = tmp * 2 / a;
  double rad = atan(a / len);
  double deg = 180.0 * rad / PI;
  cout << deg << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:21: error: 'numbers' has not been declared
    6 |   const double PI = numbers::pi;
      |                     ^~~~~~~
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <stack>
#include <queue>
#include <list>
#include <string>
#include <numeric>
#include <math.h>
#include <set>
#include <map>
#include <fstream>
#include <sstream>
#include <iterator>
#include <complex>
using namespace std;

long long gcd(long long a,long long b){return b?gcd(b,a%b):a;}
long long lcd(long long a,long long b){return a*b / gcd(a,b) / gcd(a,b);}

int main()
{
	long double a,b,x;
	cin>>a>>b>>x;

	long double y = 2*x / (a*b);
	long double r = sqrt(y*y + b*b);
	long double theta = asin(y / r);
	long double result = 90 - theta / M_PI * 180;
	cout<<fixed << setprecision(10)<<result<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:24: error: 'setprecision' was not declared in this scope
   30 |         cout<<fixed << setprecision(10)<<result<<endl;
      |                        ^~~~~~~~~~~~
a.cc:16:1: note: 'std::setprecision' is defined in header '<iomanip>'; this is probably fixable by adding '#include <iomanip>'
   15 | #include <complex>
  +++ |+#include <iomanip>
   16 | using namespace std;
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main(){
  double a, b, x;
  cin >> a >> b >> x;
  double tmp = b * a - x / a;
  double len = tmp * 2 / a;
  double rad = Math.atan(a / len);
  double deg = 180.0 * rad / Math.PI;
  cout << deg << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:16: error: 'Math' was not declared in this scope
    9 |   double rad = Math.atan(a / len);
      |                ^~~~
Language: C++

import math

a,h,x=map(int,input().split())

hanbun=x>(a*a*h/2)

if(hanbun):
    takasa=(x/a/a)*2-h
    katamuki=(h-takasa)/a
    print(math.degrees(math.atan(katamuki)))
else:
    haba=2*x/a/h
    print(math.degrees(math.atan(h/haba)))

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import math
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
Language: C++

#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)n;i++)
#define Rep(i,s,f) for(int i=(int)s;i<(int)f;i++)
using ll=long long;
using namespace std;


bool f(ll x,ll K,ll N,vector<ll> A,vector<ll> F)
{
	ll res=0;
	rep(i,N)
	{
		res+=max(A[i]-x/F[i],0);
	}
	return res<=K;
}
int main()
{
	ll N,K;
	cin>>N>>K;
	vector<ll> A(N);
	rep(i,N) cin>>A[i];
	vector<ll> F(N);
	rep(i,N) cin>>F[i];
	sort(A.begin(),A.end());
	sort(F.begin(),F.end(),greater<ll>());
	ll head=-1;
	ll tail=A[N-1]*F[0];
	while(tail-head>1)
	{
		ll mid=head+(tail-head)/2;
		if(f(mid,K,N,A,F))
		{
			tail=mid;
		}
		else
		{
			head=mid;
		}
	}
	cout<<tail<<endl;
	return 0;
}


Compiler output:
a.cc: In function 'bool f(ll, ll, ll, std::vector<long long int>, std::vector<long long int>)':
a.cc:13:25: error: no matching function for call to 'max(__gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type, int)'
   13 |                 res+=max(A[i]-x/F[i],0);
      |                      ~~~^~~~~~~~~~~~~~~
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:13:25: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   13 |                 res+=max(A[i]-x/F[i],0);
      |                      ~~~^~~~~~~~~~~~~~~
/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:13:25: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   13 |                 res+=max(A[i]-x/F[i],0);
      |                      ~~~^~~~~~~~~~~~~~~
Language: C++

#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<vector>
#include<functional>
#include<algorithm>
#include<stdlib.h>
#include<string>
#include<string.h>
#define _USE_MATH_DEFINES
#include<math.h>
#include<deque>
#include<set>
#include<map>
#include<queue>
#include<list>
#include<iostream>
#include <bitset>
using namespace std;
typedef long long ll;
#define rep(i,a,b) for(auto i=a;i<b;i++)
#define all(_x) _x.begin(), _x.end()
#define r_sort(_x) sort(_x.begin(), _x.end(), std::greater<int>())
#define vec_cnt(_a, _n) (upper_bound(all(_a), _n) - lower_bound(all(_a), _n))
#define vec_unique(_a) _a.erase(std::unique(all(_a)), _a.end());
#define vvec vector<vector<ll>>
ll gcd(ll a, ll b) { return a % b == 0 ? b : gcd(b, a % b); }
ll lcm(ll a, ll b) { return (a / gcd(a, b)) * b; }
#define INF 1 << 30
const int mod = 1000000007;
ll power(ll x, ll p) { ll a = 1; while (p > 0) { if (p % 2 == 0) { x *= x; p /= 2; } else { a *= x; p--; } }return a; }
ll mpower(ll x, ll p) { ll a = 1; while (p > 0) { if (p % 2 == 0) { x = x * x % mod; p /= 2; } else { a = a * x % mod; p--; } }return a; }
ll ac(ll n, ll k) { ll a = 1; rep(i, 1, k) { a *= n - i + 1; a /= i; }return a; }
ll mc(ll n, ll m) { ll k = 1, l = 1; rep(i, n - m + 1, n + 1) k = k * i % mod; rep(i, 1, m + 1) l = l * i % mod; l = mpower(l, mod - 2); return k * l % mod; }

int main()
{
	int n, k;
	cin >> n >> k;
	vector<ll> a(n), f(n);
	rep(i, 0, n)cin >> a[i];
	rep(i, 0, n)cin >> f[i];
	sort(all(f));
	r_sort(a, greater<ll>());
	ll left = -1ll, right = (ll)1e13, mid, N;
	while (right - left > 1) {
		N = 0, mid = (right + left) / 2ll;
		rep(i, 0, n) {
			if(a[i] * f[i] > mid)N += (a[i] * f[i] - mid + f[i] - 1) / f[i];
		}
		//printf("%lld %lld %lld\n", Min, mid, Max);
		(N <= k ? right : left) = mid;
	}
	printf("%lld\n", right);
	return 0;
}

Compiler output:
a.cc:43:32: error: macro "r_sort" passed 2 arguments, but takes just 1
   43 |         r_sort(a, greater<ll>());
      |                                ^
a.cc:22:9: note: macro "r_sort" defined here
   22 | #define r_sort(_x) sort(_x.begin(), _x.end(), std::greater<int>())
      |         ^~~~~~
a.cc: In function 'int main()':
a.cc:43:9: error: 'r_sort' was not declared in this scope
   43 |         r_sort(a, greater<ll>());
      |         ^~~~~~
Language: C++

#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <cstring>
#include <cctype>
#include <complex>
#include <stack>
#include <queue>
#include <unordered_map>
#include <set>
#include <deque>
#include <map>
#include <bitset>
#include <functional>
#include <cmath>

#define INF 1000000000
using namespace std;
typedef long long ll
#define rep(i, n) for(int i = 0; i < (n); ++i)

int main(){
    int n;
    ll k; 
    cin >> n >> k;
    vector<int> a(n);
    vector<int> f(n);
    rep(i, n) cin >> a[i];
    rep(i, n) cin >> f[i];
    sort(a.begin(), a.end());
    sort(f.rbegin(), f.rend());
    ll l = -1, r = 1e12;
    while(l+1 < r){
        ll c = (l+r) / 2;
        ll sum = 0;
        rep(i,n)sum += max(0ll, (a[i] - c/f[i]));
        if(sum <= k)r = c;
        else l = c;
    }
    cout << r << endl;
}

Compiler output:
a.cc:23:1: error: expected initializer before 'int'
   23 | int main(){
      | ^~~
Language: C++

#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <cstring>
#include <cctype>
#include <complex>
#include <stack>
#include <queue>
#include <unordered_map>
#include <set>
#include <deque>
#include <map>
#include <bitset>
#include <functional>
#include <cmath>

#define INF 1000000000
using namespace std;
typedef long long ll

int main(){
    int n;
    ll k; 
    cin >> n >> k;
    vector<int> a(n);
    vector<int> f(n);
    rep(i, n) cin >> a[i];
    rep(i, n) cin >> f[i];
    sort(a.begin(), a.end());
    sort(f.rbegin(), f.rend());
    ll l = -1, r = 1e12;
    while(l+1 < r){
        ll c = (l+r) / 2;
        ll sum = 0;
        rep(i,n)sum += max(0ll, (a[i] - c/f[i]));
        if(sum <= k)r = c;
        else l = c;
    }
    cout << r << endl;
}

Compiler output:
a.cc:22:1: error: expected initializer before 'int'
   22 | int main(){
      | ^~~
Language: C++

#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <cstring>
#include <cctype>
#include <complex>
#include <stack>
#include <queue>
#include <unordered_map>
#include <set>
#include <deque>
#include <map>
#include <bitset>
#include <functional>
#include <cmath>

#define INF 1000000000
using namespace std;

int main(){
    int n;
    ll k; 
    cin >> n >> k;
    vector<int> a(n);
    vector<int> f(n);
    rep(i, n) cin >> a[i];
    rep(i, n) cin >> f[i];
    sort(a.begin(), a.end());
    sort(f.rbegin(), f.rend());
    ll l = -1, r = 1e12;
    while(l+1 < r){
        ll c = (l+r) / 2;
        ll sum = 0;
        rep(i,n)sum += max(0ll, (a[i] - c/f[i]));
        if(sum <= k)r = c;
        else l = c;
    }
    cout << r << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:5: error: 'll' was not declared in this scope
   23 |     ll k;
      |     ^~
a.cc:24:17: error: 'k' was not declared in this scope
   24 |     cin >> n >> k;
      |                 ^
a.cc:27:9: error: 'i' was not declared in this scope
   27 |     rep(i, n) cin >> a[i];
      |         ^
a.cc:27:5: error: 'rep' was not declared in this scope; did you mean 'frexp'?
   27 |     rep(i, n) cin >> a[i];
      |     ^~~
      |     frexp
a.cc:31:7: error: expected ';' before 'l'
   31 |     ll l = -1, r = 1e12;
      |       ^~
      |       ;
a.cc:32:11: error: 'l' was not declared in this scope
   32 |     while(l+1 < r){
      |           ^
a.cc:32:17: error: 'r' was not declared in this scope
   32 |     while(l+1 < r){
      |                 ^
a.cc:33:11: error: expected ';' before 'c'
   33 |         ll c = (l+r) / 2;
      |           ^~
      |           ;
a.cc:34:11: error: expected ';' before 'sum'
   34 |         ll sum = 0;
      |           ^~~~
      |           ;
a.cc:36:12: error: 'sum' was not declared in this scope
   36 |         if(sum <= k)r = c;
      |            ^~~
a.cc:36:25: error: 'c' was not declared in this scope
   36 |         if(sum <= k)r = c;
      |                         ^
a.cc:37:18: error: 'c' was not declared in this scope
   37 |         else l = c;
      |                  ^
a.cc:39:13: error: 'r' was not declared in this scope
   39 |     cout << r << endl;
      |             ^
Language: C++

#include<bits/stdc++.h>
#pragma GCC optimize("Ofast")
// ----- boost -----
#include <boost/rational.hpp>
#include <boost/multiprecision/cpp_int.hpp>
// ----- using directives and manipulations -----
using boost::rational;
using boost::multiprecision::cpp_int;
using namespace std;
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
typedef long long ll;
#define rep(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define REP(i,num,n) for(int i=num, i##_len=(n); i<i##_len; ++i)
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
#define print(x) (cout << (x) << endl)
#define pb push_back
#define mp make_pair
#define sz(x) int(x.size())
template<class T> inline void Yes(T condition){ if(condition) cout << "Yes" << endl; else cout << "No" << endl; }
#define fs first
#define sc second

const int INF = 1e9;
const ll LLINF = 1e16;
const ll MOD = 1e9+7;
template<class T> inline void add(T &a, T b){a = ((a+b) % MOD + MOD) % MOD;};

template<typename T>
vector<T> make_v(size_t a){return vector<T>(a);}
 
template<typename T,typename... Ts>
auto make_v(size_t a,Ts... ts){
  return vector<decltype(make_v<T>(ts...))>(a,make_v<T>(ts...));
}
 

// 指定した文字cが文字列に何文字入ってるか
ll stringcount(string s, char c) {
    return count(s.cbegin(), s.cend(), c);
}


// 割り算の切り上げ処理
template<typename T>
T rp(T a, T b) {
  return (a + b - 1) / b;
}

// 桁和
template<typename T>
T digsum(T n) {
    T res = 0;
    while(n > 0) {
        res += n%10;
        n /= 10;
    }
    return res;
}

// 回文判定
bool kai (string s) {
    string t{s};
    reverse(begin(t), end(t));
    return s == t;
}

using pint = pair<int, int>;
using pll = pair<ll, ll>;
 
int64_t N, K;
vector<ll> A;
vector<ll> F;
 
bool check(int64_t X){
    ll sum = 0;
    for(int i=0; i<N; i++){
        ll ok = X/F[i];
        if(ok < A[i]) need += A[i] - ok;
    }
    return (need <= K);
}
 
int main(){
    cin >> N >> K;
    A.resize(N);
    F.resize(N);
    for(int i=0; i<N; i++) cin >> A[i];
    for(int i=0; i<N; i++) cin >> F[i];
    sort(all(A));
    sort(rall(F));
    int64_t ok = 1e13, ng = -1;
    while(ok-ng>1){
        int64_t mid = (ok+ng)/2;
        (check(mid) ? ok : ng) = mid;
    }
    cout << ok << endl;
    return 0;
}


Compiler output:
a.cc:4:10: fatal error: boost/rational.hpp: No such file or directory
    4 | #include <boost/rational.hpp>
      |          ^~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include<bits/stdc++.h>
#pragma GCC optimize("Ofast")
// ----- boost -----
#include <boost/rational.hpp>
#include <boost/multiprecision/cpp_int.hpp>
// ----- using directives and manipulations -----
using boost::rational;
using boost::multiprecision::cpp_int;
using namespace std;
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
typedef long long ll;
#define rep(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define REP(i,num,n) for(int i=num, i##_len=(n); i<i##_len; ++i)
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
#define print(x) (cout << (x) << endl)
#define pb push_back
#define mp make_pair
#define sz(x) int(x.size())
template<class T> inline void Yes(T condition){ if(condition) cout << "Yes" << endl; else cout << "No" << endl; }
#define fs first
#define sc second

const int INF = 1e9;
const ll LLINF = 1e16;
const ll MOD = 1e9+7;
template<class T> inline void add(T &a, T b){a = ((a+b) % MOD + MOD) % MOD;};

template<typename T>
vector<T> make_v(size_t a){return vector<T>(a);}
 
template<typename T,typename... Ts>
auto make_v(size_t a,Ts... ts){
  return vector<decltype(make_v<T>(ts...))>(a,make_v<T>(ts...));
}
 

// 指定した文字cが文字列に何文字入ってるか
ll stringcount(string s, char c) {
    return count(s.cbegin(), s.cend(), c);
}


// 割り算の切り上げ処理
template<typename T>
T rp(T a, T b) {
  return (a + b - 1) / b;
}

// 桁和
template<typename T>
T digsum(T n) {
    T res = 0;
    while(n > 0) {
        res += n%10;
        n /= 10;
    }
    return res;
}

// 回文判定
bool kai (string s) {
    string t{s};
    reverse(begin(t), end(t));
    return s == t;
}

using pint = pair<int, int>;
using pll = pair<ll, ll>;
 
ll n, k, vector<ll> a, vector<ll> f;
 
bool check(int64_t X){
    int64_t need = 0;
    for(int i=0; i < n; i++){
        int64_t ok = X/f[i];
        if(ok < a[i]) need += a[i] - ok;
    }
    return (need <= k);
}
 
int main(){
    cout.tie(0);
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(20);
    cin >> n >> k;
    rep(i,n) cin >> a[i] >> f[i];
    sort(all(a));
    sort(rall(f));
    int64_t ok = 1e13, ng = -1;
    while(ok-ng>1){
        int64_t mid = (ok+ng)/2;
        (check(mid) ? ok : ng) = mid;
    }
    cout << ok << endl;
}


Compiler output:
a.cc:4:10: fatal error: boost/rational.hpp: No such file or directory
    4 | #include <boost/rational.hpp>
      |          ^~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include<bits/stdc++.h>
#pragma GCC optimize("Ofast")
// ----- boost -----
#include <boost/rational.hpp>
#include <boost/multiprecision/cpp_int.hpp>
// ----- using directives and manipulations -----
using boost::rational;
using boost::multiprecision::cpp_int;
using namespace std;
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
typedef long long ll;
#define rep(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define REP(i,num,n) for(int i=num, i##_len=(n); i<i##_len; ++i)
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
#define print(x) (cout << (x) << endl)
#define pb push_back
#define mp make_pair
#define sz(x) int(x.size())
template<class T> inline void Yes(T condition){ if(condition) cout << "Yes" << endl; else cout << "No" << endl; }
#define fs first
#define sc second

const int INF = 1e9;
const ll LLINF = 1e16;
const ll MOD = 1e9+7;
template<class T> inline void add(T &a, T b){a = ((a+b) % MOD + MOD) % MOD;};

template<typename T>
vector<T> make_v(size_t a){return vector<T>(a);}
 
template<typename T,typename... Ts>
auto make_v(size_t a,Ts... ts){
  return vector<decltype(make_v<T>(ts...))>(a,make_v<T>(ts...));
}
 

// 指定した文字cが文字列に何文字入ってるか
ll stringcount(string s, char c) {
    return count(s.cbegin(), s.cend(), c);
}


// 割り算の切り上げ処理
template<typename T>
T rp(T a, T b) {
  return (a + b - 1) / b;
}

// 桁和
template<typename T>
T digsum(T n) {
    T res = 0;
    while(n > 0) {
        res += n%10;
        n /= 10;
    }
    return res;
}

// 回文判定
bool kai (string s) {
    string t{s};
    reverse(begin(t), end(t));
    return s == t;
}

using pint = pair<int, int>;
using pll = pair<ll, ll>;

vector<ll> A;
vector<ll> F;

ll N,K;
bool solve(ll mid){
    ll sum = 0;
    rep(i, N){
        if(A[i] > mid / F[i]) sum += A[i] - mid / F[i];
    }
    return sum <= K;
}

ll binary_search(){
  ll ok = LLINF;
  ll ng = -1;
  while(abs(ok - ng) > 1){
    ll mid = (ok + ng) / 2;
    if(solve(mid)){
      ok = mid;
    }else{
      ng = mid;
    }
  }
  return ok;
}

int main(void)
{
    cout.tie(0);
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(20);
    cin >> N >> K;
    A.resize(N);
    F.resize(K);
    rep(i, N) cin >> a[i] >> f[i];
    sort(all(A));
    sort(rall(F));
    ll ans = binary_search();
    print(ans);
    

}



Compiler output:
a.cc:4:10: fatal error: boost/rational.hpp: No such file or directory
    4 | #include <boost/rational.hpp>
      |          ^~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include<bits/stdc++.h>
#pragma GCC optimize("Ofast")
// ----- boost -----
#include <boost/rational.hpp>
#include <boost/multiprecision/cpp_int.hpp>
// ----- using directives and manipulations -----
using boost::rational;
using boost::multiprecision::cpp_int;
using namespace std;
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
typedef long long ll;
#define rep(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define REP(i,num,n) for(int i=num, i##_len=(n); i<i##_len; ++i)
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
#define print(x) (cout << (x) << endl)
#define pb push_back
#define mp make_pair
#define sz(x) int(x.size())
template<class T> inline void Yes(T condition){ if(condition) cout << "Yes" << endl; else cout << "No" << endl; }
#define fs first
#define sc second

const int INF = 1e9;
const ll LLINF = 1e16;
const ll MOD = 1e9+7;
template<class T> inline void add(T &a, T b){a = ((a+b) % MOD + MOD) % MOD;};

template<typename T>
vector<T> make_v(size_t a){return vector<T>(a);}
 
template<typename T,typename... Ts>
auto make_v(size_t a,Ts... ts){
  return vector<decltype(make_v<T>(ts...))>(a,make_v<T>(ts...));
}
 

// 指定した文字cが文字列に何文字入ってるか
ll stringcount(string s, char c) {
    return count(s.cbegin(), s.cend(), c);
}


// 割り算の切り上げ処理
template<typename T>
T rp(T a, T b) {
  return (a + b - 1) / b;
}

// 桁和
template<typename T>
T digsum(T n) {
    T res = 0;
    while(n > 0) {
        res += n%10;
        n /= 10;
    }
    return res;
}

// 回文判定
bool kai (string s) {
    string t{s};
    reverse(begin(t), end(t));
    return s == t;
}

using pint = pair<int, int>;
using pll = pair<ll, ll>;

vector<ll> A;
vector<ll> F;

ll N,K;
bool solve(ll mid){
    ll sum = 0;
    rep(i, N){
        if(A[i] > mid / F[i]) sum += A[i] - mid / F[i];
    }
    return sum <= K;
}

ll binary_search(){
  ll ok = LLINF;
  ll ng = -1;
  while(abs(ok - ng) > 1){
    ll mid = (ok + ng) / 2;
    if(solve(mid)){
      ok = mid;
    }else{
      ng = mid;
    }
  }
  return ok;
}

int main(void)
{
    cout.tie(0);
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(20);
    cin >> N >> K;
    a.resize(N);
    f.resize(K);
    rep(i, n) cin >> a[i] >> f[i];
    sort(all(A));
    sort(rall(F));
    ll ans = binary_search();
    print(ans);
    

}



Compiler output:
a.cc:4:10: fatal error: boost/rational.hpp: No such file or directory
    4 | #include <boost/rational.hpp>
      |          ^~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include<bits/stdc++.h>
#pragma GCC optimize("Ofast")

using namespace std;
typedef long long ll;
#define rep(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define REP(i,num,n) for(int i=num, i##_len=(n); i<i##_len; ++i)


ll n, k, a[200000], f[200000];

bool check(ll X){
    ll need = 0;
    for(int i=0; i < n; i++){
        ll ok = X/f[i];
        if(ok < a[i]) need += a[i] - ok;
    }
    return (need <= k);
}


int main(void)
{
    cout.tie(0);
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(20);
    cin >> n >> k;
    for(int i=0; i<n; i++) cin >> a[i];
    for(int i=0; i<k; i++) cin >> f[i];
    sort(a, a+n);
    sort(f, f+n, greater<>());
    int64_t ok = 1e13, ng = -1;
    while(ok-ng>1){
        int64_t mid = (ok+ng)/2;
        (check(mid) ? ok : ng) = mid;
    }
    print(ok);
    

}



Compiler output:
a.cc: In function 'int main()':
a.cc:38:5: error: 'print' was not declared in this scope; did you mean 'rint'?
   38 |     print(ok);
      |     ^~~~~
      |     rint
Language: C++

#include<bits/stdc++.h>
#pragma GCC optimize("Ofast")

using namespace std;
#define rep(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define REP(i,num,n) for(int i=num, i##_len=(n); i<i##_len; ++i)


ll n, k, a[200000], f[200000];

bool check(ll X){
    ll need = 0;
    for(int i=0; i < n; i++){
        ll ok = X/f[i];
        if(ok < a[i]) need += a[i] - ok;
    }
    return (need <= k);
}


int main(void)
{
    cout.tie(0);
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(20);
    cin >> n >> k;
    for(int i=0; i<n; i++) cin >> a[i];
    for(int i=0; i<k; i++) cin >> f[i];
    sort(a, a+n);
    sort(f, f+n, greater<>());
    int64_t ok = 1e13, ng = -1;
    while(ok-ng>1){
        int64_t mid = (ok+ng)/2;
        (check(mid) ? ok : ng) = mid;
    }
    print(ok);
    

}



Compiler output:
a.cc:9:1: error: 'll' does not name a type
    9 | ll n, k, a[200000], f[200000];
      | ^~
a.cc:11:12: error: 'll' was not declared in this scope
   11 | bool check(ll X){
      |            ^~
a.cc: In function 'int main()':
a.cc:27:12: error: 'n' was not declared in this scope; did you mean 'yn'?
   27 |     cin >> n >> k;
      |            ^
      |            yn
a.cc:27:17: error: 'k' was not declared in this scope
   27 |     cin >> n >> k;
      |                 ^
a.cc:28:35: error: 'a' was not declared in this scope
   28 |     for(int i=0; i<n; i++) cin >> a[i];
      |                                   ^
a.cc:29:35: error: 'f' was not declared in this scope
   29 |     for(int i=0; i<k; i++) cin >> f[i];
      |                                   ^
a.cc:30:10: error: 'a' was not declared in this scope
   30 |     sort(a, a+n);
      |          ^
a.cc:31:10: error: 'f' was not declared in this scope
   31 |     sort(f, f+n, greater<>());
      |          ^
a.cc:35:15: error: 'check' cannot be used as a function
   35 |         (check(mid) ? ok : ng) = mid;
      |          ~~~~~^~~~~
a.cc:37:5: error: 'print' was not declared in this scope; did you mean 'rint'?
   37 |     print(ok);
      |     ^~~~~
      |     rint
Language: C++

#include<bits/stdc++.h>
#pragma GCC optimize("Ofast")

using namespace std;
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
typedef long long ll;
#define rep(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define REP(i,num,n) for(int i=num, i##_len=(n); i<i##_len; ++i)
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
#define print(x) (cout << (x) << endl)
#define pb push_back
#define mp make_pair
#define sz(x) int(x.size())
template<class T> inline void Yes(T condition){ if(condition) cout << "Yes" << endl; else cout << "No" << endl; }
#define fs first
#define sc second

const int INF = 1e9;
const ll LLINF = 1e16;
const ll MOD = 1e9+7;
template<class T> inline void add(T &a, T b){a = ((a+b) % MOD + MOD) % MOD;};

template<typename T>
vector<T> make_v(size_t a){return vector<T>(a);}
 
template<typename T,typename... Ts>
auto make_v(size_t a,Ts... ts){
  return vector<decltype(make_v<T>(ts...))>(a,make_v<T>(ts...));
}
 

// 指定した文字cが文字列に何文字入ってるか
ll stringcount(string s, char c) {
    return count(s.cbegin(), s.cend(), c);
}


// 割り算の切り上げ処理
template<typename T>
T rp(T a, T b) {
  return (a + b - 1) / b;
}

// 桁和
template<typename T>
T digsum(T n) {
    T res = 0;
    while(n > 0) {
        res += n%10;
        n /= 10;
    }
    return res;
}

// 回文判定
bool kai (string s) {
    string t{s};
    reverse(begin(t), end(t));
    return s == t;
}

using pint = pair<int, int>;
using pll = pair<ll, ll>;

ll n, k, a[200000], f[200000];

bool check(ll X){
    ll need = 0;
    for(int i=0; i < n; i++){
        ll ok = X/f[i];
        if(ok < a[i]) need += a[i] - ok;
    }
    return (need <= k);
}


int main(void)
{
    cout.tie(0);
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(20);
    cin >> n >> k;
    for(int i=0; i<n; i++) cin >> A[i];
    for(int i=0; i<k; i++) cin >> F[i];
    sort(a, a+n);
    sort(f, f+n, greater<>());
    int64_t ok = 1e13, ng = -1;
    while(ok-ng>1){
        int64_t mid = (ok+ng)/2;
        (check(mid) ? ok : ng) = mid;
    }
    print(ok);
    

}



Compiler output:
a.cc: In function 'int main()':
a.cc:86:35: error: 'A' was not declared in this scope
   86 |     for(int i=0; i<n; i++) cin >> A[i];
      |                                   ^
a.cc:87:35: error: 'F' was not declared in this scope
   87 |     for(int i=0; i<k; i++) cin >> F[i];
      |                                   ^
Language: C++

#include<bits/stdc++.h>
#pragma GCC optimize("Ofast")

using namespace std;
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
typedef long long ll;
#define rep(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define REP(i,num,n) for(int i=num, i##_len=(n); i<i##_len; ++i)
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
#define print(x) (cout << (x) << endl)
#define pb push_back
#define mp make_pair
#define sz(x) int(x.size())
template<class T> inline void Yes(T condition){ if(condition) cout << "Yes" << endl; else cout << "No" << endl; }
#define fs first
#define sc second

const int INF = 1e9;
const ll LLINF = 1e16;
const ll MOD = 1e9+7;
template<class T> inline void add(T &a, T b){a = ((a+b) % MOD + MOD) % MOD;};

template<typename T>
vector<T> make_v(size_t a){return vector<T>(a);}
 
template<typename T,typename... Ts>
auto make_v(size_t a,Ts... ts){
  return vector<decltype(make_v<T>(ts...))>(a,make_v<T>(ts...));
}
 

// 指定した文字cが文字列に何文字入ってるか
ll stringcount(string s, char c) {
    return count(s.cbegin(), s.cend(), c);
}


// 割り算の切り上げ処理
template<typename T>
T rp(T a, T b) {
  return (a + b - 1) / b;
}

// 桁和
template<typename T>
T digsum(T n) {
    T res = 0;
    while(n > 0) {
        res += n%10;
        n /= 10;
    }
    return res;
}

// 回文判定
bool kai (string s) {
    string t{s};
    reverse(begin(t), end(t));
    return s == t;
}

using pint = pair<int, int>;
using pll = pair<ll, ll>;

ll n, k, a[200000], f[200000];

bool check(ll mid){
    ll sum = 0;
    rep(i, n){
      	ll ok = mid / f[i];
        if(a[i] > ok) sum += a[i] - ok;
    }
    return sum <= k;
}

ll binary_search(){
  ll ok = 1e13;
  ll ng = -1;
  while(abs(ok - ng) > 1){
    ll mid = (ok + ng) / 2;
    if(solve(mid)){
      ok = mid;
    }else{
      ng = mid;
    }
  }
  return ok;
}

int main(void)
{
    cout.tie(0);
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(20);
    cin >> n >> k;
    rep(i, n) cin >> a[i] >> f[i];
    sort(a, a+n);
    sort(f, f+n, greater<>());
    int64_t ok = 1e13, ng = -1;
    while(ok-ng>1){
        int64_t mid = (ok+ng)/2;
        (check(mid) ? ok : ng) = mid;
    }
    cout << ok << endl;
    

}



Compiler output:
a.cc: In function 'll binary_search()':
a.cc:83:8: error: 'solve' was not declared in this scope
   83 |     if(solve(mid)){
      |        ^~~~~
Language: C++

#include<bits/stdc++.h>
#pragma GCC optimize("Ofast")

using namespace std;
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
typedef long long ll;
#define rep(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define REP(i,num,n) for(int i=num, i##_len=(n); i<i##_len; ++i)
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
#define print(x) (cout << (x) << endl)
#define pb push_back
#define mp make_pair
#define sz(x) int(x.size())
template<class T> inline void Yes(T condition){ if(condition) cout << "Yes" << endl; else cout << "No" << endl; }
#define fs first
#define sc second

const int INF = 1e9;
const ll LLINF = 1e16;
const ll MOD = 1e9+7;
template<class T> inline void add(T &a, T b){a = ((a+b) % MOD + MOD) % MOD;};

template<typename T>
vector<T> make_v(size_t a){return vector<T>(a);}
 
template<typename T,typename... Ts>
auto make_v(size_t a,Ts... ts){
  return vector<decltype(make_v<T>(ts...))>(a,make_v<T>(ts...));
}
 

// 指定した文字cが文字列に何文字入ってるか
ll stringcount(string s, char c) {
    return count(s.cbegin(), s.cend(), c);
}


// 割り算の切り上げ処理
template<typename T>
T rp(T a, T b) {
  return (a + b - 1) / b;
}

// 桁和
template<typename T>
T digsum(T n) {
    T res = 0;
    while(n > 0) {
        res += n%10;
        n /= 10;
    }
    return res;
}

// 回文判定
bool kai (string s) {
    string t{s};
    reverse(begin(t), end(t));
    return s == t;
}

using pint = pair<int, int>;
using pll = pair<ll, ll>;

ll n, k, a[200000], f[200000];

bool solve(ll mid){
    ll sum = 0;
    rep(i, n){
      	ll ok = mid / f[i];
        if(a[i] > ok) sum += a[i] - ok;
    }
    return sum <= k;
}

ll binary_search(){
  ll ok = 1e13;
  ll ng = -1;
  while(abs(ok - ng) > 1){
    ll mid = (ok + ng) / 2;
    if(solve(mid)){
      ok = mid;
    }else{
      ng = mid;
    }
  }
  return ok;
}

int main(void)
{
    cout.tie(0);
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(20);
    cin >> n >> k;
    rep(i, n) cin >> a[i] >> f[i];
    sort(a, a+n);
    sort(f, f+n, greater<>());
    int64_t ok = 1e13, ng = -1;
    while(ok-ng>1){
        int64_t mid = (ok+ng)/2;
        (check(mid) ? ok : ng) = mid;
    }
    cout << ok << endl;
    

}



Compiler output:
a.cc: In function 'int main()':
a.cc:105:10: error: 'check' was not declared in this scope
  105 |         (check(mid) ? ok : ng) = mid;
      |          ^~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
using vec_int = vector<int>;
#define int long long
using P = pair<int,int>;
using T = tuple<int,int,int>;
using ll = long long;
using vec_ll = vector<ll>;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)

int charToInt(char c){
    char zero_num = '0';
    return (int)c - (int)zero_num;
}

int main(){
    ll N, K; cin>>N>>K;
    vec_int A(N), F(N);
    rep(i,N)cin>>A.at(i);
    rep(i,N)cin>>F.at(i);

    sort(A.begin(),A.end());
    sort(F.begin(),F.end());

    //よし、二分探索だ
    ll left = -1;
    ll right = pow(10,18); 

    while(right>left+1){
        ll comp = (left+right)/2;
//        cout<<right<<" "<<left<<" "<<comp<<endl;

        //compのスコアを達成できるかをチェックする
        ll used_K = 0;
        int flag = 0;
        rep(i,N){
            if(F.at(N-1-i)*A.at(i)>comp){
                used_K+=(F.at(N-1-i)*A.at(i)-comp)/F.at(N-1-i);
                if((F.at(N-1-i)*A.at(i)-comp)%F.at(N-1-i)!=0)used_K++;
            }
            if(used_K>K){
                flag=1;
                break;
            }
        }
        //flag=1の時にはスコアを達成できなかった
        if(flag==1){
            left = comp; 
        }else{
            right = comp;
        }
    }
    cout<<right<<endl;


    return 0;
}

Compiler output:
cc1plus: error: '::main' must return 'int'
Language: C

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
typedef long long ll;

int n;
ll k, a[200000], f[200000];
int check(ll x) {
    ll cost = 0;
    for (int i = 0; i < n; ++i) {
        cost += max(a[i] - x / f[i], 0LL);
    }
    return cost <= k;
}

int lesser(const void* a, const void* b) {
    if (*(ll*)a > * (ll*)b)return 1;
    if (*(ll*)a < *(ll*)b)return -1;
    return 0;
}
int greater(const void* a, const void* b) {
    if (*(ll*)a < *(ll*)b)return 1;
    if (*(ll*)a > * (ll*)b)return -1;
    return 0;
}

int main(void) {
    scanf("%d %lld", &n, &k);
    for (int i = 0; i < n; ++i)scanf("%lld", &a[i]);
    for (int i = 0; i < n; ++i)scanf("%lld", &f[i]);
    qsort(a, n, sizeof(ll), lesser);
    qsort(f, n, sizeof(ll), greater);
    for (int i = 0; i < n; ++i)printf("%lld%c", a[i], i == n - 1 ? '\n' : ' ');
    for (int i = 0; i < n; ++i)printf("%lld%c", f[i], i == n - 1 ? '\n' : ' ');

    ll ng = -1, ok = 1000000000000LL;
    while (ok - ng > 1) {
        ll mid = ng + ok >> 1;
        if (check(mid) == 1)ok = mid;
        else ng = mid;
    }

    printf("%lld", ok);

    return 0;
}

Compiler output:
main.c: In function 'check':
main.c:11:17: error: implicit declaration of function 'max' [-Wimplicit-function-declaration]
   11 |         cost += max(a[i] - x / f[i], 0LL);
      |                 ^~~
Language: C

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
typedef long long ll;

int n;
ll k, a[200000], f[200000];
int check(ll x) {
    ll cost = 0;
    for (int i = 0; i < n; ++i) {
        cost += max(a[i] - x / f[i], 0LL);
    }
    return cost <= k;
}

int greater(const void* a, const void* b) {
    if (*(ll*)a > * (ll*)b)return 1;
    if (*(ll*)a < *(ll*)b)return -1;
    return 0;
}
int lesser(const void* a, const void* b) {
    if (*(ll*)a < *(ll*)b)return 1;
    if (*(ll*)a > * (ll*)b)return -1;
    return 0;
}

int main(void) {
    scanf("%d %lld", &n, &k);
    for (int i = 0; i < n; ++i)scanf("%lld", &a[i]);
    for (int i = 0; i < n; ++i)scanf("%lld", &f[i]);
    qsort(a, n, sizeof(ll), lesser);
    qsort(f, n, sizeof(ll), greater);
    
    ll ng = -1, ok = 1000000000000LL;
    while (ok - ng > 1) {
        ll mid = ng + ok >> 1;
        if (check(mid) == 1)ok = mid;
        else ng = mid;
    }

    printf("%lld", ok);

    return 0;
}

Compiler output:
main.c: In function 'check':
main.c:11:17: error: implicit declaration of function 'max' [-Wimplicit-function-declaration]
   11 |         cost += max(a[i] - x / f[i], 0LL);
      |                 ^~~
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <functional>
#include <cmath>

using namespace std;
typedef long long int ll;
int main(void){
  ll N,K;
  cin >> N >> K;
  vector<ll> A,F;

  for(int i=0;i<N;i++){
    ll tmp;
    cin >> tmp;
    A.push_back(tmp);
  }

  for(int i=0;i<N;i++){
    ll tmp;
    cin >> tmp;
    F.push_back(tmp);
  }
  sort(A.begin(),A.end());
  sort(F.begin(),F.end(),greater<ll>());

  ll max = 0;
  ll sumA = 0;
  for(int i=0;i<A.size();i++){
    ll tmp = A[i]*F[i];
    sumA = sumA + A[i];
    if(max < tmp){
      max = tmp;
    }
  }
  if(sumA <= K){
    cout << 0 << endl;
    return 0;
  }
  //0にできない場合二分探索
  ll l,r;
  l=0;
  r=max;
  while(r-l>1){
    ll c = (r+l)/2;
    // cは達成できるか？
    bool flag = true;
    ll sum = 0;
    for(int i=0;i<A.size();i++){
      ll k = max((ll)0, A[i] - c/(double)F[i]);
      sum = sum + k;
      if(sum > K){
        flag = false;
        break;
      }
    }
    //cout << r << " " << l << " " << c << endl;
    if(flag){
      r = c;
    }else{
      l = c;
    }
  }
  cout << r << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:51:17: error: 'max' cannot be used as a function
   51 |       ll k = max((ll)0, A[i] - c/(double)F[i]);
      |              ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <functional>
#include <cmath>

using namespace std;
typedef long long int ll;
int main(void){
  ll N,K;
  cin >> N >> K;
  vector<ll> A,F;

  for(int i=0;i<N;i++){
    ll tmp;
    cin >> tmp;
    A.push_back(tmp);
  }

  for(int i=0;i<N;i++){
    ll tmp;
    cin >> tmp;
    F.push_back(tmp);
  }
  sort(A.begin(),A.end());
  sort(F.begin(),F.end(),greater<ll>());

  ll max = 0;
  ll sumA = 0;
  for(int i=0;i<A.size();i++){
    ll tmp = A[i]*F[i];
    sumA = sumA + A[i];
    if(max < tmp){
      max = tmp;
    }
  }
  if(sumA <= K){
    cout << 0 << endl;
    return 0;
  }
  //0にできない場合二分探索
  ll l,r;
  l=0;
  r=max;
  while(r-l>1){
    ll c = (r+l)/2;
    // cは達成できるか？
    bool flag = true;
    ll sum = 0;
    for(int i=0;i<A.size();i++){
      ll k = max((ll)0, ceil(A[i] - c/(double)F[i]));
      sum = sum + k;
      if(sum > K){
        flag = false;
        break;
      }
    }
    //cout << r << " " << l << " " << c << endl;
    if(flag){
      r = c;
    }else{
      l = c;
    }
  }
  cout << r << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:51:17: error: 'max' cannot be used as a function
   51 |       ll k = max((ll)0, ceil(A[i] - c/(double)F[i]));
      |              ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~