akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;

#define _GLIBCXX_DEBUG
#define all(v) (v).begin(),(v).end()

using ll=long long;
using pii=pair<int, int>;
using vi=vector<int>;
using vii=vector<vector<int>>;

const ll LINF=1LL<<60;
const int INF=1<<29;
const int MOD=1e9+7;

template<typename T>
T chmin(T &a, T b){
    if(a > b){
        a=b;
        return true;
    }
    return false;
}

template<typename T>
T chmax(T &a, T b){
    if(a < b){
        a=b;
        return true;
    }
    return false;
}

int main(){
    int n; cin >> n;
    vector<pii> red(n), blue(n);
    for(int i=0; i<n; i++){
        cin >> red[i].first >> red[i].second;
    }
    for(int i=0; i<n; i++){
        cin >> blue[i].first >> blue[i].second;
    }

    sort(all(red));
    reverse(all(red));
    int ans=0;
    vector<bool> used(n, 0);
    for(int i=0; i<n; i++){
        int a, b;
        pii cur={INF, 0};
        tie(a, b)=red[i];
        for(int j=0; j<n; j++){
            if(used[j]) continue;
            int c, d;
            tie(c, d)=blue[j];
            if(a < c && b < d && cur.first > d){
                cur.first=d;
                cur.second=j;
            }
        }
        if(cur.first == INF) continue;
        ans++;
        used[cur.second]=true;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3628
import java.io.*;
public class Main{
  public static void main(String[] args){
    try{
        BufferedReader buf = new BufferedReader(new InputStreamReader(System.in));
        String str = buf.readLine();
        int sec = Integer.parseInt(str);
        int h = (int)sec/3600;
        int m = (int)(sec-(h*3600))/60;
        int s = sec%60;

        System.out.println( h + ":" + m + ":" + s );


    }
    catch(Exception e){
       
    }
  }
}


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

using namespace std;

const double EPS = 1e-8;
const double INF = 1e12;
const double PI = acos(-1);

using Point = complex<double>;
using Polygon = vector<Point>;

inline int sgn(const double &a) { return (a < -EPS ? -1 : (a > EPS ? 1 : 0)); }

inline bool eq(const Point &a, const Point &b) { return abs(a - b) < EPS; }

namespace std {
inline bool operator<(const Point &a, const Point &b) {
    if (sgn(a.real() - b.real()))
        return sgn(a.real() - b.real()) < 0;
    return sgn(a.imag() - b.imag()) < 0;
}
} // namespace std

double dot(const Point &a, const Point &b) { return real(conj(a) * b); }

double det(const Point &a, const Point &b) { return imag(conj(a) * b); }

struct Line {
    Point p1, p2;

    Line(Point p1 = Point(), Point p2 = Point()) : p1(p1), p2(p2) {}

    bool operator<(const Line &rhs) const {
        if (eq(p2, rhs.p2))
            return p1 < rhs.p1;
        return p2 < rhs.p2;
    }
    bool operator==(const Line &rhs) const {
        return (eq(p1, rhs.p1) && eq(p2, rhs.p2)) ||
               (eq(p1, rhs.p2) && eq(p2, rhs.p1));
    }
};

bool is_parallel(Line a, Line b) {
    if (sgn(det(a.p1 - a.p2, b.p1 - b.p2)))
        return false;
    return true;
}

bool is_orthogonal(Line a, Line b){
    if(sgn(dot(a.p1 - a.p2, b.p1 - b.p2)))
        return false;
    return true;
}

int main(){
    int q;
    cin >> q;
    for(int i=0;i<q;++i){
        double x0, y0, x1, y1, x2, y2, x3, y3;
        cin >> x0 >> y0 >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
        Point p0 = Point(x0, y0), p1 = Point(x1, y1), p2 = Point(x2, y2), p3 = Point(x3, y3);
        Line s1 = Line(p0, p1), s2 = Line(p2, p3);
        int ans = (is_parallel(s1, s2) ? 2 : is_orthogonal(s1, s2) ? 1 : 0);
        cout << ans << endl;
    }

    return 0;
}



Measured memory_bytes: 3220
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const long long INF = 1LL << 60;
const ll C = 1e9+7;

int main() {
    int N;
    cin >> N;
    vector<ll> MARCH(5, 0);

    for(int i=0; i<N; i++) {
        string s;
        cin >> s;
        if(s[0] == 'M') MARCH[0]++;
        else if(s[0] == 'A') MARCH[1]++;
        else if(s[0] == 'R') MARCH[2]++;
        else if(s[0] == 'C') MARCH[3]++;
        else if(s[0] == 'H') MARCH[4]++;
        else continue;
    }

    ll ans = 0;
    for(int i=0; i<5; i++) {
        for(int j=i+1; j<5; j++) {
            for(int k=j+1; k<5; k++) {
                ans += MARCH[i] * MARCH[j] * MARCH[k];
            }
        }
    }
    cout << ans << endl;
}

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

using namespace std;
typedef long long ll;

int main() {
  ll c[3][3], sum1 ,sum2, sum3;

  for(int i = 0; i < 3; i++){
    for(int j = 0; j < 3; j++){
      cin >> c[i][j];
    }
  }

  sum1 = c[0][0] + c[1][1] + c[2][2];
  sum2 = c[0][1] + c[1][2] + c[2][0];
  sum3 = c[0][2] + c[1][0] + c[2][1];

  if (sum1 == sum2 && sum2 == sum3) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define repr(i, n) for (int i = (n); i >= 0; --i)
#define FOR(i, m, n) for (int i = (m); i < (n); ++i)
#define FORR(i, m, n) for (int i = (m); i >= (n); --i)
#define equals(a, b) (fabs((a) - (b)) < EPS)
using namespace std;
typedef long long ll;
const ll mod = 1000000007;
const ll mod2 = 998244353;
const ll INF = 1e18;
const long double EPS = 1e-10;

int main() {
  int n, k;
  cin >> n >> k;

  int res = 1;
  rep(i, n) res += min(res, k);
  cout << res << endl;


  
  return 0;
}

Measured memory_bytes: 256
#include<map>
#include<set>
#include<list>
#include<cmath>
#include<queue>
#include<stack>
#include<cstdio>
#include<string>
#include<vector>
#include<complex>
#include<cstdlib>
#include<cstring>
#include<climits>
#include<numeric>
#include<sstream>
#include<iostream>
#include<algorithm>
#include<functional>
#include<cctype>

#define mp make_pair
#define pb push_back
#define REP(i,a,n) for(int i = a;i < (n);i++)
#define rep(i,n) for(int i = 0;i < (n);i++)
#define all(s) s.begin(), s.end()
#define rall(s) s.rbegin(), s.rend()
#define range(x,min,max) ((min) <= (x) && (x) <= (max))

using namespace std;

typedef long long LL;
typedef vector<int> VI;
typedef vector<vector<int> > VII;
typedef vector<string> VS;
typedef vector<bool> VB;
typedef pair<int,int> PII;

const int DX[]={1,0,-1,0},DY[]={0,-1,0,1};

vector<bool> isPrimes(int n) {
	vector<bool> res(n, true);
	res[0] = res[1] = false;
	for (int i = 2;i < sqrt(n);i++) {
		if (res[i]) {
			for (int j = 0;i * (j + 2) < n;j++) {
				res[i * (j + 2)] = false;
			}
		}
	}
	return res;
}

vector<int> primes(int n) {
	vector<bool> is_primes = isPrimes(n);
	vector<int> res;
	for (int i = 2;i < n;i++) {
		if (is_primes[i]) {
			res.push_back(i);
		}
	}
	return res;
}

int main(){
	cin.tie(0);
   	ios::sync_with_stdio(false);
	int n;
	VB ps = isPrimes(123456 * 2);
	while(1) {
		cin >> n;
		if (n == 0) break;
		int ans = [&] {
			int res = 0;
			REP (i, n + 1, (2 * n + 1)) {
				if (ps[i]) res++;
			}
			return res;
		}();
		cout << ans << endl;
	}
	return 0;
}

Measured memory_bytes: 3260
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace reviewOfCsharp
{
    class Program
    {
        static void Main(string[] args)
        {
            int a = int.Parse(Console.ReadLine());
            int ans = a / 2 + a % 2;
            Console.WriteLine(ans);
        }
    }
}

Measured memory_bytes: 11092
#2019-04-09 2100 start

N,M,C= map(int, input().split())
B = input().split()
sumN = 0
count = 0

for i in range(N):
    A = input().split()
    for j in range(M):
        sumN = sumN + int(A[j])* int(B[j])
    if sumN + C > 0:
        count = count + 1
    sumN = 0


print(count)







Measured memory_bytes: 38384
from sys import stdin,stdout
from collections import defaultdict
d,nbr = defaultdict(list),defaultdict(list)

def topological(inDeg,n,d):
    q,topOrder = [],[]
    vis = [ False for i in range(n+1)]
    for i in range(1,n+1):
        if inDeg[i]==0:
            q.append(i)
            vis[i] = True
    while len(q)>0:
        top = q.pop(0)
        topOrder.append(top)
        for x in d[top]:
            inDeg[x]-=1
            if inDeg[x]==0:
                q.append(x)
                vis[x]=True
    return topOrder


n, m = map(int,stdin.readline().split())
E = []
inDeg = [ 0 for i in range(n+1)]
for i in range(m):
    x,y = map(int,stdin.readline().split())
    E.append([x,y])
    inDeg[y]+=1
    d[x].append(y)

order = topological(inDeg,n,d)
for k,v in zip(d.keys(),d.values()):
    for x in v:
        nbr[x].append(k)
# for k,v in zip(nbr.keys(),nbr.values()):
#     print(k,v)
dp = [ 0 for i in range(n+1) ]
for x in order:
    if len(nbr[x])>0:
        for near in nbr[x]:
            dp[x] = max(dp[x],dp[near]+1)

print(max(dp))


Measured memory_bytes: 61500
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
#include <queue>
using namespace std;
typedef long long int ll;

int main(){
	cin.tie(nullptr);
	ios::sync_with_stdio(false);
	int n; cin >> n;
	vector<int> a(n);
	int ans=0;
	int mi=1e9+1;
	for(int i=0;i<n;i++){
		cin >> a[i];
		if(mi>a[i]){
			mi=a[i];
			ans=i;
		}
	}
	cout << ans+1 << endl;
}


Measured memory_bytes: 3280
#include <stdio.h>

using namespace std;

int main(){
	int W,H,x,y,r;
	scanf("%d %d %d %d %d",&W,&H,&x,&y,&r);
	if((x >= r && x <= W-r) && (y >= r && y <= H-r))
		printf("Yes\n");
	else{
		printf("No\n");
	}
}



Measured memory_bytes: 2700
/// Code By t_bone_289 (Tushar Singh)
/// An Immature Programmer.... I'm still developing !!
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/trie_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define pll pair<ll,ll>
#define fi first
#define se second
#define mp make_pair
#define pb emplace_back
#define endl '\n'
#define M 1000000007
#define error(x) cout << #x << " = " << x << endl;
#define pi 3.14159265358979323846
typedef long long ll;
typedef long double ld;
template <typename T>
void ContainerError(T &v){cout<<"{";for(auto &x:v){cout<<x<<',';}cout<<"}"<<endl;return;}
typedef tree<ll,null_type,less<ll>,rb_tree_tag,tree_order_statistics_node_update> ordered_set;
ll powmod(ll base,ll exp,ll MOD){ll res=1;while(exp>0){if(exp%2==1) res=(res*base)%MOD;base=(base*base)%MOD;exp/=2;}return (res%MOD);}
ll mpow(ll base,ll exp){ll res=1;while(exp>0){if(exp%2==1) res=(res*base);base=(base*base);exp/=2;}return (res);}
ll gcd(ll a, ll b){return b?gcd(b,a%b):a;}
int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    ll n,k;
    cin>>n>>k;
    vector<ll> A(n);
    vector<ll> F(n);
    for(auto &x:A)
    {
        cin>>x;
    }
    for(auto &x:F)
    {
        cin>>x;
    }
    sort(A.begin(),A.end());
    sort(F.begin(),F.end(),greater<ll>());
    ll be = 0;
    ll en = A[n-1]*F[0];
    ll ans = en;
    while(be<=en)
    {
        ll mid = (be+en)/2;
        ll cc = 0;
        for(ll i=0;i<n;i++)
        {
            ll temp = (mid/F[i]);
            temp = A[i]-temp;
            if(temp>0)
            {
                cc += temp;
            }
        }
        if(cc<=k)
        {
            ans = mid;
            en = mid-1;
        }
        else
        {
            be = mid+1;
        }
    }
    cout<<ans;
    return 0;
}































Measured memory_bytes: 3328
#include <stdio.h>

using namespace std;

int main(){
  int n,x;
  scanf("%d",&n);
  
  for(int i = 1; i<= n; i++)
    {
      if(i%3 == 0){
	printf(" %d",i);
      }else{
	x = i;
	do{
	  if(x%10 == 3){
	    printf(" %d",i);
	    break;
	  }
	  x /=10;
	}while(x);
      }
    }
  printf("\n");
}




Measured memory_bytes: 2768
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <functional>
using namespace std;

int main() {
	string S, T; cin >> S >> T;
	sort(S.begin(), S.end());
	sort(T.begin(), T.end());
	reverse(T.begin(), T.end());
	if (S < T)cout << "Yes" << endl;
	else cout << "No" << endl;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef int64_t ll;
int ans[2000];

int main() {
  int n,x,y,a,b,c,d;
  cin >> n >> x >> y;
  for(int i=1;i<n;i++){
    for(int j=i+1;j<=n;j++){
      a = j-i;
      b = abs(x-i)+1+abs(j-y);
      c = abs(y-i)+1+abs(j-x);
      d = min(a,min(b,c));
      ans[d]++;
    }
  }
  for(int i=1;i<n;i++) cout << ans[i] << endl;
}


Measured memory_bytes: 256
#include<stdio.h>
#include<stdlib.h>

int compare_int(const void *a,const void *b){
	return *(long long*)a-*(long long*)b;
}

long long ru2(int n){
	int i;
	long long r=1;
	for(i=0;i<n;i++)r=r*2;
	return r;
}

struct num{
	long long a;
	int no;
};

int main(){
	int i,j,k,n,ans=0,c=0;
	long long a[200000],r2[41];
	for(i=0;i<=40;i++)r2[i]=ru2(i);
	scanf("%d",&n);
	for(i=0;i<n;i++)scanf("%lld",&a[i]);
	qsort(a,n,sizeof(long long),compare_int);
	struct num at[200000];
	at[0].a=a[0];
	at[0].no=1;
	for(i=1;i<n;i++){
		if(at[c].a!=a[i]){
			at[++c].a=a[i];
			at[c].no=1;
		}else at[c].no++;
	}
	//printf("%d\n\n",c);
	//for(i=0;i<n;i++)printf("%d",a[i]);
	//for(i=0;i<=c;i++)printf("%d\n",at[i].no);
	for(i=c;i>=0;i--){
		for(j=0;j<=40;j++){
			if(at[i].a<r2[j]&&r2[j]<=2*at[i].a){
				int lb=-1,ub=c;
				while(ub-lb>1){
					int mid=(ub+lb)/2;
					if(at[mid].a>=(r2[j]-at[i].a))ub=mid;
					else lb=mid;
				}
				if(at[i].a+at[ub].a==r2[j]){
					if((i!=ub&&at[i].no>0&&at[ub].no>0)){
						int tmp=(at[i].no<at[ub].no?at[i].no:at[ub].no);
						at[i].no-=tmp;
						at[ub].no-=tmp;
						ans+=tmp;
					}else if((i==ub&&at[i].no>1)){
						int tmp=at[i].no/2;
						at[i].no=at[i].no%2;
						ans+=tmp;
					}
				}
			}
		}
	}
	//for(i=0;i<=c;i++)printf("%d\n",at[i].no);
	printf("%d\n",ans);
	return 0;
}


Measured memory_bytes: 4988
#include<iostream>
#include<string>
#include<algorithm>
#include<map>
#include<set>
#include<utility>
#include<vector>
#include<cmath>
#include<cstring>
#include<cstdio>
#include<time.h>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define rp(a) while(a--)
#define pb push_back
#define mp make_pair
#define all(in) in.begin(),in.end()
const double PI=acos(-1);
const double EPS=1e-10;
using namespace std;
typedef long long ll;
typedef vector<int> vi;
int main(){
	int a,b;
	int q=false;
	while(cin>>a>>b,a||b){
		if(q)cout<<endl;
		q=true;
		bool h=false;
		loop(i,a,b+1)if(i%400==0||(i%100&&i%4==0)){
			h=true;
			cout<<i<<endl;
		}
		if(!h)cout<<"NA"<<endl;
	}
}

Measured memory_bytes: 1160
#include <stdio.h>

#define ABUNDANT "abundant number"
#define PERFECT "perfect number"
#define DEFICIENT "deficient number"

typedef unsigned long long ull;

ull x;

int solve(void){
	ull divisor = 2;
	ull ans = 1;
	ull sum = x;
	ull append;
	while(sum != 1){
		append = divisor;
		while(!(sum % divisor)){
			append *= divisor;
			sum /= divisor;
		}
		append--;
		append /= (divisor - 1);
		ans *= append;
		if(sum != 1 && divisor * divisor > sum){
			ans *= (sum + 1);
			sum = 1;
		}
		divisor++;
		abun:
		if(ans > x * 2){
			return puts(ABUNDANT);
		}
	}
	if (ans == x * 2){
		return puts(PERFECT);
	} else {
		return puts(DEFICIENT);
	}
}

ull in(){
	scanf("%llu", &x);
	return x;
}

int main(void){
	while(in()){
		solve();
	}
	return 0;
}

Measured memory_bytes: 588
cnt = 1
while gets
    n = $_.to_i
    break if n==0
    puts "Case #{cnt}:"
    arr = Array.new(n) { Array.new(n) }
    a = 1
    n.times do |i|
        if i % 2 == 0
            for j in 0..i
                arr[i-j][j] = a
                a += 1
            end
        else
            for j in 0..i
                arr[j][i-j] = a
                a += 1
            end
        end
    end
    a = n*n
    (n-1).times do |i|
        if i % 2 == 0
            for j in 0..i
                arr[n-i+j-1][n-j-1] = a
                a -= 1
            end
        else
            for j in 0..i
                arr[n-j-1][n-i+j-1] = a
                a -= 1
            end
        end
    end
    n.times do |i|
        puts arr[i].map{|j| "%3d".%(j)}.join("")
    end
    cnt += 1
end

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

long long gcd(long long a, long long b)
{
    return (b == 0 ? a : gcd(b, a % b));
}

long long lcm(long long a, long long b)
{
    return a * b / gcd(a, b);
}
int main()
{
    long long a, b;
    cin >> a >> b;
    cout << lcm(a, b) << endl;
    return 0;
}

Measured memory_bytes: 256
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
import numpy as np


def main(n, x, a):
  cnt = 0
  for j, i in enumerate(a):
    x -= i
    if x < 0:
      break
    elif j == n-1 and x > 0:
      break
    cnt += 1
  return cnt

n, x = map(int, readline().split())
a = np.sort(np.array(readline().split(), np.int64))
print(main(n, x, a))


Measured memory_bytes: 26992
#Frog2
n,k=map(int,input().split())
h=list(map(int,input().split()))
h.insert(0,0)
dp={1.0:0}
for val3 in range(2,n+1):
    dp[val3]=float(1e9)
for val in range(2,n+1):
    for val2 in range(1,min(val,k+1)):
        dp[val]=min(dp[val],dp[val-val2]+abs(h[int(val)]-h[int(val-val2)]))
print(dp[n])
        

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

int main(){
    int n,a;
 	//sum = 0;
	cin >> n;
  	int b[n];
  	for(int i = 0; i < n ; i++) b[i] = 0;
    for (int i = 1; i < n ; i++) {
    	cin >> a;
      	b[a-1] += 1;     
    }
  	for(int i=0;i<n;i++) {
    	cout << b[i] << endl; 
    }
    return 0;
}

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

int main() {
    int N, a[109];
    cin >> N;
    for (int i = 1; i <= N; i++) {
        cin >> a[i];
    }
    sort(a + 1, a + N + 1, greater<int>());
    int ap = 0, bp = 0;
    for (int i = 1; i <= N; i++) {
        if (i % 2 == 1) {
            ap += a[i];
        } else {
            bp += a[i];
        }
    }
    cout << ap - bp << endl;
    return 0;
}

Measured memory_bytes: 256
/**
SXR0aXAkI0JwbXptI3FhI3Z3I293bCNqY2IjUG0jMCNicG0jVHFkcXZvLyNCcG0jQW10bjBhY2phcWFicXZvLyNNYm16dml0MSNWdyNhdGN1am16I2tpdiNhbXF9bSNQcXUjVnd6I0F0bW14MSNQcWEjaXptI2l0dCNicHF2b2EjUXYjYnBtI3BtaWRtdmEjaXZsI3d2I21pemJwMSNFcHcjcWEjYnBtem0ja2l2I3F2Ym16a21sbSNRdiNQcWEjeHptYW12a20jbXtrbXhiI0lhI3BtI3htenVxYmJtYnBHI1BtI3N2d2VtYnAjRXBpYiMraXh4bWl6bWJwI2J3I1BxYSNrem1pYmN6bWEjSWEsI0ptbnd6bSN3eiNJbmJteiN3eiNKbXBxdmwjYnBtdTEjVnd6I2FwaXR0I2JwbXwja3d1eGlhYSNJY29wYiN3biNwcWEjc3Z3ZXRtbG9tI017a214YiNpYSNQbSNlcXR0bWJwMSNQcWEjYnB6d3ZtI2x3YnAjbXtibXZsI1dkbXojYnBtI3BtaWRtdmEjSXZsI3d2I21pemJwLyNpdmwjUG0jbm1tdG1icCNWdyNuaWJxb2NtI3F2I29jaXpscXZvI0l2bCN4em1hbXpkcXZvI2JwbXUvI053eiNQbSNxYSNicG0jVXdhYiNQcW9wMSNCcG0jQWN4em11bSMrcXYjb3R3enwsMQ==
*/
#include <cstring>
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <queue>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <cassert>

#define F first
#define S second
#define endl '\n'
#define deb(x) cout<<#x<<' '<<x<<endl;
#define pb push_back

/*
#ifdef IZI_KATKA
#define int __int64_t
#else
#define int __int64
#endif
*/

const long long MOD = 1e9 + 7;
const long long MAXN = 1e6 + 1;
using namespace std;

typedef long long ll;

long long readInt() {
    bool minus1 = false;
    long long result = 0;
    char ch;
    ch = getchar();
    while (true) {
        if (ch == '-') break;
        if (ch >= '0' && ch <= '9') break;
        ch = getchar();
    }
    if (ch == '-') minus1 = true; else result = ch-'0';
    while (true) {
        ch = getchar();
        if (ch < '0' || ch > '9') break;
        result = result*10 + (ch - '0');
    }
    if (minus1)
        return -result;
    else
        return result;
}


ll a[MAXN];

int main() {
	#ifdef IZI_KATKA
	assert(freopen("input", "r", stdin));
    assert(freopen("output", "w", stdout));
    #endif
    int n = readInt();
    for (int i = 1; i <= 3 * n; i++) {
    	a[i] = readInt();
    }
    vector <int> v;
    ll sum = 0;

    sort(a + 1, a + 1 + 3 * n);
    int kek = n;
	for (int i = 3 * n - 1; kek >= 1; i -= 2, kek --) {
		sum += a[i];
	}
	cout << sum;
    return 0;
}

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

void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}

template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define deb(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define deb(x...)
#endif
typedef long long int ll;
 
typedef pair<int, int> pii;
typedef pair<ll,ll> pll;
 
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<pii> vpii;
typedef vector<pll> vpll;

typedef map<int,int> mii;

#define  ff          first
#define  ss          second
#define  pb          push_back
#define  IOS         ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define  lb          lower_bound
#define  ub          upper_bound
#define  all(x)      (x).begin(), (x).end()
#define  lcm(x, y)   ((x) * (y) / __gcd(x, y))
#define  ps(x,y)     fixed<<setprecision(y)<<x
#define  setbit(x)   __builtin_popcountll(x)
#define  rep(i,a,b)  for(int i=a ; i<b ; ++i)
#define  repr(i,a,b) for(int i=a ; i>=b ; --i)

const ll MOD = 1e9 + 7;
const ll INF = (2e18);
const ll MAX_N = 2e5 + 2;


void solve(){
    int n; 
    ll a,b;
    
    vpll v = {{-INF,INF},{-INF,INF},{-INF,INF}};
    
    cin >> n;
    for(int i=0;i<n;i++){
        cin >> a >> b;
        v[2].ff = max(v[2].ff , b-a);
        v[2].ss = min(v[2].ss , b-a);        
        v[1].ff = max(v[1].ff , a-b);
        v[1].ss = min(v[1].ss , a-b);
        v[0].ff = max(v[0].ff , a+b);
        v[0].ss = min(v[0].ss , a+b);
    }
    
    ll mx = max({abs(v[0].ff-v[0].ss) , abs(v[1].ff-v[1].ss) , abs(v[2].ff-v[2].ss)});  
      
    cout << max(mx,0LL);
}

int main(){
    IOS;
    solve();
}

Measured memory_bytes: 3632
#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>;

int main() {
  int n, m, k;
  cin >> n >> m >> k;
  vector<int> a(n);
  vector<int> b(m);
  rep(i,n) cin >> a[i];
  rep(i,m) cin >> b[i];
  ll t = 0;
  rep(i,m) t += b[i];
  int j = m;
  int ans = 0;
  rep(i,n+1) {
    while (j > 0 && t > k) {
      --j;
      t -= b[j];
    }
    if (t > k) break;
    ans = max(ans, i+j);
    if (i == n) break;
    t += a[i];
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 4756
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#ifdef tabr
#include "library/debug.cpp"
#else
#define debug(...)
#endif

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n, k;
    cin >> n >> k;
    vector<vector<int>> g(n);
    int mn = k / 2;
    vector<int> a(n - 1), b(n - 1);
    for (int i = 0; i < n - 1; i++) {
        int x, y;
        cin >> x >> y;
        x--, y--;
        a[i] = x;
        b[i] = y;
        g[x].emplace_back(y);
        g[y].emplace_back(x);
    }
    if (k == 1) {
        cout << n - 2 << '\n';
        return 0;
    }
    int ans = n;
    vector<int> depth;
    function<void(int, int)> dfs = [&](int v, int p) {
        for (int to : g[v]) {
            if (to == p) {
                continue;
            }
            if (depth[to] <= depth[v] + 1) {
                continue;
            }
            depth[to] = depth[v] + 1;
            dfs(to, v);
        }
    };
    if (k % 2 == 0) {
        for (int i = 0; i < n; i++) {
            depth = vector<int>(n, 1e9);
            depth[i] = 0;
            dfs(i, -1);
            int cnt = 0;
            for (int j = 0; j < n; j++) {
                if (depth[j] <= mn) {
                    cnt++;
                }
            }
            ans = min(ans, n - cnt);
        }
    } else {
        for (int i = 0; i < n - 1; i++) {
            depth = vector<int>(n, 1e9);
            depth[a[i]] = 0;
            depth[b[i]] = 0;
            dfs(a[i], b[i]);
            dfs(b[i], a[i]);
            int cnt = 0;
            for (int j = 0; j < n; j++) {
                if (depth[j] <= mn) {
                    cnt++;
                }
            }
            ans = min(ans, n - cnt);
        }
    }
    cout << ans << '\n';
    return 0;
}

Measured memory_bytes: 512
#include <iostream>
#include <algorithm>
#include <iomanip>
#include <vector>
#include <queue>
#include <set>
#include <map>

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

int N;
const int INF = 1000;
int ans[505][505];
bool used[505][505];
int dx[4] = {-1, 1, 0, 0};
int dy[4] = {0, 0, -1, 1};
bool in_field(int h, int w){
    return h >= 0 && h < N && w >= 0 && w < N;
}
int p[250005];

int to_h(int idx){
    return idx/N;
}

int to_w(int idx){
    return idx%N;
}

int calc_max(int h, int w){
    int ret = INF;
    for(int i = 0; i < 4; i++){
        if(in_field(h+dx[i], w+dy[i])){
            ret = min(ret, ans[h+dx[i]][w+dy[i]]);
        }else{
            ret = 0;
        }
    }
    if(used[h][w]) ret++;
    return ret;
}

void dfs(int h, int w){
    ans[h][w] = calc_max(h, w);
    for(int i = 0; i < 4; i++){
        if(in_field(h+dx[i], w+dy[i])){
            if(calc_max(h+dx[i], w+dy[i]) < ans[h+dx[i]][w+dy[i]]) dfs(h+dx[i], w+dy[i]);
        }
    }
}

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout << setprecision(10) << fixed;
    cin >> N;
    for(int i = 0; i < N*N; i++) {
        int s;
        cin >> s;
        s--;
        p[i] = s;
    }
    ll ret = 0;
    for(int i = 0; i < N; i++){
        for(int j = 0; j < N; j++){
            used[i][j] = true;
            ans[i][j] = min({i, j, (N-i-1), (N-j-1)})+1;
        }
    }
    
    for(int i = 0; i < N*N; i++){
        int idx = p[i];
        int h = to_h(idx);
        int w = to_w(idx);
        ret += ans[h][w];
        used[h][w] = false;
        dfs(h, w);
        // for(int j = 0; j < N; j++){
        //     for(int k = 0; k < N; k++){
        //         cout << ans[j][k] << ' ';
        //     }
        //     cout << endl;
        // }
        // cout << endl;
    }
    
    cout << ret-N*N << endl;
}

Measured memory_bytes: 21052
/*
[ ( ^ _ ^ ) ]
*/

import java.io.*;
import java.util.*;


public class Main {
    int INF = (int)1e9;
    long MOD = 1000000007;

    long abs(long x) {
        return Math.abs(x);
    }

    int max(int ... x) {
        int rs = x[0];
        for(int y: x) rs = Math.max(rs, y);
        return rs;
    }


    void solve(InputReader in, PrintWriter out) throws IOException {
        char[] s = in.next().trim().toCharArray();
        char[] t = in.next().trim().toCharArray();
        int n = s.length;
        int m = t.length;

        int[][] dp = new int[n+1][m+1];
        for(int i=1; i<=n; i++) {
            for(int j=1; j<=m; j++) {
                dp[i][j] = max(dp[i-1][j], dp[i][j-1]);
                if(s[i-1]==t[j-1]) {
                    dp[i][j] = max(dp[i][j], dp[i-1][j-1]+1);
                }
            }
        }
        char[] a = new char[n+m+10];
        int p = 0;
        int i = n, j = m;
        while(i>0 && j>0) {
            if(s[i-1]==t[j-1] && dp[i][j]==dp[i-1][j-1]+1) {
                a[p++] = s[i-1];
                i--;
                j--;
            } else {
                if(dp[i][j]==dp[i-1][j]) i--;
                else j--;
            }
        }
        for(i=p-1; i>=0; i--) {
            out.print(a[i]);
        }
        out.println();
    }
    

    public static void main(String[] args) throws IOException {
        if(args.length>0 && args[0].equalsIgnoreCase("d")) {
            DEBUG_FLAG = true;
        }
        InputReader in = new InputReader();
        PrintWriter out = new PrintWriter(System.out);
        int t = 1;//in.nextInt();
        long start = System.nanoTime();
        while(t-- >0) {
            new Main().solve(in, out);
        }
        long end = System.nanoTime();
        debug("\nTime: " + (end-start)/1e6 + " \n\n");
        out.close();
    }
    
    static boolean DEBUG_FLAG = false;
    static void debug(String s) {
        if(DEBUG_FLAG) System.out.print(s);
    }
    
    public static void show(Object... o) {
        System.out.println(Arrays.deepToString(o));
    }
    
    static class InputReader {
        static BufferedReader br;
        static StringTokenizer st;
    
        public InputReader() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }
        
        String next() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }
        
        int nextInt() {
            return Integer.parseInt(next());
        }
        
        long nextLong() {
            return Long.parseLong(next());
        }
        
        double nextDouble() {
            return Double.parseDouble(next());
        }
    }
}

Measured memory_bytes: 163288
#include <bits/stdc++.h>
using namespace std;
const int di[] = {+1,-1, 0, 0};
const int dj[] = { 0, 0,+1,-1};
int main() {
	int H, W;
	cin >> H >> W;
	vector<string> S(H);
	for (auto& x : S) cin >> x;

	vector<string> ptn = {
		"6314",
		"2 2 ",
		"1364",
		"5 5 ",
	};

	vector<vector<bool>> a(H, vector<bool>(W));
	for (int i = 0; i < H; ++ i) for (int j = 0; j < W; ++ j) a[i][j] = S[i][j] == ptn[i%4][j%4];

	queue<pair<int,int>> q;
	q.push({0,0});
	while (!q.empty()) {
		int i = q.front().first;
		int j = q.front().second;
		q.pop();
		if (i == H-1 && j == W-1) {
			cout << "YES" << endl;
			return 0;
		}
		for (int k = 0; k < 4; ++ k) {
			int ii = i + di[k];
			int jj = j + dj[k];
			if (0 <= ii && ii < H && 0 <= jj && jj < W && a[ii][jj]) {
				a[ii][jj] = false;
				q.push({ii,jj});
			}
		}
	}
	cout << "NO" << endl;
}



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

using namespace std;

const int INF = numeric_limits<int>::max();
const int MAXN = 1e6 + 100;
const int MOD = 1e9 + 7;
const double eps = 1e-6;
const double PI = acos(-1);
mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());

signed main() {
#if(DEBUG_LEVEL > 0)
    freopen("../input.txt", "r", stdin);
    freopen("../out.txt", "w", stdout);
#endif
    string s;
    cin >> s;
    for (int i = 0; i < s.size(); ++i) {
        if((i + 1) % 2 == 1 && s[i] == 'L') {
            cout << "No";
            return 0;
        }
        if((i + 1) % 2 == 0 && s[i] == 'R') {
            cout << "No";
            return 0;
        }
    }
    cout << "Yes";
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define be(v) (v).begin(),(v).end()
#define pb(q) push_back(q)
typedef long long ll;
using namespace std;
const ll mod=1000000007;

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll a,b,c,k;
    cin>>a>>b>>c>>k;
    ll ma=max(a,max(b,c));
    ll sum=a+b+c;
    ll ans=sum-ma;
    ma*=pow(2,k);
    cout << ans+ma<<endl;
    return 0;
}


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

#define REP(i,n) for(int i = 0; i < (n); ++i)
#define REP1(i,n) for(int i = 1; i <= (n); ++i)
#define RREP(i, n) for(int i = (n) - 1; i >= 0; --i)
#define ALL(a) begin(a), end(a)
#define MP(a,b) make_pair((a), (b))
#define ROUNDUP(a,b) ((a) / (b) + ((a) % (b) == 0 ? 0 : 1))
#define X first
#define Y second
#define DEBUG(a) cout << #a << ": " << a << "\n"
// #define DEBUG(a) {}

using namespace std;
using ll = long long;
using vi = vector<int>;
using pii = pair<int, int>;

constexpr int MOD = 1e9 + 7;
constexpr int INF = 1e9 + 1;
constexpr ll LLINF = 4 * 1e18 + 1;
// constexpr int INF = 2147483647; // 2 * 1e9
// constexpr ll LLINF = 9223372036854775807; // 9 * 1e18

int dx[] = {1, 0, -1, 0, 1, -1, -1, 1, 0};
int dy[] = {0, 1, 0, -1, 1, 1, -1, -1, 0};

template<typename T>
T debug(T x) {
	DEBUG(x);
	return x;
}

int main(){
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	int n;
	cin >> n;
	vi a(n);
	REP(i, n) cin >> a[i];
	vector<ll> b(n + 1);
	REP1(i, n)b[i] = a[i - 1] + b[i - 1];
	sort(ALL(b));
	ll sum = b[0];
	ll ans = 0;
	while(true){
		int l = int(lower_bound(ALL(b), sum) - b.begin());
		int r = int(upper_bound(ALL(b), sum) - b.begin());
		int p = r - l;
		ans += (ll)p * (p - 1) / 2;
		if(r == n + 1) break;
		else {
			sum = b[r];
		}
	}
	cout << ans << "\n";
	return 0;
}


Measured memory_bytes: 2560
package main

import (
	"bufio"
	"errors"
	"fmt"
	"os"
	"strconv"
	"strings"
)

const Max int = 1000

var stack = make([]int, Max)
var top int = 0

func StdInSlice() []string {
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Scan()
	stringInput := scanner.Text()
	return strings.Split(stringInput, " ")
}

func main() {
	in := StdInSlice()
	for _, v := range in {
		i, e := strconv.Atoi(v)
		if e == nil {
			Push(i)
		} else {
			v1, _ := Pop()
			v2, _ := Pop()
			if v == "*" {
				Push(v1 * v2)
			}
			if v == "+" {
				Push(v1 + v2)
			}
			if v == "-" {
				Push(v2 - v1)
			}
		}
	}
	r, _ := Pop()
	fmt.Println(r)
}

func Initialize() {
	top = 0
}

func IsEmpty() bool {
	return top == 0
}

func IsFull() bool {
	return top == Max
}

func Push(x int) (int, error) {
	if IsFull() {
		return 0, errors.New("Stack overflow")
	}
	top++
	stack[top] = x
	return x, nil
}

func Pop() (int, error) {
	if IsEmpty() {
		return 0, errors.New("Stack empty")
	}
	top--
	return stack[top+1], nil
}



Measured memory_bytes: 1104
import java.util.*;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        char[] charArr = sc.next().toCharArray();

        for (int i = 0; i < charArr.length; i++) {
            if ((i + 1) % 2 != 0) System.out.print(charArr[i]);
        }
    }
}


Measured memory_bytes: 31424
input=gets.chomp.split("")
l=input.length

ll=l/2

loop{
    input=input[0..-3]
   ss=(input.length)/2
    
    if input[0...ss]==input[ss..-1]
        
        break
        
    end
   
    
    
    
    
    
}


p input.length

Measured memory_bytes: 1916
#include<bits/stdc++.h>
using namespace std;
const int ALPHABET_SIZE = 26;
set<int> pos[ALPHABET_SIZE];
string s;
int n;
int main(int argc, char const *argv[])
{
	cin >> n;
	cin >> s;
	n = s.length();
	for (int i = 0; i < n; ++i)
	{
		pos[s[i] - 'a'].insert(i);
	}
	int q;
	cin >> q;
	while (q --)
	{
		int t;
		cin >> t;
		if (t == 1)
		{
			int l;
			char ch;
			cin >> l >> ch;
			l --;
			pos[s[l] - 'a'].erase(l);
			s[l] = ch;
			pos[s[l] - 'a'].insert(l);
		}
		else
		{
			int l, r, ans = 0;
			cin >> l >> r;
			l --;
			r --;
			for (int i = 0; i < 26; ++i)
			{
				auto it = pos[i].lower_bound(l);
				if (it == pos[i].end() || *it > r)
					continue;
				else
					ans ++;
			}
			cout << ans << '\n';
		}
	}
	return 0;
}

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

int main() {

  int N;
  cin >> N;

  vector<int> W(N);
  int sum = 0;
  for (int i = 0; i < N; i++) {
    cin >> W[i];
    sum += W[i];
  }

  int answer = 1000000;
  int current = 0;
  for (int i = 0; i < N - 1; i++) {
    current += W[i];
    answer = min(answer, abs((sum - current) - current));
  }

  cout << answer << endl;

}

Measured memory_bytes: 256
#include <cstring>
#include <cstdio>
#include <algorithm>
#include <iostream>
#include <vector>
#include <map>
#include <unordered_map>
#include <cmath>
#include <queue>
#include <set>
#include <stack>

using namespace std;
typedef long long ll;
typedef pair<int, int> P;
#define i_inf int(1e9)
#define i_half_inf int(1e5)
#define ll_inf ll(1e9)*ll(1e9)
#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)
#define repr(i, n) for(ll i = n - 1; i >= 0; i--)
#define repone(i, n) for(ll i = 1; i <= (ll)(n); i++)
#define each(i, mp) for(auto i:mp)
#define FOR(i, m, n) for(ll i = m;i < n;i++)
int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};

int N;
ll target = 1;
unordered_map<ll, ll> mp;

// 素数列挙
void prime_factor(ll n) {
    for (ll i = 2; i * i <= n; ++i) {
        while (n % i == 0) {
            mp[i]++;
            n /= i;
        }
    }
    if (n != 1) mp[n]++;
}

int calc_larger(int n) {
    int ret = 0;
    each(m, mp) {
        if (m.second + 1 >= n) ret++;
    }
    return ret;
}

void solve() {
    ll ans = calc_larger(75) + calc_larger(25) * (calc_larger(3) - 1) +
             calc_larger(15) * (calc_larger(5) - 1) +
             calc_larger(5) * (calc_larger(5) - 1) * (calc_larger(3) - 2) / 2;
    cout << ans << endl;
}

int main() {
    cin >> N;
    repone(i, N) prime_factor(i);

    solve();
    return 0;
}

Measured memory_bytes: 256
def getN():
    return int(input())
def getNM():
    return map(int, input().split())
def getList():
    return list(map(int, input().split()))

ans = 0
N, K = getNM()
for i in range(N):
    b = i + 1
    if b > K:
        set = N // b
        ans += set*(b-K)
        rem = N % b
        if K == 0:
            ans -=1
        ans += max(rem-K+1,0)
print(ans)


Measured memory_bytes: 3060
#include "bits/stdc++.h"

#define REP(i,num) for(int i=0;i<(num);++i)
#define ALL(c) c.begin(),c.end()
#define PRINTALL(c) for(auto& x:c){cout<<x<<' ';}cout<<endl;

using namespace std;
using ll = long long;

template<typename T=int>
T in(){T x; cin >> x; return (x);}

template<typename T>
bool chmin(T& a,T b){if(a>b){a=b;return true;}return false;}

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

	int A=in(),B=in();
	
	cout << max({A+B,A-B,A*B}) << endl;
	return 0;
}


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

int main(){
    int N;
    cin >>N;
    vector<int> mochi(N);
    for (int i=0;i<N;i++){
        cin >> mochi.at(i);
    }
    sort(mochi.begin(),mochi.end());
    reverse(mochi.begin(),mochi.end());
    int count=1;
    for(int i=0;i<N-1;i++){
        if(mochi.at(i) !=mochi.at(i+1)){
            count++;
        }
    }
    cout << count << endl;
    
}

Measured memory_bytes: 256
l1 = list(map(int,input().split()))
l2 = list(map(int,input().split()))
l3 = list(map(int,input().split()))
if l1[0]-l2[0]==l1[1]-l2[1]==l1[2]-l2[2] and l2[0]-l3[0]==l2[1]-l3[1]==l2[2]-l3[2]:
    if l1[0]-l1[1]==l2[0]-l2[1]==l3[0]-l3[1] and l1[1]-l1[2]==l2[1]-l2[2]==l3[1]-l3[2]:
        print("Yes")
        exit()
print("No")


Measured memory_bytes: 3064
#include <bits/stdc++.h>
#include <cstdio>
#include <iostream>
#include <string>
#define ll long long int
#define ull unsigned long long int
#define db long double
#define rep(i,p,q) for(i=p;i<q;++i)
#define REP(i,p,q) for(i=p;i<=q;++i)
#define MOD 1000000007
#define stop return 0
#define pb push_back
#define nil -1
#define initial 0
#define waiting 1
#define visited 2
#define inf 10e+9
#define pb push_back
#define mp make_pair
#define pr pair<ll,ll>
#define MAX 300005
#define MAX2 2000005
#define fast ios_base::sync_with_stdio(false),cin.tie(NULL),cout.tie(NULL)
using namespace std;

int main()
{
    ll n;
    cin>>n;
    cout<<((n*(n+1))/2-n)<<endl;

}

Measured memory_bytes: 256
#include <bits/stdc++.h>
typedef long long Long;

#define MAX 100001

#define PB push_back
#define MP make_pair
#define FF first
#define SS second

#define PII pair<int, int>
#define VI vector<int>

#define FOR(a, n) for(int i=a;i<n;i++)
#define FORn(a, n) for(int i=a;i<=n;i++)

#define mm(a, n) memset(a, n, sizeof(a))

#define PF printf
#define PC putchar
#define GC getchar

#define printCase cout<<"Case "<<i<<": "vagfol
#define printCaseC PF("Case %d: ", i)

#define II() ({int a; scanf("%d", &a); a;})
#define LI() ({Long a; scanf("%I64d", &a); a;})
#define DI() ({double a; scanf("%lf", &a); a;})

#define FastIO ios_base::sync_with_stdio(false); cin.tie(NULL);
//double pi=atan(1)*4;

using namespace std;

void solve()
{
  int a, b, c;
  cin>>a>>b>>c;
    if(a+b+c<22)
        cout<<"win\n";
    else
        cout<<"bust\n";

}
int main()
{
  /*  #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #else
    #endif */
    /* *******Bismillahir Rahmanir Rahim **** */
//    FastIO;
    int t=1;
//    cin>>t;
    while(t--)
    {
        solve();
    }
    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<iomanip>
#include<cmath>
#include<string>
#include<vector>
#include<list>
#include<algorithm>
#include<map>
#include<set>
#include<queue>
#include<stack>
using namespace std;
typedef long long ll;
#define fi first
#define se second
#define mp make_pair
#define rep(i, n) for(int i=0;i<n;++i)
#define rrep(i, n) for(int i=n;i>=0;--i)
const int inf=1e9+7;
const ll mod=1e9+7;
const ll big=1e18;
const double PI=2*asin(1);

int main() {
  int N;
  cin>>N;
  map<int, int> amap;
  int tmp;
  for(int i=2;i<=N;++i) {
    tmp = i;
    for(int j=2;j*j<=tmp;++j) {
      if(tmp%j==0) {
        while(tmp%j==0) {
          amap[j]++;
          tmp /= j;
        }
      }
    }
    if(tmp>1) amap[tmp]++;
  }
  int A=0, B=0, C=0, D=0, E=0, F=0, G=0, H=0;
  for(int i=0;i<=N;++i) {
    if(amap[i]>=2 && amap[i]<4) A++;
    if(amap[i]>=4) B++;
    if(amap[i]>=4 && amap[i]<14) C++;
    if(amap[i]>=14) D++;
    if(amap[i]>=2 && amap[i]<24) E++;
    if(amap[i]>=24) F++;
    if(amap[i]>=74) H++;
  }
  int ans = 0;
  ans += max(0, A*B*(B-1)/2)+max(0, B*(B-1)*(B-2)/2);
  ans += C*D+D*(D-1);
  ans += E*F+F*(F-1);
  ans += H;
  cout<<ans<<endl;
}


Measured memory_bytes: 3644
#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>;

int main() {
  int n, m;
  cin >> n >> m;
  vector<int> a(m);
  rep(i,m) cin >> a[i];
  rep(i,m) n -= a[i];
  if (n < 0) n = -1;
  cout << n << endl;
  return 0;
}

Measured memory_bytes: 3612
#!/usr/bin/env python3
import sys


def solve(S: str):
    if S == 'Sunny':
        print('Cloudy')
    elif S == 'Cloudy':
        print('Rainy')
    elif S == 'Rainy':
        print('Sunny')
    return

# Generated by 1.1.5 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    S = next(tokens)  # type: str
    solve(S)

if __name__ == '__main__':
    main()


Measured memory_bytes: 2940
N = int(input())
A = list(map(int, input().split()))
ans = 0
for i in range(len(A)-1):
    a_before = A[i]
    a_after = A[i+1]

    # print(a_before, a_after)
    diff = a_before-a_after
    # print(diff)
    if diff > 0:
        A[i+1] = a_before
        ans += diff

print(ans)


Measured memory_bytes: 32152
#include <iostream>
#include <iomanip> //setprecision()
#include <vector>
#include <queue>
#include <algorithm>
#include <cmath>
#include <string>
#include <map>
#include <set>
using ll = long long;
using namespace std;

double Mcos(double k){return cos(k*atan(1.0)*4/180);}

void monmo(){
    
}

int main() {
    ll n,c=0;
    cin>>n;
    vector<ll> v(n,0);
    for(int i=0;i<n;i++){
        cin>>v[i];
    }
    for(int i=0;i<n-2;i++){
        for(int j=i+1;j<n-1;j++){
            for(int k=j+1;k<n;k++){
                if(!(v[i]==v[j] || v[j]==v[k] || v[k]==v[i])){
                    ll m=max(max(v[i],v[j]),v[k]);
                    if(m*2<v[i]+v[j]+v[k])c++;
                }
            }
        }
    }
    cout<<c;
}


Measured memory_bytes: 3608
#include <bits/stdc++.h>
using namespace std;
const double eps=1e-9;
typedef vector<int> vi;
typedef long long ll;
int A[5],B[5];
string rule[5][5];
#define pb push_back
string s;
int main(void)
{
  int n;
  while(cin >> n && n)
    {
      vector<pair<int,int>> teams;
      for(int i=0;i<n;i++)
	{
	  int id,m1,s1,m2,s2,m3,s3,m4,s4;
	  cin >> id >> m1 >> s1 >> m2 >> s2 >> m3 >> s3 >> m4 >> s4;
	  teams.push_back(make_pair(60*(m1+m2+m3+m4)+(s1+s2+s3+s4),id));
	}
      sort(teams.begin(),teams.end());
      for(int i=0;i<n;i++)
	{
	  if(i==0 || i==1 || i==n-2)
	    {
	      cout << teams[i].second << endl;
	    }
	}
    }
  return 0;
}



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

int main(){
    int cnt[26];
    char c;
    for(int i=0;i<26;i++){
        cnt[i]=0;
    }
    while(cin >> c){
        if(isupper(c)){
            cnt[static_cast<int>(c)-65]+=1;
        }else if(islower(c)){
            cnt[static_cast<int>(c)-97]+=1;
        }
    }
    for(int i=0;i<26;i++){
        printf("%c : %d\n",static_cast<char>(i+97),cnt[i]);
    }
    return 0;
}



Measured memory_bytes: 3224
import numpy as np
        
A = []
A = np.zeros((3, 3))
for i in range(3):
    A[i] =[int(e) for e in input().split()]
N = int(input())    
B = []
for i in range(N):
    B.append(int(input()))
ans = []
for i in range(3):
    ans.append(A[i])
ans.append([A[0][0], A[1][1], A[2][2]])
ans.append([A[0][2], A[1][1], A[2][0]])
ans.append([A[0][0], A[1][0], A[2][0]])
ans.append([A[0][1], A[1][1], A[2][1]])
ans.append([A[0][2], A[1][2], A[2][2]])
ans = np.array(ans)
flg = 0
for i in ans:
    if i[0] in B and i [1] in B and i[2] in B:
        print('Yes')
        flg = 1
        break
if flg == 0:
    print('No')


Measured memory_bytes: 12448