akhauriyash/Code-Regression huggingface dataset:
import math

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

if a**2 * b / 2 < x:
    print(90-math.degrees(math.atan2(a**3, 2*(a**2 * b - x))))
else:
    print(90-math.degrees(math.atan2(2*x, a * b**2)))

Measured memory_bytes: 38512
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
int f() {
    return 0;
}
 
int main() {
  int N, K;
  scanf("%d", &N);
  scanf("%d", &K);
  int ans = 0;
  for(int i = 0; i < N; i++) {
    int *ptr = (int *)malloc(sizeof(int *));
    scanf("%d ", ptr);
    int tmp = (K - (*ptr));
    int a = (tmp > 0 ? tmp : (-tmp))*2;
    int b = (*ptr)*2;
    ans += (a > b ? b : a);
  }
  printf("%d\n", ans);
  return f();
}

Measured memory_bytes: 128
#include <iostream>
using namespace std;

int main() {
	int A, B, C;
	cin >> A >> B >> C;
	
	bool AB = A == B;
	bool BC = B == C;
	bool CA = C == A;
	
	if(AB) cout << C;
	else if (BC) cout << A;
	else if (CA) cout << B;
	
	cout << endl;
	

	return 0;
}

Measured memory_bytes: 256
N, M = map(int, input().split())
A = list(map(int, input().split()))


def to_cumsum(arr):
    cumsum = 0
    new = list()
    for e in arr:
        cumsum = (cumsum + e) % M
        new.append(cumsum)
    return new


d = dict()
for a in to_cumsum(A):
    if d.get(a) is None:
        d[a] = 1
    else:
        d[a] += 1

ans = 0
for mod, cnt in d.items():
    if mod == 0:
        ans += cnt
    ans += cnt * (cnt - 1) // 2
print(ans)


Measured memory_bytes: 16300
#include <iostream>
#include <math.h>
using namespace std;

typedef long long LL;



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

#ifndef ONLINE_JUDGE

    // for getting inpit from input.txt
    freopen("input.txt", "r", stdin);
    //for writing output to output.txt
    freopen("output1.txt", "w", stdout);
#endif


    double n, t, x;
    cin >> n >> x >> t;
    if (n <= x)
    {   cout << t << "\n";
    }
    else {
        double ans = ceil(n / x);
        cout << int(ans * t) << "\n";


    }


    return 0;
}

Measured memory_bytes: 3248
#include<iostream>

using namespace std;

int main(void) {

    int A, B, C, X;
    int total = 0;
    cin >> A;
    cin >> B;
    cin >> C;
    cin >> X;

    for (int i = 0; i <= A; i++) {
        for (int j = 0; j <= B; j++) {
            for (int k = 0; k <= C; k++) {
                if ((500*i + 100*j + 50*k) == X) {
                    total++;
                }
            }
        }
    }
    cout << total << endl;
}


Measured memory_bytes: 256
unittest
{
//	assert( [ "5", "1 2", "2 3", "3 4", "4 5", "1 2 3 4 5" ].parse.expand.solve == "10\n1 2 3 4 5" );
	assert( [ "5", "1 2", "2 3", "3 4", "4 5", "1 2 3 4 5" ].parse.expand.solve == "10\n5 4 3 2 1" );
//	assert( [ "5", "1 2", "1 3", "1 4", "1 5", "3141 59 26 53 59" ].parse.expand.solve == "197\n59 26 3141 59 53" );
	assert( [ "5", "1 2", "1 3", "1 4", "1 5", "3141 59 26 53 59" ].parse.expand.solve == "197\n3141 59 59 53 26" );
}



import std.algorithm;
import std.container;
import std.conv;
import std.format;
import std.range;
import std.stdio;
import std.typecons;

void main()
{
	stdin.byLineCopy.parse.expand.solve.writeln;
}

auto parse( Range )( Range input )
if( isInputRange!Range && is( ElementType!Range == string ) )
{
	auto n = input.front.to!( long );
	auto abs = new long[ 2 ][ n - 1 ];
	foreach( ref ab; abs )
	{
		input.popFront;
		ab = input.front.split.to!( long[] );
		ab[] -= 1;
	}
	input.popFront;
	auto cs = input.front.split.to!( long[] );
	return tuple( n, abs, cs );
}

auto solve( long n, long[ 2 ][] abs, long[] cs )
{
	cs.sort!( ( x, y ) => y < x );
	
	// bfsで頂点へ整数を大きい順に書き込む
	auto nss = toAdjacencyList!( true )( n, abs );
	auto m = 0L;
	auto ds = new long[ n ];
	ds[] = long.max;
	
	ds[ 0 ] = cs.front;
	cs.popFront;
	
	auto queue = make!DList( 0L );
	while( !queue.empty )
	{
		auto f = queue.front;
		queue.removeFront();
		
		foreach( t; nss[ f ] )
		{
			if( ds[ t ] < long.max ) continue;
			
			m += cs.front;
			ds[ t ] = cs.front;
			cs.popFront;
			queue.insertBack( t );
		}
	}
	
	return format( "%s\n%s", m, ds.to!( string[] ).join( ' ' ) );
}

// 辺配列から隣接リストを作成
auto toAdjacencyList( bool undirected = false )( long n, long[ 2 ][] es )
{
	auto nss = new long[][ n ];
	foreach( e; es )
	{
		nss[ e[ 0 ] ] ~= e[ 1 ];
		static if( undirected ) nss[ e[ 1 ] ] ~= e[ 0 ];
	}
	return nss;
}


Measured memory_bytes: 4348
#include<iostream>
#include<cstdio>
#include<cmath>
#include<cstring>
#include<string>
#include<stack>
#include<queue>
#include<vector>
#include<algorithm>
#include<iomanip>
#include<utility>
#include<set>
#include<unordered_set>
typedef long long int ll;
#define REP(i,n) for(int i=0;i<signed(n);i++)
using std::cout;
using std::vector;
using std::endl;
using std::cin;
using std::string;
using std::min;
using std::max;
const ll MOD = 1000000007;
const ll INF = 9e9;
ll N, M, ans = INF;
ll A[300010], S[301000];

using namespace std;
int main() {
	fill(begin(A), end(A), 0);
	fill(begin(S), end(S), 0);
	std::ios_base::sync_with_stdio(false);
	cin >> N;
	REP(i, N) {
		cin >> A[i];
		S[i] += A[i];
		S[i + 1] = S[i];
	}
	//a:右半分の区切り i:真ん中 b:左半分
	//s:右の和 t:左の和
	ll a = 0, b = 2, s, t;
	REP(i, N - 1) {
		if (i == b)b++;
		s = (S[i] - S[a]) - S[a];
		t = (S[N - 1] - S[b]) - (S[b] - S[i]);
		bool f = true;
		if (i == 0)continue;
		while (f) {
			f = false;
			if (a + 1 == i)continue;
			if (abs(s)>abs(s - A[a + 1] * 2)) {
				s -= A[a + 1] * 2;
				a++; f = true;
			}
		}
		f = true;
		while (f) {
			f = false;
			if (b + 1 == N - 1 || b == N - 1)continue;
			if (abs(t)>abs(t - A[b + 1] * 2)) {
				t -= A[b + 1] * 2;
				b++; f = true;
			}
		}
		ans = min(ans, (max({ S[a],S[i] - S[a],S[b] - S[i],S[N - 1] - S[b] })
			- min({ S[a],S[i] - S[a],S[b] - S[i],S[N - 1] - S[b] })));
	}
	cout << ans << endl;
	cin >> a;
	return 0;
}


Measured memory_bytes: 5120
#include <bits/stdc++.h>
#pragma GCC optimize("O2")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse4")
using namespace std;

# define mp make_pair
# define pb push_back
# define PI acos(-1)
# define ff first 
# define ss second 
# define vt vector
# define all(c) (c).begin(), (c).end()
# define repi(i,a,b) for(ll i = a ; i < b ; ++i)
# define rep(i,b) for(ll i = 0 ; i < b ; ++i)
typedef long long ll ; 
typedef long double ld ; 
typedef pair<int,int> pii ; 
typedef pair<ll,ll> pll ;

template<class T> bool umin(T& a, const T& b) { return b < a ? a = b, 1 : 0; }
template<class T> bool umax(T& a, const T& b) { return a < b ? a = b, 1 : 0; }

const int MOD = 998244353  ;
const ll inf = 1e18 ;  
const ll mod = 1e9+7 ;  
template<typename T> T gcd(T a,T b) { if(a==0) return b; return gcd(b%a,a); }
template<typename T> T lcm(T a, T b) { return (a*b)/gcd(a,b) ;}
template<typename T> T power(T a,T b){T ans=1; while(b>0){ if(b%2==1) ans=(ans*a); b/=2; a=(a*a); } return ans; }
ll nCr(ll n,ll r){ll t=1;if(r>n)return 0;if(r>n-r)r=n-r;for(ll i=0;i<r;i++){t*=(n-i);t/=(i+1);}return t;}
template<typename T> bool print(T a) { cout << a << "\n" ; return 1 ;}

// ==========OKAY==============



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

	
	ll a,b,c,k ; 
	cin >> a >> b >>c >> k ;
	if(k%2==0) {
		cout << a-b ; 
	} else {
		cout << b-a ; 
	}




 	return 0 ; 
}

Measured memory_bytes: 3660
package main
import (
  "fmt"
)
func main() {
  var a, b, c, d int
  fmt.Scanf("%d %d %d %d", &a, &b, &c, &d)
  x := a * b
  y := c * d
  if x > y {
    fmt.Println(x)
  } else {
    fmt.Println(y)
  }
}

Measured memory_bytes: 512
#include <iostream>
#include <vector>
#include <array>
#include <deque>
#include <stack>
#include <queue>
#include <list>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <algorithm>
#include <numeric>
#include <utility>
#include <cmath>
#include <iomanip>
#include <cassert>
#include <complex>
#include <bitset>
#include <functional>

using namespace std;
using ll=long long int;

int main() {
    ll t1, t2;
    cin >> t1 >> t2;
    ll a1, a2, b1, b2;
    cin >> a1 >> a2 >> b1 >> b2;

    if (a1 > b1) {
        swap(a1, b1);
        swap(a2, b2);
    }

    ll la = t1 * a1 + t2 * a2;
    ll lb = t1 * b1 + t2 * b2;
    if (la == lb) {
        cout << "infinity" << endl;
        return 0;
    }

    if (la < lb) {
        cout << 0 << endl;
        return 0;
    }

    ll m = t1 * b1 - t1 * a1;
    ll d = la - lb;

    ll ans = 1 + 2 * ((m-1) / d);
    if (m % d == 0) ++ans;

    cout << ans << endl;





    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, srt, end) for (long long i = (srt); i < (long long)(end); i++)

ll popcount(ll n){
    ll mask = 1, res = 0;
    while(n >= mask){
        if(mask & n) res++;
        mask *= 2;
    }
    return res;
}

ll guchoku(ll n){
    if(n == 0) return 0;
    if(n == -1) return -1;
    return guchoku(n % popcount(n)) + 1;
}

int main(){
    ll n, m = 0;
    string x;
    cin >> n >> x;
    reverse(x.begin(), x.end()); // x = sum of 2^i + x[i]
    for(auto e : x) m += (e - '0');
    /*
    - pw_plus[i] := 2^i % popcount(x)+1
    - pw_minus[i] := 2^i % popcount(x)-1
    */
    vector<ll> pw_plus(200010, 1), pw_minus(200010, 1);
    for(ll i = 1; i < 200010; i++) {
        pw_plus[i] = 2 * pw_plus[i-1];
        pw_plus[i] %= (m+1);
        if(m > 1){
            pw_minus[i] = 2 * pw_minus[i-1];
            pw_minus[i] %= (m-1);
        }
    }
    /*
    - x_plus := x % popcount(x)+1
    - x_minus := x % popcount(x)-1
    */
    ll x_plus = 0, x_minus = 0;
    for(ll i = 0; i < n; i++){
        x_plus += pw_plus[i] * (x[i] - '0');
        x_plus %= (m+1);
        if(m > 1){
            x_minus += pw_minus[i] * (x[i] - '0');
            x_minus %= (m-1);
        }
    }
    vector<ll> rec_ans(n);
    for(ll i = 0; i < n; i++){
        ll ans;
        if(x[i] == '1') {
            if(m == 1) ans = -1;
            else {
                ans = x_minus - pw_minus[i];
                ans = (ans+m-1) % (m-1);
            }
        } else {
            ans = x_plus + pw_plus[i];
            ans %= (m+1);
        }
        rec_ans[i] = guchoku(ans) + 1;
    }
    for(ll i = n-1; i >= 0; i--) cout << rec_ans[i] << endl;
    return 0;
}

Measured memory_bytes: 8408
import std.stdio, std.string, std.array, std.conv, std.algorithm, std.typecons, std.range, std.container, std.math, std.algorithm.searching, std.functional;

void main(){
    auto nl=readln().split.map!(to!int).array;
    auto ss=iota(0,nl[0]).map!(l=>readln().chomp).array;
    ss.sort();
    writeln(ss.join);
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int,int>;

const ll INF = 1001001001001001;


ll dp[200001];
ll a[200001];
ll dpall[200001];
int n;


ll init(){
    rep(i,200001) dp[i]=-INF;
    rep(i,200001) dpall[i]=-INF;
    return 0;
}

ll rec(int x, int k){
    //cout << "x:" << x << "k:" << k << endl;
    if(k*2>x) return dpall[x];
    if(k==0) return ll(0);
    if(dp[x]>-INF) return dp[x];

    ll res = -INF;

    ll temp = 0;
    temp += a[x-1];
    temp += rec(x-2,k-1);
    //cout << "x-2:k-1 " << x-2 << " : "  << k-1 << "  " << temp << endl;
    res = max(res,temp);


    temp = 0;
    temp += a[x-2];
    temp += rec(x-3,k-1);
    /*
    cout << "x-3:k-1 " << x-3 << " : "  << k-1 << "  " << temp << endl;
    cout << a[x-2] << " " << rec(x-3,k-1) << endl;
    */
    res = max(res,temp);

    if(x%2==0) return dp[x]=res;

    temp = 0;
    temp = dpall[x-2];
    //cout << "x-2:k " << x-2 << " : "  << k << "  " << temp << endl;
    res = max(res,temp);

    return dp[x]=res;
}

int main(){
    cin >> n;
    rep(i,n) cin >> a[i];
    
    init();
    for(int i=1; i<=n/2; ++i){
        if(i==1){
            dpall[1]=a[0];
            continue;
        }
        dpall[2*i-1] = dpall[2*i-3]+a[2*i-2];
    }

    /*
    cout << "dpall" << endl;
    for(int i=1; i<=n; i+=2){
        cout <<"i" << i <<" : "<<dpall[i] << endl;
    }*/

    cout << rec(n,n/2) << endl;

}


Measured memory_bytes: 16124
#include <bits/stdc++.h>
using namespace std;
template <class T>
inline bool chmax(T &a, T b)
{
    if (a < b)
    {
        a = b;
        return 1;
    }
    return 0;
}
template <class T>
inline bool chmin(T &a, T b)
{
    if (a > b)
    {
        a = b;
        return 1;
    }
    return 0;
}
typedef long long int ll;

#define EPS (1e-7)
#define INF (1 << 30)
#define LLINF (1LL << 60)
#define PI (acos(-1))
#define MOD (1000000007)
#define ALL(v) (v).begin(), (v).end()
#define RALL(v) (v).rbegin(), (v).rend()
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};

//-------------------------------------

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int a, b, c, x;
    cin >> a >> b >> c >> x;
    int ans = 0;
    for (int i = 0; i <= a; i++)
    {
        for (int j = 0; j <= b; j++)
        {
            for (int k = 0; k <= c; k++)
            {
                if (500 * i + 100 * j + 50 * k == x)
                {
                    ans++;
                }
            }
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main()
{
    int a, b,m,n;
    cin>>a>>b;
    if (a == 1)
    {
        if (b== 1)
        {
            cout<<"";
        }
        else
        {
            cout<<((b*(b-1))/2);
        }
        
    }
    
    n = ((a*(a-1))/2);
    m = ((b*(b-1))/2);
    cout<<m+n;

    
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int c = sc.nextInt();
        int tmp;
        if(a > b) {
        	tmp = a;
        	a = b;
        	b = tmp;
        	}
        if(b > c) {
        	tmp = b;
        	b = c;
        	c = tmp;
        	}
        if(a > b) {
        	tmp = a;
        	a = b;
        	b = tmp;
        	}
        System.out.println( a + " " + b + " " + c );
	}

}


Measured memory_bytes: 26204
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx")
#pragma GCC optimize("unroll-loops")
//#pragma warning(disable : 4996)

//#include"atcoder/all"


#ifdef _MSC_VER
#include <intrin.h>

#define __builtin_popcount __popcnt
#define __builtin_popcountll __popcnt64
#endif

#include <limits.h>
#include <math.h>
#include <time.h>

#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <complex>
#include <cstdio>
#include <cstring>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>

using namespace std;
//using namespace atcoder;

#define REP(i, n) for (int i = 0; i < (n); ++i)
#define REPR(i, n) for (int i = n - 1; i >= 0; --i)
#define FOR(i, m, n) for (int i = m; i < n; ++i)
#define FORR(i, m, n) for (int i = m - 1; i >= n; --i)
#define SORT(v, n) sort(v, v + n);
#define VSORT(v) sort(v.begin(), v.end());
#define REVERSE(v, n) reverse(v, v + n);
#define VREVERSE(v) reverse(v.begin(), v.end())
#define ll long long
#define print(x) cout << (x) << endl
#define pe(x) cout << (x) << " "
#define DEBUG(x) cout << #x << ": " << x << endl
#define lb(v, n) lower_bound(v.begin(), v.end(), (n))
#define ub(v, n) upper_bound(v.begin(), v.end(), (n))
#define int long long
//#define double long double
#define all(x) (x).begin(), (x).end()
#define print_space(v) REP(i, v.size()) cout << v[i] << " \n"[i==(int)v.size()-1]
template <typename T1, typename T2> inline void chmin(T1& a, T2 b) { if (a > b) a = b; }
template <typename T1, typename T2> inline void chmax(T1& a, T2 b) { if (a < b) a = b; }
typedef pair<int, int> pii;
typedef pair<long long, long long> pll;
std::random_device rd;
std::mt19937 mt(rd());
constexpr ll MOD = 1e9 + 7;
constexpr int MAX = 500050;
const double pi = acos(-1);
constexpr double EPS = 1e-8;
constexpr ll LINF = 1e18 + 1;
constexpr int INF = 1e9 + 1;


void solve() {
	int N; cin >> N;
	vector<int>A(N), B(N), C(N);
	REP(i, N)cin >> A[i];
	REP(i, N)cin >> B[i];
	REP(i, N)cin >> C[i];
	VSORT(A); VSORT(B); VSORT(C);
	int ans = 0;
	REP(i, N) {
		int x = B[i];
		ans += (lb(A, x) - A.begin())*(C.end() - ub(C, x));
	}
	print(ans);
}



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

	//int q;
	//cin >> q;
	//while (q--)
	solve();

}


Measured memory_bytes: 5572
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> P;
typedef pair<ll, ll> Pll;
#define debug(var)  do{std::cout << #var << " : ";view(var);}while(0)
template<typename T> void view(T e){std::cout << e << std::endl;}
template<typename T> void view(const std::vector<T>& v){for(const auto& e : v){ std::cout << e << " "; } std::cout << std::endl;}
template<typename T> void view(const std::vector<std::vector<T> >& vv){ for(const auto& v : vv){ view(v); } }
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; }

const int MOD = 1000000007;
const int INF = 1e9;

const int mod = 1000000007;
const int inf = 1e9;
#define PI acos(-1);
int dx[4] = {1,-1,0,0};
int dy[4] = {0,0,1,-1};
int ddx[8] = {1,1,1,-1,-1,-1,0,0};
int ddy[8] = {0,1,-1,0,1,-1,1,-1};


int main(){
    int x, a, b;
    cin >> x >> a >> b;
    cout << (abs(x-a) < abs(x-b) ? "A":"B") << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;

int main()
{
    int n,c=0,a=0,b=0;

    cin >> n;

    for(int i = 1 ; i<=n ; i++)
    {
        int x;

        cin >> x;
        if(x%2)
            a++;
        else if(x%4==0)
            b++;
        else
            c++;
    }
    if(c==0)
    {
        if(b+1>=a)
            cout << "Yes";
        else
            cout << "No";
    }
    else if(c>0)
    {
        if(a<=b)
            cout << "Yes";
        else
            cout << "No";
    }

    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<vector>
using namespace std;

int main(){
    int q,x,n;
    cin>>n;
    vector<int>a;
    for(int i=0;i<n;i++){
        cin>>q;
        if(q==0){
            cin>>x;
            a.push_back(x);
        }
        else if(q==1){
            if(a.size()>0){
            cin>>x;
            cout<<a[x]<<endl;
            }
        }
        else if(q==2){
            a.pop_back();
        }
    }
    return 0;
}


Measured memory_bytes: 3820
{-# LANGUAGE OverloadedStrings #-}
import Control.Monad
import qualified Data.ByteString.Char8 as B
import qualified Data.Vector as V
import Data.List
f :: [Int]->Int->B.ByteString->V.Vector Int
f n k l=if B.null(B.tail l) then V.fromList n else if (B.head l)=='A'&&((B.head).(B.tail)) l=='C' then f ((k+1):n) (k+1) (B.tail l) else f (k:n) k (B.tail l)
g n l = (n V.! ((l!!1)-1)) - (n V.!((l!!0)-1))
main=do
 [n,q]<-Prelude.map read.words<$>Prelude.getLine ::IO[Int]
 s<-B.getLine
 l<-Prelude.map (Prelude.map read.words)<$>replicateM q Prelude.getLine ::IO[[Int]]
 putStr$unlines$Prelude.map show$Prelude.map ((g.V.reverse) (f [0] 0 (s))) l


Measured memory_bytes: 77692
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<n; i++)

int main(){
    int N;
    string S;
    cin >> N >> S;
    int cnt = 0;
    for(int i=0;i<N-2;i++){
        if(S[i] == 'A' && S[i+1] == 'B' && S[i+2] == 'C') cnt++;
    }
    cout << cnt << endl;
}



Measured memory_bytes: 256
// #define _GLIBCXX_DEBUG // for STL debug (optional)
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <cfloat>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <fstream>
#include <functional>
#include <bitset>
using namespace std;

#define debug(...) fprintf(stderr, __VA_ARGS__)
#define int long long int
 
template<typename T> void chmax(T &a, T b) {a = max(a, b);}
template<typename T> void chmin(T &a, T b) {a = min(a, b);}
template<typename T> void chadd(T &a, T b) {a = a + b;}
 
typedef pair<int, int> pii;
typedef long long ll;
 
int dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};
const ll INF = 1001001001001001LL;
const ll MOD = 1000000007LL;

int X1[210], Y1[210], Z1[210], X2[210], Y2[210], Z2[210];
int rX[210], rY[210], rZ[210];
int sum[210][210][210];
signed main() {
    int N, K; cin >> N >> K;
    map<int, int> cmpx, cmpy, cmpz;

    // int acc[210][210][210];
    for(int i=0; i<N; i++) {
        int x1, y1, z1, x2, y2, z2;
        cin >> x1 >> y1 >> z1 >> x2 >> y2 >> z2;
        cmpx[x1]++; cmpx[x2]++; // cmpx[x2+1]++;
        cmpy[y1]++; cmpy[y2]++; // cmpy[y2+1]++;
        cmpz[z1]++; cmpz[z2]++; // cmpz[z2+1]++;

        X1[i] = x1, Y1[i] = y1, Z1[i] = z1;
        X2[i] = x2, Y2[i] = y2, Z2[i] = z2;
    }

    int idx = 0, idy = 0, idz = 0;
    for(auto &e : cmpx) rX[idx] = e.first, e.second = idx++;
    for(auto &e : cmpy) rY[idy] = e.first, e.second = idy++;
    for(auto &e : cmpz) rZ[idz] = e.first, e.second = idz++;

    for(int i=0; i<N; i++) {
        int lb = cmpz[ Z1[i] ], ub = cmpz[ Z2[i] ];
        for(int z=lb; z<ub; z++) {
            int lx = cmpx[ X1[i] ], rx = cmpx[ X2[i] ];
            int ly = cmpy[ Y1[i] ], ry = cmpy[ Y2[i] ];
            for(int x=lx; x<rx; x++) {
                for(int y=ly; y<ry; y++) {
                    sum[x][y][z]++;
                }
            }
        }
    }

    int ans = 0;
    for(int i=0; i<idx; i++) {
        for(int j=0; j<idy; j++) {
            for(int k=0; k<idz; k++) {
                if(sum[i][j][k] >= K) {
                    int diff_x = rX[i+1] - rX[i];
                    int diff_y = rY[j+1] - rY[j];
                    int diff_z = rZ[k+1] - rZ[k];
                    ans += diff_x * diff_y * diff_z;
                }
            }
        }
    }
    cout << ans << endl;
    return 0;
}



Measured memory_bytes: 17668
#include <bits/stdc++.h>

#define REP(i, n) for (int i = 0; i < n; ++i)
#define FOR(i, a, b) for (int i = a; i <= b; ++i)
#define FORD(i, b, a) for (int i = b; i >= a; --i)

#define sz(v) ((int) v.size())
#define all(v) v.begin(), v.end()
#define uni(v) v.erase(unique(all(v)), v.end())

using namespace std;

int a[333], cnt[4];
double dp[333][333][333];

int main() {
    ios_base::sync_with_stdio(0); cin.tie(NULL); cout.tie(NULL);
    int n; cin >> n;
    FOR(i, 1, n) {
        cin >> a[i];
        cnt[a[i]]++;
    }
    for (int i = 0; i <= n; ++i) for (int j = 0; i + j <= n; ++j) for (int k = 0; i + j + k <= n; ++k) {
        if (!i && !j && !k) continue;
        double t1 = 0, t2 = 0, t3 = 0;
        if (i) t1 = dp[i - 1][j + 1][k] * i / n;
        if (j) t2 = dp[i][j - 1][k + 1] * j / n;
        if (k) t3 = dp[i][j][k - 1] * k / n;
        dp[i][j][k] = 1.0 * n / (i + j + k) * (t1 + t2 + t3 + 1);
    }
    cout << fixed << setprecision(15) << dp[cnt[3]][cnt[2]][cnt[1]] << "\n";
    return 0;
}


Measured memory_bytes: 260224
#include <stdio.h>

int main(void){

	int x, y, z;

	scanf("%d%d%d", &x, &y, &z);
		
	if(x < y && y < z){
		printf("Yes\n");
	}else{
		printf("No\n");
	
	}
	
	return 0;

	}

Measured memory_bytes: 580
#include "bits/stdc++.h"
#define ALL(x) x.begin(), x.end()
#define LEN(x) (int)x.size()
#define iostreamBooster() do{ cin.tie(nullptr); ios_base::sync_with_stdio(false); }while(0)
using namespace std;
typedef int64_t i64;
typedef pair<int,int> pii;
template<class A, class B>inline bool chmax(A &a, const B &b){return b>a ? a=b,1 : 0;}
template<class A, class B>inline bool chmin(A &a, const B &b){return b<a ? a=b,1 : 0;}
constexpr int INF = 0x3f3f3f3f;

signed main()
{
  i64 a, b, c;
  cin >> a >> b >> c;

  i64 ans = numeric_limits<i64>::max();
  i64 m;

  m = a/2;
  chmin(ans, abs(b*c*m - b*c*(a-m)) );

  m = b/2;
  chmin(ans, abs(a*c*m - a*c*(b-m)) );

  m = c/2;
  chmin(ans, abs(a*b*m - a*b*(c-m)) );

  cout << ans << endl;


  return 0;
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
typedef long long ll;

int main() {
    int x, y;
    cin >> x >> y;
    double t = 2 * (double)x - (double)y / 2;
    double k = (double)y / 2 - (double)x;
    if (floor(t) == t and floor(k) == k and t >= 0 and k >= 0) cout << "Yes" << endl;
    else cout << "No" << endl;
}

Measured memory_bytes: 3628
import bisect

n, m = map(int, input().split())
a = list(map(int, input().split()))
a.sort()
c = [None] * m
for j in range(m):
    c[j] = list(map(int, input().split()))
c.sort(key=lambda x: x[1], reverse=True)
k = 0
ans = 0
for i in range(n):
    if k >= m:
        ans += sum(a[i:])
        break
    if a[i] >= c[k][1]:
        ans += a[i]
    else:
        ans += c[k][1]
        c[k][0] -= 1
        if c[k][0] == 0:
            k += 1
print(ans)


Measured memory_bytes: 32984
#include "bits/stdc++.h"
using namespace std;


/* macro */
#define rep(i,a,b) for(int i=a;i<b;i++)
#define revrep(i,a,b) for(int i = a; i > b; i--)
#define int long long
#define exist(s,e) ((s).find(e)!=(s).end())
#define all(v) (v).begin(), (v).end()
#define each(s,itr) for(auto (itr) = s.begin(); (itr) != s.end(); (itr)++)
#define sum(v) accumulate(all(v), (0LL))
#define sec second
#define fir first
#define pb push_back



/* alias */
template<class T> using vec = vector<T>;
typedef vector<int> vi;
typedef pair<int, int> pi;


/* constant */
//const int inf = pow(2, 62);
//const int mod = 1e9 + 7;
const int mod = 100000;
int dx[8]={1,0,-1,0,-1,1,-1,1};
int dy[8]={0,1,0,-1,-1,-1,1,1};



/* io_method */
int input(){int tmp;cin >> tmp;return tmp;}
string raw_input(){string tmp;cin >> tmp;return tmp;}
string readline(){string s;getline(cin, s);return s;}
template<class T> void printx(T n){cout << n;}
template<class T, class U> void printx(pair<T, U> p){cout << "(" << p.first << "," << p.second << ")";}
template<class T> void printx(vector<T> v){cout << "{";rep(i,0,v.size()){printx(v[i]);if(i != v.size()-1)printx(",");}cout << "}";}
template<class T> void print(T n){printx(n);cout << endl;}
template<class T> void print(set<T> s){cout << "{";each(s, e){if(e != s.begin()) printx(",");printx(*e);}cout << "}" << endl;}
template<class T, class U> void print(map<T, U> mp){cout << "{";each(mp, e){cout << "(" << e -> first << "," << e -> second << ")";}cout << "}" << endl;}


/* general_method */
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; }




/* main */



signed main(){

    cin.tie(0);
    ios::sync_with_stdio(false);

    
    char t; cin >> t;

    set<char> s = {'a','i','u','e','o'};

    if(exist(s, t)){
        print("vowel");
    }else{
        print("consonant");
        
    }


    
    



    
    

    







   




    

    

    




    



    



    

 
    
    


    

    
   
    













}






    










    




    










Measured memory_bytes: 256
#include <algorithm>
#include <bitset>
#include <cmath>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <queue>
#include <set>
#include <tuple>
#include <vector>

using namespace std;

#define rep(i, n) for (int64_t i = 0; i < (n); i++)
#define irep(i, n) for (int64_t i = 0; i <= (n); i++)
#define rrep(i, n) for (int64_t i = (n)-1; i >= 0; i--)
#define rirep(i, n) for (int64_t i = n; i >= 0; i--)

class Vec;
Vec operator/(const Vec& v, const double& divisor);
Vec operator*(const double& scale, const Vec& v);

class Vec {
  using F = double;
  vector<F> container;

 public:
  Vec(size_t size) : container(size) {}
  Vec(initializer_list<F> elements)
      : container(elements.begin(), elements.end()) {}
  size_t dim() const { return container.size(); }
  F& operator[](const size_t size) { return container.at(size); }
  const F& operator[](const size_t size) const { return container.at(size); }
  Vec operator+(const Vec& other) const {
    Vec ret(*this);
    for (size_t i = 0; i < dim(); i++) ret[i] += other[i];
    return ret;
  }
  Vec operator-(const Vec& other) const { return (*this) + (-other); }
  Vec operator-() const { return -1.0 * (*this); }
  F inner(const Vec& other) const {
    F acc = 0;
    for (size_t i = 0; i < dim(); i++) {
      acc += (*this)[i] * other[i];
    }
    return acc;
  }
  F norm() const { return sqrt(inner(*this)); }
  Vec unit() const { return (*this) / this->norm(); }
  F ccw(const Vec& other) const {
    return (*this)[0] * other[1] - other[0] * (*this)[1];
  }
};
Vec operator/(const Vec& v, const double& divisor) { return 1.0 / divisor * v; }
Vec operator*(const double& scale, const Vec& v) {
  Vec ret(v);
  for (size_t i = 0; i < ret.dim(); i++) ret[i] *= scale;
  return ret;
}

class Line {
  Vec m_grad;
  double m_bias;

 public:
  Line(const Vec& grad, double bias) : m_grad(grad), m_bias(bias) {}
  static Line fromPoints(const Vec& p0, const Vec& p1) {
    Vec d = p0 - p1;
    Vec g({-d[1], d[0]});
    return Line(g, g.inner(p0));
  }
  const Vec& grad() const { return m_grad; }
  double bias() const { return m_bias; }
  double dist(const Vec& p) const {
    return abs(m_grad.inner(p) - m_bias) / m_grad.norm();
  }
  Vec projection(const Vec& p) const {
    const Vec g = m_grad.unit();
    const Vec h({-g[1], g[0]});
    return m_bias / m_grad.norm() * g + h.inner(p) * h;
  }
};

int main() {
  double x0, y0, x1, y1;
  cin >> x0 >> y0 >> x1 >> y1;

  const Line line = Line::fromPoints(Vec{x0, y0}, Vec{x1, y1});

  int q;
  cin >> q;
  rep(i, q) {
    double x, y;
    cin >> x >> y;

    const Vec p({x, y});
    const Vec v = line.projection(p);
    const Vec ref = v - (p - v);
    cout << fixed << setprecision(10) << ref[0] << " " << ref[1] << "\n";
  }
  cout.flush();
  return 0;
}



Measured memory_bytes: 3292
x1, y1, x2, y2 = list(map(int, input().split()))

x = x2 - x1
y = y2 - y1

x3 = x2 - y
y3 = y2 + x

x4 = x1 - y
y4 = y1 + x

print(str(x3) + ' ' + str(y3) + ' ' + str(x4) + ' ' + str(y4))

Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;

int main()
{
    int a[5];
    int last = 0, last_inx = 10;
    for(int i = 0; i < 5; ++i) cin >> a[i];
    for(int i = 0; i < 5; ++i) {
        if(a[i] % 10 != 0) {
            last = max(last, 10 - a[i] % 10);
            if(last == 10 - a[i] % 10) last_inx = i;
        }
    }
    int ans = 0;
    for(int i = 0; i < 5; ++i) {
        if(i == last_inx) ans += a[i];
        else {
            if(a[i] % 10 != 0) ans += (a[i] / 10 + 1) * 10;
            else ans += a[i];
        }
    }
    cout << ans << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>

// #undef DEBUG  // Uncomment this line to forcefully disable debug print.
#if DEBUG
template <typename T>
void debug(T value) {
  std::cerr << value;
}
template <typename T, typename... Ts>
void debug(T value, Ts... args) {
  std::cerr << value << ", ";
  debug(args...);
}
#define dbg(...)                              \
  do {                                        \
    cerr << #__VA_ARGS__ << ": ";             \
    debug(__VA_ARGS__);                       \
    cerr << " (L" << __LINE__ << ")" << endl; \
  } while (0)
#else
#define dbg(...)
#endif

void read_from_cin() {}
template <typename T, typename... Ts>
void read_from_cin(T& value, Ts&... args) {
  std::cin >> value;
  read_from_cin(args...);
}
#define in(type, ...) \
  type __VA_ARGS__;   \
  read_from_cin(__VA_ARGS__);

template <typename T>
void write_to_cout(const T& value) {
  std::cout << value << std::endl;
}
template <typename T, typename... Ts>
void write_to_cout(const T& value, const Ts&... args) {
  std::cout << value << ' ';
  write_to_cout(args...);
}
#define out(...) write_to_cout(__VA_ARGS__);

#define all(x) (x).begin(), (x).end()
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)

using ll = long long;

using namespace std;

int main() {
  in(int, a, b);
  out(a * b - (a + b) + 1);
}


Measured memory_bytes: 3448
#include<iostream>
using namespace std;
int main(){
    int K,N;
    cin >> K >> N;
    int a[N];
    for(int i=0;i<N;++i) cin >> a[i];
    int max_dist;
    max_dist = a[1] - a[0];
    for(int j = 1; j < N;++j){
        if(a[j]-a[j-1]>max_dist) max_dist = a[j] - a[j-1];
    }
    if(K-a[N-1]+a[0]>max_dist) max_dist = K-a[N-1]+a[0];
    cout << K - max_dist << endl;
}

Measured memory_bytes: 1024
import java.util.*;
import java.math.*;
import java.io.*;

public class Main{
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int a = in.nextInt();
		int b = in.nextInt();
		int c = in.nextInt();
		int d = in.nextInt();
		int ans = 1;
		while(true){
			if(a<=0 || c<=0){
				break;
			}
			c -= b;
			if(a<=0 || c<=0){
				break;
			}
			a -= d;
		}
		if(a<=0){
			System.out.println("No");
		}else if(c<=0){
			System.out.println("Yes");
		}
	}
}

Measured memory_bytes: 35736
function main(input) {
  const inputs = input.split('\n')
  const [K] = inputs[0].split(' ').map(Number)
  // console.log(K)
  const a = [1,2,3,4,5,6,7,8,9]
  let p = 0
  while(true) {
    // console.log(K, p, a.length, a)
    if (K <= a.length) {
      // console.log('OK:', K, a.length)
      console.log(a[K - 1])
      return 
    }
    const len = a.length
    for(let i = p; i < len; i++) {
      for (let j = -1; j <= 1; j++) {
        let k = String(a[i])
        let d = a[i] % 10 + j
        if (d < 10 && 0 <= d) {
          const nn = k + String((a[i] % 10) + j)
          a.push(Number(nn))
        }
      }
      p++
    }
  }
  // console.log(a)
  // console.log('finished')
}
main(require("fs").readFileSync("/dev/stdin", "utf8"));



Measured memory_bytes: 41684
#include <bits/stdc++.h>
using namespace std;
 
int c, o;
 
int main () {
	cin >> c >> o;
	if ((c<10&&c>0)&&(o<10&&o>0)){
		cout << c*o << endl;
	}
	else {
		cout << "-1" << endl;
	}
}

Measured memory_bytes: 256
def main():
  n = int(input())
  a = tuple(map(int ,input().split()))

  ans = [0]*(10**6)
  for x in a:
    ans[x-1] += 1
    ans[x] += 1
    ans[x+1] += 1
  print(max(ans))
if __name__ == '__main__':
  main()

Measured memory_bytes: 16232
import heapq

N, M = map(int, input().split())
arb = [[] for _ in range(M + 1)]

for _ in range(N) :
    a, b = map(int, input().split())
    if a <= M :
        arb[a].append(-b)

arbList = []

ans = 0
for day in range(M + 1) :
    for b in arb[day] :
        heapq.heappush(arbList, b)
    if arbList :
        ans += heapq.heappop(arbList)

print(-ans)

Measured memory_bytes: 66464
import sys
from collections import Counter

read = sys.stdin.read
readline = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 8)
INF = float('inf')
MOD = 10 ** 9 + 7


def main():
    N = int(input())
    S = list(input().split())
    L = len(Counter(S))
    if L == 3:
        print('Three')
    else:
        print('Four')


if __name__ == '__main__':
    main()


Measured memory_bytes: 9348
def main():
    num = int(input())
    data = [list(map(int, input().split())) for i in range(num)]

    ans = num
    for i in range(num):
        for j in range(num):
            if i == j:
                continue

            kyori = [data[i][0] - data[j][0], data[i][1] - data[j][1]]
            visit_list = [0 for i in range(num)]

            kari_num = 0

            for k in range(num):

                if visit_list[k]:
                    continue
                kari_num += 1
                visit_list[k] = 1
                flg = 1
                now_place = [data[k][0] + kyori[0], data[k][1] + kyori[1]]
                now_place_rev = [data[k][0] - kyori[0], data[k][1] - kyori[1]]

                while flg:
                    flg = 0
                    for l in range(num):
                        if visit_list[l]:
                            continue
                        if data[l] == now_place:
                            now_place = [now_place[0] + kyori[0], now_place[1] + kyori[1]]
                            visit_list[l] = 1
                            flg = 1
                        if data[l] == now_place_rev:
                            now_place_rev = [now_place_rev[0] - kyori[0], now_place_rev[1] - kyori[1]]
                            visit_list[l] = 1
                            flg = 1

            ans = min(ans, kari_num)




    print(ans)






if __name__ == '__main__':
    main()




Measured memory_bytes: 47068
N, M, X = map(int, input().split())

A = [[] for _ in range(N)]
C = [0] * N

for i in range(N):
  ca = list(map(int, input().split()))
  C[i], A[i] = ca[0], ca[1:]

ans = float("INF")
for bit in range(0, 1 << N):
  smart = [0] * M
  cost_sum = 0
  for i in range(N):
    if (bit >> i) % 2 == 0:
      continue
    cost_sum += C[i]
    for j in range(M):
      smart[j] += A[i][j]
  ok = True
  for j in range(M):
    if smart[j] < X:
      ok = False
  if ok:
    ans = min(ans, cost_sum)

if ans == float("INF"):
  ans = -1
print(ans)

Measured memory_bytes: 9276
////////////////////////////////////////////////////////////////////
// This source code is for Visual Studio
////////////////////////////////////////////////////////////////////
#include <iostream>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <map>
#include <set>
#include <algorithm>
#include <sstream>
#include <iterator>
#include <stack>
#include <functional>
#include <iomanip>
#include <string>
#include <cstring>
#include <deque>
#include <math.h>

#define	numberof(a)	(sizeof(a) / sizeof(a[0]))
#define	INF		UINT64_MAX
#define Rep(i,n) for(int i = 0; i < (n); ++i )

using namespace std;

typedef vector< vector<int> > MAT;
typedef pair<int, int> PINT;
typedef long long ll;
typedef uint32_t u32;
typedef uint64_t u64;
typedef int32_t s32;
typedef int64_t s64;

//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI  = acos(-1.0);

int main()
{
	ll N = 0;
	ll ret = INT32_MAX;
	ll sum = 0;
	ll sunuke = 0;
	ll kuma = 0;

	cin >> N;
	vector<ll> a(N);
	Rep(i, N) {
		cin >> a[i];
		sum += a[i];
	}

	for (ll i = 0; i < N - 1; ++i) {
		sunuke += a[i];
		kuma = sum - sunuke;
		ret = min(ret, abs(sunuke - kuma));
	}

	cout << ret << endl;

	return 0;
}





Measured memory_bytes: 1792
#include<stdio.h>
#include<stdlib.h>
#define nmax 10000
#define qmax 500

void linearSearch(int);

int T[qmax],q,count=0;
int judge[qmax];

int main()
{
  int n;
  int S[nmax],i;

  scanf("%d",&n);

  for( i = 0 ; i < n ; i++ )
    {
      scanf("%d",&S[i]);
    }

 scanf("%d",&q);

  for( i = 0 ; i < q ; i++ )
    {
      scanf("%d",&T[i]);
    }

  for( i = 0 ; i < n ; i++ )
    {
      linearSearch(S[i]);
    }
  printf("%d\n",count);

  return 0;
}


void linearSearch(int x)
{
  int i,j;
  int flag = 1;
  for(i = 0 ; i < q ; i++ )
    {
      if( T[i] == x )
	{
	for( j = 0 ; j < count ; j++ )
	  {
	    if( judge[j] == x )
	      flag = 0;
	  }
      if( flag == 1 )
	{
	judge[j] = x;
	count++;
	}
}

     }
}

Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;

//  誤差を考慮して足し算を行う
long long add(long long a, long long b)
{
    // if (abs(a + b) < EPS * (abs(a) + abs(b)))
    //     return 0;
    return a + b;
}

//  二次元ベクトル構造体
struct P
{
    long long x, y;
    P() {}
    P(long long x, long long y) : x(x), y(y)
    {
    }
    P operator+(P p)
    {
        return P(add(x, p.x), add(y, p.y));
    }
    P operator-(P p)
    {
        return P(add(x, -p.x), add(y, -p.y));
    }
    P operator*(long long d)
    {
        return P(x * d, y * d);
    }
    long long dot(P p)
    { //  内積
        return add(x * p.x, y * p.y);
    }
    long long det(P p)
    { //  外積
        return add(x * p.y, -y * p.x);
    }
};

//  辞書順で比較
bool cmp_x(const P &p, const P &q)
{
    if (p.x != q.x)
        return p.x < q.x;
    return p.y < q.y;
}

//  凸包を求める
vector<P> convex_hull(P *ps, int n)
{
    sort(ps, ps + n, cmp_x);
    int k = 0;           //  凸包の頂点数
    vector<P> qs(n * 2); //  構築中の凸包

    //  下側凸包の作成
    for (int i = 0; i < n; i++)
    {
        while (k > 1 && (qs[k - 1] - qs[k - 2]).det(ps[i] - qs[k - 1]) <= 0)
            k--;
        qs[k++] = ps[i];
    }
    //  上側凸包の作成
    for (int i = n - 2, t = k; i >= 0; i--)
    {
        while (k > t && (qs[k - 1] - qs[k - 2]).det(ps[i] - qs[k - 1]) <= 0)
            k--;
        qs[k++] = ps[i];
    }
    qs.resize(k - 1);
    return qs;
}

//  マンハッタン距離
long long dist(P p, P q)
{
    return abs(p.x - q.x) + abs(p.y - q.y);
}

void solve(long long N, std::vector<long long> x, std::vector<long long> y)
{
    P ps[N];
    for (int i = 0; i < N; i++)
    {
        ps[i] = P(x[i], y[i]);
    }

    vector<P> qs = convex_hull(ps, N);
    long long res = 0;
    for (int i = 0; i < qs.size(); i++)
    {
        for (int j = 0; j < i; j++)
        {
            res = max(res, dist(qs[i], qs[j]));
        }
    }

    cout << res << endl;
}

// Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
int main()
{
    long long N;
    scanf("%lld", &N);
    std::vector<long long> x(N);
    std::vector<long long> y(N);
    for (int i = 0; i < N; i++)
    {
        scanf("%lld", &x[i]);
        scanf("%lld", &y[i]);
    }
    solve(N, std::move(x), std::move(y));
    return 0;
}


Measured memory_bytes: 9724
import java.util.Scanner;

public class Main {

	private static final int k = 2019;
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int L = sc.nextInt();
      	int R = sc.nextInt();
      	
      	if (L == 0) {
      		System.out.println(0);
      		return ;
      	}
      	
      	if (R - L > 2018) {
      		System.out.println(0);
      		return;
      	}
      	
      	int res = Integer.MAX_VALUE;
      	L = L % k;
      	R = R % k;
      	
      	if (L > R) {
      		System.out.println(0);
      		return;
      	}
      	
        for (int i = L; i <= (R-1); i++) {
      		for (int j = i+1; j <= R; j++) {
      			int candidate = (i%k)*(j%k)%k;
      			res = Math.min(res, candidate);
      		}
        }
      	
      	
      	System.out.println(res);
		sc.close();
	}
}

Measured memory_bytes: 23124
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<algorithm>
using namespace std;
#define maxn 100000
int nums[maxn];
int n;
void print()
{
    for(int i=0;i<n;i++)
    {
        if(i!=n-1)
            cout<<nums[i]<<" ";
        else
            cout<<nums[i]<<endl;
    }
}
void insertionSort()
{
    print();
    for(int i=1;i<n;i++)
    {
        int key=nums[i];
        int j=i-1;
        while(nums[j]>key&&j>=0)
        {
            nums[j+1]=nums[j];
            j--;
        }
        nums[j+1]=key;
        print();
    }
}
int main()
{
    while(cin>>n)
    {
        int num;
        for(int i=0;i<n;i++)
            scanf("%d",&nums[i]);
        insertionSort();
    }
    return 0;
}

Measured memory_bytes: 3140
//in the name of god
//if you read this code please search about imam hussain
#include<bits/stdc++.h>

using namespace std;

typedef long long ll;

#define pb push_back
#define endl "\n";
#define migmig ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define read freopen("input.txt", "r", stdin);freopen("output.txt", "w", stdout);

const int maxn=1e5+5;
const int mod=1e9+7;
const int inf=1e9;
const int del=728729;

int main(){
	migmig;
	int a;
	cin>>a;
	for(int i=0;i<10;i++){
		for(int j=0;j<10;j++){
			ll cnt=i*j;
			if(cnt==a){
				cout<<"Yes";
				return 0;
			}
		}
	}
	cout<<"No";
	return 0;
}



Measured memory_bytes: 256
import java.util.*;
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int min = Integer.MAX_VALUE;
    for(int i = 0; i < n; i++){
      int count = 0;
      int num = sc.nextInt();
      while(num % 2 == 0){
        count++;
        num /= 2;
      }
      min = min < count ? min : count;
    }
    System.out.println(min);
  }
}

Measured memory_bytes: 23252
#include<bits/stdc++.h>
using namespace std;

bool Check(int X) {
    bool flg = true;
    for (int i = 2; i < X; i++) {
        if ((X % i) == 0) {
            flg = false;
            break;
        }
    }
    return flg;

}

int main(){
    int X;

     cin >> X;
    while (1) {
        if (Check(X)) {
            break;
        }
        X++;
    }

    cout << X;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
#define fi first
#define se second
#define pb push_back

const int N = 100005;
bool vis[N];

int main() {
  int k;
  scanf("%d", &k);
  priority_queue <pair <int, int> > pq;
  for (int i = 1; i < 10; i++) {
    pq.push({-i, i % k});
  }
  while (!pq.empty()) {
    int w = -pq.top().fi, rem = pq.top().se;
    pq.pop();
    if (rem == 0) return printf("%d", w), 0;
    if (vis[rem]) continue;
    vis[rem] = true;
    for (int i = 0; i < 10; i++) {
      pq.push({-w - i, (rem * 10 + i) % k});
    }
  }
  return 0;
}


Measured memory_bytes: 11668
#include<bits/stdc++.h>
using namespace std;

int main(){
    int x,y;
    cin>>x>>y;
    bool flag=false;
    for(int i=0; i<=x; i++){
        if((i*2)+((x-i)*4)==y){
            flag=true;
            break;
        }
    }
    if(flag)
        cout<<"Yes"<<endl;
    else
        cout<<"No"<<endl;

}


Measured memory_bytes: 3608
#include<iostream>
#include<iomanip>
#include<string>
#include<vector>
#include<algorithm>
#include<utility>
#include<tuple>
#include<map>
#include<queue>
#include<set>
#include<stack>
#include<numeric>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>

using namespace std;

using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;

#define BIL ((ll)1e9)
#define MOD ((ll)1e9+7)
#define INF (1LL<<60)           //1LL<<63でオーバーフロー
#define inf (1<<29)             //1<<29でオーバーフロー

int main(int argc,char* argv[]){
    cin.tie(0);
    ios::sync_with_stdio(0);
    cout << fixed << setprecision(20);

    int n;
    cin >> n;
    vector<int> a(n);
    map<int,int> list;
    for(auto &x:a){
        cin >> x;
        if(list.find(x)!=list.end())list.at(x)++;
        else list.insert(make_pair(x,1));
    }

    int maxval=0;
    for(int i=0;i<=100000;i++){
        int prev,nxt,now;
        if(list.find(i)==list.end())continue;
        else now=list.at(i);
        if(list.find(i-1)==list.end()){
            prev=0;
        }else{
            prev=list.at(i-1);
        }
        if(list.find(i+1)==list.end()){
            nxt=0;
        }else{
            nxt=list.at(i+1);
        }
        maxval=max(maxval,now+prev+nxt);
    }
    // for(auto it=list.begin();it!=list.end();it++){
    //     if(it==list.begin())continue;
    //     auto preit=it--,nxtit=it++;
    //     if(nxtit==list.end())break;
    //     if(it->first-preit->first!=1){
    //         if(nxtit->first-it->first!=1){
    //             maxval=max(maxval,it->second);
    //             continue;
    //         }else{
    //             maxval=max(maxval,it->second+nxtit->second);
    //             continue;
    //         }
    //     }else{
    //         if(nxtit->first-it->first!=1){
    //             maxval=max(maxval,it->second+preit->second);
    //             continue;
    //         }else{
    //             maxval=max(maxval,it->second+nxtit->second+preit->second);
    //             continue;
    //         }
    //     }
    // }

    cout << maxval << endl;

    return 0;
}


Measured memory_bytes: 6552
#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
  int n,m;cin>>n>>m;
  priority_queue<int> q;
  ll temp,ans=0;
  while(n--)
  {
    cin>>temp;q.push(temp);    
  }
  while(m--)
  {
    temp=q.top();q.pop();
    q.push(temp/2);
  }
  while(!q.empty())
  {
    ans+=q.top();
    q.pop();
  }
  cout<<ans;
  
  return 0;
}

Measured memory_bytes: 892
# AOJ 0532: Time Card
# Python3 2018.6.30 bal4u

for i in range(3):
	h1, m1, s1, h2, m2, s2 = map(int, input().split())
	t = (3600*h2 + 60*m2 + s2) - (3600*h1 + 60*m1 + s1)
	print(t//3600, (t%3600)//60, t%60)


Measured memory_bytes: 5596
/*
      author  : nishi5451
      created : 14.08.2020 19:51:57
*/

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


int main(){
    int n;
    cin >> n;
    for(int i=0; i<=100; i++){
        for(int j=0; j<=100; j++){
            if(7*i+4*j==n){
                cout << "Yes" << endl;
                return 0;
            }
        }
    }
    cout << "No" << endl;
    return 0;
}

Measured memory_bytes: 3648