akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<n;i++)
#define LOOP(i,x,n) for(int i=x;i<n;i++)
#define ALL(v) (v).begin(),(v).end()
#define PB push_back
#define MP make_pair
#define FR first
#define SC second
#define int long long
using namespace std;
const int MOD=1000000007;
const int INF=1000000009;


signed main(){
  string s;
  while(cin>>s){
    vector<int> t;
    REP(i,9){
      char a=s[i]-'0';
      char b=s[i+1]-'0';
      int tmp=(a+b)%10;
      t.PB(tmp);
    }
    REP(j,9){
      vector<int> u;
      REP(i,t.size()-1){
        u.PB((t[i]+t[i+1])%10);
      }
      t=u;
    }
    cout<<t[0]<<endl;
  }
  return 0;
}




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

using namespace std;

#define ll long long
#define ld long double
#define pll pair <ll , ll>

#define pb push_back
#define pf push_front
#define pob pop_back
#define pof pop_front
#define mp make_pair

#define X first
#define Y second

#define LB(x) ((x) & -(x))
#define BIT(a , b) (((a)>>(b)) & 1)

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

	ll n , t0=0 , x0=0 , y0=0;
	cin>>n;

	for(ll i=0;i<n;i++)
    {
        ll t , x , y;
        cin>>t>>x>>y;

        ll k=abs(x-x0)+abs(y-y0) , h=abs(t-t0);

        if ((h&1)==(k&1) && h>=k)
        {
            t0=t;
            x0=x;
            y0=y;
        }
        else
        {
            cout<<"No";
            return 0;
        }
    }

    cout<<"Yes";
}


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

using namespace std;

int main(){
    long long int  a,b,k;
    long long int A,B,remain;
    cin>>a>>b>>k;

    if(k-a>=0){
        A=0;
        remain=k-a;
        B=b-remain;
        if(B<=0)B=0;
    }
    
    if(k-a<0){
        A=a-k;
        B=b;
    }

    cout<<A<<" "<<B;
    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#define ll long long
#define w(t) int t; cin>>t; while(t--)
#define f(N) long long N,k; cin>>N>>k; long long a[N]; for(int i=0;i<N;i++){cin>>a[i];}
#define g(N)  for(int i=0;i<N;i++){cout<<a[i]<<" ";}
using namespace std;
int main()
{
  int n,c=0;
  cin>>n;
  while(n%1000!=0)
  {
    n++;
    c++;
  }
  cout<<c;
}

Measured memory_bytes: 3164
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define INF (1LL<<50)
#define MOD 1000000007

int main(){
    int N;
    cin >> N;
    vector<ll> A(N),Sum(N+1);
    rep(i,N) cin >> A[i];
    sort(A.begin(),A.end());
    rep(i,N){
        Sum[i+1] = Sum[i]+A[i];
    }
    int l=0;
    for(int i=1;i<N;i++){
        if(Sum[i]*2<A[i]){
            l=i;
        }
    }
    cout << N-l << endl;
    return 0;
}

Measured memory_bytes: 1792
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <queue>
#include <string>
#define REP(i,n) for(long i = 0; i < (long)n; i++)
using namespace std;

int main(){
  long n;
  cin >> n;
  std::vector<long> vec_6;
  long pow_6 = 1;
  for(int i = 1;;i++){
    pow_6 *= 6;
    if(pow_6<=100000){
      vec_6.push_back(pow_6);
    }else{
      break;
    }
  }
  std::vector<long> vec_9;
  long pow_9 = 1;
  for(int i = 1;;i++){
    pow_9 *= 9;
    if(pow_9<=100000){
      vec_9.push_back(pow_9);
    }else{
      break;
    }
  }
  sort(vec_9.begin(),vec_9.end(),greater<int>());
  sort(vec_6.begin(),vec_6.end(),greater<int>());
  long min = n;
  REP(i,n+1){
    long rest = i;
    long cnt = 0;
    REP(j,vec_9.size()){
      cnt += rest/vec_9[j];
      rest = rest%vec_9[j];
    }
    rest = n-i+rest;
    REP(j,vec_6.size()){
      cnt += rest/vec_6[j];
      rest = rest%vec_6[j];
    }
    cnt += rest;
    if(cnt < min) min = cnt;
  }
  cout << min << endl;
  return 0;
}


Measured memory_bytes: 256
#pragma GCC optimize(3)
#include<bits/stdc++.h>
#define MAXN 605
#define INF 1000000000
#define MOD 1000000007
#define F first
#define S second
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
int n,K,a[MAXN],b[MAXN];
int unpaired[MAXN];
int sum[MAXN];
int ffact[MAXN];
int dp[MAXN][MAXN];
void add(int &a,int b) {a+=b; if(a>=MOD) a-=MOD;}
void dec(int &a,int b) {a-=b; if(a<0) a+=MOD;}
int main()
{
    scanf("%d%d",&n,&K);
    n*=2;
    ffact[0]=1;
    for(int i=1;i<=600;i++)
    {
        if(i&1) ffact[i]=1LL*i*ffact[i-1]%MOD;
        else ffact[i]=ffact[i-1];
    }
    for(int i=1;i<=600;i+=2) ffact[i]=0;
    for(int i=1;i<=n;i++) unpaired[i]=1;
    for(int i=0;i<K;i++)
    {
        scanf("%d%d",&a[i],&b[i]);
        unpaired[a[i]]=unpaired[b[i]]=0;
    }
    for(int i=1;i<=n;i++) sum[i]=sum[i-1]+unpaired[i];
    int ans=0;
    for(int len=2;len<=n;len+=2)
    {
        for(int i=1;i+len-1<=n;i++)
        {
            int j=i+len-1;
            bool f=true;
            for(int k=0;k<K;k++)
            {
                bool f1=(a[k]>=i&&a[k]<=j);
                bool f2=(b[k]>=i&&b[k]<=j);
                if(f1^f2) f=false;
            }
            if(!f)
            {
                dp[i][j]=0;
                continue;
            }
            int x=sum[j]-sum[i-1];
            dp[i][j]=ffact[x];
            for(int k=i+1;k<j;k+=2)
            {
                int y=sum[j]-sum[k];
                dec(dp[i][j],1LL*dp[i][k]*ffact[y]%MOD);
            }
            add(ans,1LL*dp[i][j]*ffact[sum[n]-x]%MOD);
        }
    }
    printf("%d\n",ans);
    return 0;
}



Measured memory_bytes: 1664
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <string>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <iomanip>
#include <utility>
#include <tuple>
#include <functional>
#include <bitset>
#include <cassert>
#include <complex>
#include <stdio.h>
#include <time.h>
#include <numeric>
#include <random>
#include <unordered_map>
#include <unordered_set>
#define all(a) a.begin(),a.end()
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define pb push_back
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<ll, ll> P;
typedef complex<ld> com;
constexpr int inf = 1000000010;
constexpr ll INF = 1000000000000000010;
constexpr ld eps = 1e-12;
constexpr ld pi = 3.141592653589793238;
template<class T, class U> inline bool chmax(T &a, const U &b) { if (a < b) { a = b; return true; } return false; }
template<class T, class U> inline bool chmin(T &a, const U &b) { if (a > b) { a = b; return true; } return false; }


signed main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	cout << fixed << setprecision(20);

	int n;
	cin >> n;
	vector<string> s(n);
	priority_queue<P> que, que2;
	rep(i, n) {
		cin >> s[i];
		int c = 0, m = 0;
		bool flag = true;
		rep(j, s[i].size()) {
			if (s[i][j] == '(') c++;
			else c--;
		}
		if (c < 0) {
			flag = false;
			reverse(all(s[i]));
			rep(j, s[i].size()) {
				if (s[i][j] == '(') s[i][j] = ')';
				else s[i][j] = '(';
			}
		}
		int tmp = 0;
		rep(j, s[i].size()) {
			if (s[i][j] == '(') tmp++;
			else tmp--;
			chmin(m, tmp);
		}
		if (flag) que.push(P(m, c));
		else que2.push(P(m, -c));
	}
	int g = 0;
	while (!que.empty()) {
		P p = que.top(); que.pop();
		if (p.first + g < 0) {
			cout << "No\n";
			return 0;
		}
		g += p.second;
	}
	int g2 = 0;
	while (!que2.empty()) {
		P p = que2.top(); que2.pop();
		if (p.first + g2 < 0) {
			cout << "No\n";
			return 0;
		}
		g2 += p.second;
	}
	cout << (g == g2 ? "Yes" : "No") << '\n';
}

Measured memory_bytes: 50300
#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
#define REP(i, n) FOR(i, 0, (n))
#define FOR(i, a, b) for(int i=(a); i<(b); i++)
#define LAR(a, b) ((a)=max((a),(b)))
#define SML(a, b) ((a)=min((a),(b)))
using ll = long long;
using ld = long double;
using vi = vector<int>;
using vl = vector<ll>;
using pii = pair<int, int>;
using vpii = vector<pair<int, int>>;
template<typename T>
using pque = priority_queue<T, vector<T>, greater<T>>;
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define ALL(a) (a).begin(), (a).end()
#ifdef LOCAL_DEBUG
#define DEBUG(...) printf(__VA_ARGS__)
#else
#define DEBUG(...)
#endif

#define N 212345
int xy[N], xi[N], ans[N];

int main(){
	int n; scanf("%d", &n);
	REP(i, n){
		int x, y; scanf("%d%d", &x, &y);
		xy[x] = y;
		xi[x] = i;
	}
	for(int sx = 1; sx <= n; ){
		// DEBUG("sx = %d\n", sx);
		int miny = xy[sx];
		int x = sx;
		while(miny != n+1-x){
			x++;
			SML(miny, xy[x]);
		}
		DEBUG("[%d, %d]\n", sx, x);
		FOR(i, sx, x+1){
			DEBUG(" xi[%d]=%d\n", i, xi[i]);
			ans[xi[i]] = x-sx+1;
		}
		sx = x+1;
	}
	REP(i, n) printf("%d\n", ans[i]);
}


Measured memory_bytes: 6128
from operator import itemgetter
import heapq
N, M = map(int, input().split())
AB = [list(map(int, input().split())) for _ in range(N)]
AB.sort(key=itemgetter(0))
q = []
idx = 0
ans = 0
for i in range(1, M+1):
    while idx < N:
        a, b = AB[idx]
        if a <= i:
            heapq.heappush(q, -b)
            idx += 1
        else:
            break
    if len(q)>0:
        b = heapq.heappop(q)
        ans -= b
print(ans)


Measured memory_bytes: 31912
// 参考了用户 tk4114 的代码
#include <bits/stdc++.h>
using namespace std;

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

	char T[1000005], P[10005];
	cin.getline(T, 1000005);
	int Tl = cin.gcount() - 1;
	cin.getline(P, 10005);
	int Pl = cin.gcount() - 1;
	if (Pl > Tl) return 0;

	int jmp[10005];
	jmp[1] = 0;
	int i = 2, j = 0;
	while (i <= Pl) {
		if (P[i - 1] == P[j]) {
			i++;
			j++;
			jmp[i - 1] = j;
		} else if (j > 0) {
			j = jmp[j];
		} else {
			jmp[i] = 0;
			i++;
		}
	}

	i = 0;
	j = 0;
	while (i < Tl) {
		if (T[i] == P[j]) {
			i++;
			j++;
			if (j == Pl) {
				cout << i - Pl << endl;
				j = jmp[j];
			}
		} else if (j > 0) {
			j = jmp[j];
		} else {
			i++;
		}
	}
}


Measured memory_bytes: 4192
#include <iostream>

using namespace std;
int fmax(int a,int b){
    if(a>b)
        return a;
    else
        return b;
}
int x,y;
int tax(int n){
    int p = 0;
    for(int i = 1 ; i < 1000 ; i++){
        if(i*(100+x)/100 == n){
            p = i;
            break;
        }
    }
    return p*(100+y)/100;
}

int main(){
    int s;
    while(cin >> x >> y >> s,(x|y|s)){
        int max = 0;
        for(int i = 1 ; i <= s/2 ; i++){
            max =fmax(max,tax(i)+tax(s-i));
        }
        cout << max << endl;
    }
    return 0;
}

Measured memory_bytes: 1160
//Zory-2020
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
// typedef __int128 ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
#define FR first
#define SE second
#define MP make_pair
#define PB push_back
#define vc vector
#define db double
#define all(x) (x).begin(),(x).end()
#define sz(x) ((int)(x).size())
#define bin(x) (1ll<<(x))
#define fo(i,l,r) for(int i=(l),I=(r);i<=I;i++)
#define fd(i,r,l) for(int i=(r),I=(l);i>=I;i--)
#define mem(x,val) memset(x,val,sizeof x)
#define Swap(a,b,n) for(int I=0;I<=n;I++) swap(a[I],b[I])
#define PC __builtin_popcountll
#ifdef DEBUG
	#define debug(A,args...) fprintf(stderr,A,##args)
#else
	#define debug(A,args...) printf("")
#endif
#define deb debug("line %d\n",__LINE__)
namespace mine
{
	ll qread()
	{
		ll ans=0,f=1;char c=getchar();
		while(c<'0' or c>'9') {if(c=='-')f=-1;c=getchar();}
		while('0'<=c and c<='9') ans=ans*10+c-'0',c=getchar();
		return ans*f;
	}
	void write(ll num){if(num<0) putchar('-'),num=-num;if(num>=10) write(num/10);putchar('0'+num%10);}
	void write1(ll num){write(num);putchar(' ');}
	void write2(ll num){write(num);putchar('\n');}
	template<typename T>inline bool chmax(T&a,const T&b){return a<b?a=b,1:0;}
	template<typename T>inline bool chmin(T&a,const T&b){return a>b?a=b,1:0;}
	ll gcd(ll x,ll y){return y?gcd(y,x%y):x;}
	bool IN(ll x,ll l,ll r){return l<=x and x<=r;}
	void GG(){puts("-1");exit(0);}

	const db eps=1e-8;
	const int INF=0x3f3f3f3f;
	const int MOD=1e9+7;
	int mm(const int x){return x>=MOD?x-MOD:x;}
	template<typename T> void add(T &x,const int &y){x=(x+y>=MOD?x+y-MOD:x+y);}
	ll qpower(ll x,ll e,int mod=MOD){ll ans=1;while(e){if(e&1)ans=ans*x%mod;x=x*x%mod;e>>=1;}return ans;}
	ll invm(ll x){return qpower(x,MOD-2);}
	const int MM=5e6+10;
	ll fac[MM],facinv[MM],Inv[MM];ll Comb(int n,int m){return n<0 or n<m?0:fac[n]*facinv[m]%MOD*facinv[n-m]%MOD;}
	void PRE()
	{
		fac[0]=1;fo(i,1,MM-1) fac[i]=fac[i-1]*i%MOD;
		facinv[MM-1]=invm(fac[MM-1]);fd(i,MM-1,1) facinv[i-1]=facinv[i]*i%MOD;
		Inv[1]=1;fo(i,2,MM-1) Inv[i]=(MOD-MOD/i)*Inv[MOD%i]%MOD;
	}

	const int N=1e6+10;
	//------------------FIXED------------------
	int p[N];
	void main()
	{
		int n=qread();fo(i,1,n) p[i]=qread();int ans=0;
		for(int l=1;l<=n;l++) if(l==p[l])
		{
			int r=l;while(r+1<=n and r+1==p[r+1]) r++;
			ans+=ceil((r-l+1)/2.0);l=r;
		}write(ans);
 	}
};//变量重名！
signed main()
{
	#ifdef DEBUG
	//freopen("a.in","r",stdin);
	freopen("z.txt","r",stdin);
	//freopen("a.out","w",stdout);
	#endif
	srand(time(0));
	mine::main();
	debug("\n------------------------------------------\nTime: %.2lf s\n",1.0*clock()/CLOCKS_PER_SEC);
}

Measured memory_bytes: 640
#H = int(input())
H,N = list(map(int,input().split()))
#H = sorted(list(map(int,input().split())))
AB = sorted([list(map(int,input().split())) for i in range(N)])
dp = [float('inf') for i in range(H)]
dp[0] = 0
for i in range(N):
    for j in range(H):
        if j-AB[i][0] >= 0:
            dp[j] = min(dp[j],dp[j-AB[i][0]]+AB[i][1])
ans = float('inf')
for i in range(N):
    for j in range(max(0,H-AB[i][0]),H):
        if dp[j] != float('inf') and j+AB[i][0] >= H:
            ans = min(ans,dp[j]+AB[i][1])
print(ans)

Measured memory_bytes: 50140
#include <iostream>

using namespace std;

//n^rを返す
int power(int n, int r){
  int ans = 1;
  for(int i=0; i<r; i++)
    ans *= n;
  return ans;
}


int main(void){
  int N;
  cin >> N;
  //入力終わり

  //6と9の指数の最大
  int six_max  = 7;
  int nine_max = 6;

  //dp配列の初期化
  int dp[N+1];
  for(int i=0; i<=N; i++)
    dp[i] = N;
  dp[0] = 0;

  //今いる場所，次見る場所
  int now, next;
  for(now=0; now<N; now++){
    //nowから6の冪乗だけ先を見る
    for(int j=1; j<six_max; j++){
      next = now+power(6, j);
      //nextがはみ出していない
      if(next <= N)
	//nextの現状か，nowから1つ増やすかの選択
	dp[next] = min(dp[next], dp[now]+1);
    }
    //6の冪乗のときと同じ
    for(int j=1; j<nine_max; j++){
      next = now+power(9, j);
      if(next <= N)
	dp[next] = min(dp[next], dp[now]+1);
    }
    //now+1の更新
    dp[now+1] = min(dp[now+1], dp[now]+1);
  }

    cout << dp[N] << endl;
  
  return 0;
}


Measured memory_bytes: 640
using System;
class Program
{
	static void Main(string[] args)
	{
		string input = Console.ReadLine();
		int n = int.Parse(input);
		int[] kuku = new int[]{1,2,3,4,5,6,7,8,9,10,12,14,15,16,18,20,21,24,25,27,28,30,32,35,36,40,42,48,49,54,56,64,72,81};
		int index = Array.IndexOf(kuku, n);
		if(index == -1)
		{
			Console.WriteLine("No");
		}
		else
		{
			Console.WriteLine("Yes");
		}
	}
}

Measured memory_bytes: 13140
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>

using namespace std;

#define dprint(Exp,...) if(Exp){fprintf(stderr, __VA_ARGS__);}
#define printe(...) fprintf(stderr, __VA_ARGS__);
#define PrtExp(_Exp)  cerr<< #_Exp <<" = "<< (_Exp)
#define PrtExpN(_Exp)  cerr<< #_Exp <<" = "<< (_Exp) <<"\n"

#define SINT(n) scanf("%d",&n)
#define SINT2(n,m) scanf("%d %d",&n,&m)
#define SINT3(n,m,o) scanf("%d %d %d",&n,&m,&o)
#define SINT4(n,m,o,p) scanf("%d %d %d %d",&n,&m,&o,&p)
#define SINT5(n,m,o,p,q) scanf("%d %d %d %d %d",&n,&m,&o,&p,&q)
#define SLL(n) scanf("%lld",&n)
#define SLL2(n,m) scanf("%lld %lld",&n,&m)
#define SLL3(n,m,o) scanf("%lld %lld %lld",&n,&m,&o)
#define SST(s) scanf("%s",s)
#define SCH(c) scanf("%c",&c)

#define GC() getchar()

#define PINT(n) printf("%d",(int)(n))
#define PINT2(n,m) printf("%d %d",(int)(n),(int)(m))
#define PINT3(n,m,l) printf("%d %d %d",(int)(n),(int)(m),(int)(l))
#define PLL(n) printf("%lld",(long long)(n))
#define PST(s) printf("%s",(s))
#define PCH(s) printf("%c",(s))

#define PINTN(n) printf("%d\n",(int)(n))
#define PINT2N(n,m) printf("%d %d\n",(int)(n),(int)(m))
#define PINT3N(n,m,l) printf("%d %d %d\n",(int)(n),(int)(m),(int)(l))
#define PLLN(n) printf("%lld\n",(long long)(n))
#define PSTN(s) printf("%s\n",(s))
#define PCHN(s) printf("%c\n",(s))

#define PSP() printf(" ")
#define PN() printf("\n")

#define PC(c) putchar(c)
#define CSP (' ')
#define SN ("\n")

#define rep(i,a) for(int i=0;i<a;i++)
#define reP(i,a) for(int i=0;i<=a;i++)
#define Rep(i,a) for(int i=a-1;i>=0;i--)
#define ReP(i,a) for(int i=a;i>=0;i--)

#define rEp(i,a) for(i=0;i<a;i++)
#define rEP(i,a) for(i=0;i<=a;i++)
#define REp(i,a) for(i=a-1;i>=0;i--)
#define REP(i,a) for(i=a;i>=0;i--)

#define repft(i,a,b) for(int i=a;i<b;i++)
#define repfT(i,a,b) for(int i=a;i<=b;i++)
#define Repft(i,a,b) for(int i=a-1;i>=b;i--)
#define RepfT(i,a,b) for(int i=a;i>=b;i--)

#define foreach(a,it) for(auto it = a.begin(); it != a.end(); ++it)

#define FILL(a,v) fill(begin(a),end(a), v)
#define FILL0(a) memset(a,0,sizeof(a))
#define FILL1(a) memset(a,-1,sizeof(a))

typedef long long ll;

typedef unsigned long long ull;
typedef pair<int, int> Pi;
typedef pair<ll, ll>   Pll;

typedef pair<double, double> Pd;


const int INF = 1000000009; //0x2aaaaaaa; // 715,827,882
const ll INFLL = 0x1f1f1f1f1f1f1f1fLL;//2,242,545,357,980,376,863

template <class A, class B> inline ostream& operator<<(ostream& st, const pair<A, B>& P) { return st << "(" << P.first << ", " << P.second << ")"; };
template <class A, class B> inline pair<A, B> operator+(const pair<A, B>& P, const pair<A, B>& Q) { return pair<A, B>(P.first + Q.first, P.second + Q.second); };
template <class A, class B> inline pair<A, B> operator-(const pair<A, B>& P, const pair<A, B>& Q) { return pair<A, B>(P.first - Q.first, P.second - Q.second); };

#define fs  first
#define sc  second

int x[200001];
int z[200001];


int main() {
	int n;
	cin >> n;
	rep(i, n) {
		cin >> x[i];
		z[i] = x[i];
	}
	sort(x, x + n);

	rep(i, n) {
		int m = lower_bound(x, x + n, z[i]) - x;
		cout << x[m<n/2 ? n/2 : n/2-1] << endl;
	}


}

Measured memory_bytes: 3712
n,a,b,c = list(map(int,input().split()))
l = list()
for i in range(0,n):
    l.append(int(input()))

def dif(stick,abc):
    return abs(abc-sum(stick)) + 10*(len(stick)- 1)

mp = 300000

for i in range(0,1 << 2*n):
    bamb = [[] for i in range(0,4)]
    for j in range(0,2*n,2):
        if ((i >> j) & 3) == 3:
            bamb[0].append(l[j//2])
        elif ((i >> j)&2) == 2:
            bamb[1].append(l[j//2])
        elif ((i >> j)&1) == 1:
            bamb[2].append(l[j//2])
        elif((i >> j)&0) == 0:
            bamb[3].append(l[j//2])
    if bamb[0] == [] or bamb[1] == [] or bamb[2] == []:
        continue
    mp = min(mp,dif(bamb[0],a)+dif(bamb[1],b)+dif(bamb[2],c))
print(mp)

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

int main() {
    int N, K; cin >> N >> K;
    vector<int> A;
    for (int i = 0; i < N; ++i) {
        int a; cin >> a; A.push_back(a);
    }
    for (int k = 0; k < K; ++k) {
        bool updated = false;
        vector<int> S(N, 0);
        for (int i = 0; i < N; ++i) {
            int a = A[i];
            S[max(i - a, 0)]++;
            if (i + a + 1 < N) S[i + a + 1]--;
        }
        for (int i = 0; i < N; ++i) {
            if (i - 1 >= 0) S[i] += S[i - 1];
            if (A[i] != S[i]) updated = true;
            A[i] = S[i];
        }
        if (!updated) break;
    }
    for (auto &a: A) {
        cout << a << " ";
    }
    cout << endl;
    return 0;
}


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

int main(){
  int n,q;
  cin>>n>>q;
  vector<int>v[n];
  while(q--){
    int a,b,c;
    cin>>a>>b;
    if(!a){
      cin>>c;
      v[b].push_back(c);
    }
    else if(a==1){
      r(i,(int)v[b].size()){
        if(i)cout<<' ';
        cout<<v[b][i];
      }
      cout<<endl;
    }
    else v[b].clear();
  }
}


Measured memory_bytes: 5796
// https://atcoder.jp/contests/agc006/tasks/agc006_c
#include <bits/stdc++.h>
using namespace std;
#define TEMPLATE
#ifdef BTK
#define DEBUG if (1)
#else
#define CIN_ONLY if (1)
struct cww {
    cww() {
        CIN_ONLY {
            ios::sync_with_stdio(false);
            cin.tie(0);
        }
    }
} star;
#define DEBUG if (0)
#endif
#define ALL(v) (v).begin(), (v).end()
#define REC(ret, ...) std::function<ret(__VA_ARGS__)>
template <typename T>
inline bool chmin(T& l, T r) {
    bool a = l > r;
    if (a) l = r;
    return a;
}
template <typename T>
inline bool chmax(T& l, T r) {
    bool a = l < r;
    if (a) l = r;
    return a;
}
template <typename T>
istream& operator>>(istream& is, vector<T>& v) {
    for (auto& it : v) is >> it;
    return is;
}
template <typename T>
inline T& unused_var(T& v) {
    return v;
}
class reverse_range {
  private:
    struct I {
        int x;
        int operator*() { return x - 1; }
        bool operator!=(I& lhs) { return x > lhs.x; }
        void operator++() { --x; }
    };
    I i, n;

  public:
    reverse_range(int n) : i({0}), n({n}) {}
    reverse_range(int i, int n) : i({i}), n({n}) {}
    I& begin() { return n; }
    I& end() { return i; }
};
class range {
  private:
    struct I {
        int x;
        int operator*() { return x; }
        bool operator!=(I& lhs) { return x < lhs.x; }
        void operator++() { ++x; }
    };
    I i, n;

  public:
    range(int n) : i({0}), n({n}) {}
    range(int i, int n) : i({i}), n({n}) {}
    I& begin() { return i; }
    I& end() { return n; }
    reverse_range operator!() { return reverse_range(*i, *n); }
};
using LL = long long;

int N;
int M;
LL x[112345];
LL K;
int as[64][112345];
int pos[112345];
int nps[112345];
LL dff[112345];
int main() {
    cout << fixed;
    cout << setprecision(10);
    cin >> N;
    for (int i : range(N)) {
        cin >> x[i];
    }
    cin >> M >> K;
    for (int i : range(N - 1)) {
        as[0][i] = i;
        pos[i]   = i;
    }
    for (int i : range(M)) {
        unused_var(i);
        int a;
        cin >> a;
        swap(as[0][a - 1], as[0][a - 2]);
    }
    for (int i : range(63)) {
        for (int j : range(N - 1)) {
            as[i + 1][j] = as[i][as[i][j]];
        }
    }
    int b = 0;
    while (K) {
        if (K & 1) {
            for (int i : range(N - 1)) {
                nps[i] = as[b][pos[i]];
            }
            for (int i : range(N - 1)) {
                pos[i] = nps[i];
            }
        }
        b++;
        K = K >> 1;
    }
    dff[0] = x[0];
    for (int i : range(N - 1)) {
        const int id = pos[i];
        // cerr << id << endl;
        dff[i + 1] = x[id + 1] - x[id] + dff[i];
    }
    for (int i : range(N)) {
        cout << dff[i] << endl;
    }
    return 0;
}

Measured memory_bytes: 31744
#include <bits/stdc++.h>
using namespace std;
/* typedef */
typedef long long ll;
typedef pair<int, int> pii;
/* constant */
const int INF = 1 << 30;
const ll LINF = 1LL << 50;
const int NIL = -1;
const int MAX = 10000;
const int mod = 1000000007;
const double pi = 3.141592653589;
/* global variables */
/* function */
/* main */
int main(){
    ll N, A, B;
    cin >> N >> A >> B;

    if ((B - A) % 2 == 0) {
        cout << (B - A) / 2 << '\n';
    }
    else {
        // 1 <- A: A - 1
        // 1 <- 1: 1
        // A -><- B: (B - A) / 2
        ll c1 = A + (B - A) / 2;
        // B -> N: N - B
        // N -> N: 1
        // A -><- B: (N - (N - B + 1 + A)) / 2 = (B - A - 1) / 2
        ll c2 = N - B + 1 + (B - A - 1) / 2;
        cout << min(c1, c2) << '\n';
    }
}


Measured memory_bytes: 3636
#include<iostream>
#include<cstdio>
#include<cstring>
#include <cstdlib>  
#include <math.h>
#include <cmath>
#include<cctype>
#include<string>
#include<set>
#include<iomanip>
#include <map>
#include<algorithm>
#include <functional>
#include<vector>
#include<climits>
#include<stack>
#include<queue>
#include <deque>
#include <climits>
#include <typeinfo>
#include <utility> 
#define all(x) (x).begin(),(x).end()
#define rep(i,m,n) for(int i = m;i < n;++i)
#define pb push_back
#define fore(i,a) for(auto &i:a)
#define rrep(i,m,n) for(int i = m;i >= n;--i)
#define INF INT_MAX/2
using namespace std;
using ll = long long;
using R = double;
using Data = pair<ll, vector<int>>;
const ll MOD = 1e9 + 7;
const ll inf = 1LL << 50;
struct edge { ll from; ll to; ll cost; };
typedef tuple<ll, ll, ll>T;
typedef pair<ll,ll>pll;



int main(){
	ll n, m;
	cin >> n >> m;
	vector<ll>a(n);
	vector<pair<ll, ll>>cb(m);
	vector<ll>a_;
	ll sum = 0;
	rep(i, 0, n) {
		cin >> a[i];
		sum += a[i];
	}
	rep(i, 0, m)cin >> cb[i].second >> cb[i].first;
	sort(all(a));
	sort(all(cb));
	reverse(all(cb));
	rep(i, 0, n) {
		if (a[i] < cb[0].first)a_.pb(a[i]);
	}
	sort(all(a_));

	ll cur = 0;
	fore(x, cb) {
		ll c = x.first;
		ll b = x.second;
		ll tmpcnt = 0;
		while (cur < a_.size() && tmpcnt < b) {
			if (a_[cur] < c) {
				sum += c - a_[cur];
				tmpcnt++;
				cur++;
			}
			else {
				break;
			}
		}
	}

	cout << sum << endl;



	return 0;
}

Measured memory_bytes: 3704
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>

using namespace std;

int main()
{
	string S;
	cin >> S;

	int ans = 700;

	for (int i = 0; i < S.size(); i++) {
		int x = 100;

		if (S[i] == 'o') {
			ans += x;
		}
	}
	cout << ans << endl;
}



Measured memory_bytes: 3492
use proconio::{input, fastout};

#[fastout]
fn main() {
    input!{
        a: u64,
        b: String,
    }
    let b = b
        .split('.')
        .collect::<Vec<_>>()
        .concat()
        .parse::<u64>()
        .unwrap();
    println!("{}", a * b / 100);
}


Measured memory_bytes: 2184
#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<queue>
#include<map>
#include<math.h>

typedef  long long ll;

#define rep(i,a,n) for(ll (i)=(a);(i)<(n);(i)++)
#define rrep(i,a,n) for(ll (i)=(a);(i)>=(n);(i)--)

#define INF ll 1 << 60
#define MOD 1000000007


using namespace std;

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

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

int gcd(long long int a,long long int b){
    long long int r;
    if(a < b){
        int tmp;
        tmp = a;
        a = b;
        b = tmp;
    }
    while(r = a % b){
        a = b;
        b = r;
    }
    return a;
}


void ys(){
    cout << "Yes" << endl;
}

void yb(){
    cout << "YES" << endl;
}

void ns(){
    cout << "No" << endl;
}

void nb(){
    cout << "NO" << endl;
}

int dig(int d){
    int ans = 1;
    if(d == 0) return ans;
    while(d != 0){
        d--;
        ans*=100;
    }
    return ans;
}

ll divisors(ll n) {
    vector<ll> res;

    for(ll i = 1; i*i <= n; ++i) {
        if(n % i != 0) continue;
        res.push_back(i-1);
        if(n/i == i) continue;
        res.push_back((n/i)-1);
    }

    ll ans = 0;

    rep(i,0,res.size()){
        if(res[i] != 0)
        if(n/res[i] == n%res[i]) ans += res[i];
    } 
    return ans;
}
vector<string> ans;

void solve(void){
   int n;
   cin >> n;
   int r = 25-n;
   string ans = "Christmas";
   string e = " Eve";
   rep(i,0,r){
       ans += e;
   }
   cout << ans << endl;

}

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

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,n) for(int i=0;i<n;i++)
#define why(n,x) int n;while(cin >>n,n!=x)
#define iFOR(i,x,n)for(int i=x;i<n;i++)
#define unless(flg) if ( !(flg) )
#define read cin<<
#define echo cout<<
#define fin <<'\n'
#define __ <<" "<<
#define ___ <<" "
#define bash push_back
#define ALL(x) x.begin(),x.end()
#define SWAP(a,b) ((a != b) && (a += b,b = a - b,a -= b))
#define cinf(n,x) for(int UNCH=0;UNCH<(n);UNCH++) cin >> x[UNCH];
#define fcin(n,x) for(int UNCH=1;UNCH<=(n);UNCH++) cin>> x[UNCH];
#define memmin(x) memset((x),-1,sizeof((x)))
#define memzer(x) memset((x), 0,sizeof((x)))
#define meminf(x) memset((x),0x3f,sizeof((x)))
     
typedef long long ll;
typedef pair < int , int > pii;
typedef vector < int > vit;
typedef map < string , int > mstit;
typedef vector < pii > vpi ;
typedef greater < pii > gpi;
typedef priority_queue < pii , vpi , gpi > dijk ;
static const signed int INF = 0x3f3f3f3f;
static const signed long long LINF = 0x3f3f3f3f3f3f3f3fLL;
static const signed int SMOD = 1000000007;
static const signed int NMOD = 1000000009;
static const signed int dx[]={1,0,-1,0,1,1,-1,-1};
static const signed int dy[]={0,-1,0,1,-1,1,-1,1};
     
bool inside(int x,int y,int w,int h){return (x>=0 && y>=0 && x<w && y<h);}
template<class T>T abs(T &x){return x<0 ? -x : x;}
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; }
int qp(int a,ll b,int mo){int ans=1;do{if(b&1)ans=1ll*ans*a%mo;a=1ll*a*a%mo;}while(b>>=1);return ans;}
int gcd(int a,int b){return b?gcd(b,a%b):a;}
int lcm(int a,int b){return a/gcd(a,b)*b;}
//#define int long long
     
int n,m,a,b,c;
string str;
     

inline void solve(){
  
  cin >> str;
  FOR(i,str.length()){
    if(str[i]=='0')
      a++;
    else
      b++;
  }
  cout << str.length()-abs(a-b) fin;
  
}
struct xyz{ xyz(){ cin.tie(0), ios::sync_with_stdio(false); cout <<fixed<<setprecision(12);};}xyzzy;signed main(){solve();return 0;}
     


Measured memory_bytes: 512
#include<iostream>
#include<string>
using namespace std;
int main() {
	cin.tie(0);
   	ios::sync_with_stdio(false);

	long long int K,KN,K_N;
    int N=50;
    long long int ai[N];
	cin >> K;
    KN=K/N;
    K_N=K%N;
    for(int i=0;i<N;i++){
        ai[i]=i+KN;
    }
    for(int i=0;i<K_N;i++){
        for(int j=0;j<N;j++){
            if(i==j) ai[j]+=N;
            else ai[j]--;
        }
    }
	cout << N << "\n";
    for(int i=0;i<N;i++){
        cout << ai[i] << " ";
    }
	return 0;
}

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

using namespace std;

#define dump(n) cout<<"# "<<#n<<"="<<(n)<<endl
#define debug(n) cout<<__FILE__<<","<<__LINE__<<": # "<<#n<<"="<<(n)<<endl
#define repi(i,a,b) for(int i=int(a);i<int(b);i++)
#define rep(i,n) repi(i,0,n)
#define iter(c) __typeof((c).begin())
#define tr(c,i) for(iter(c) i=(c).begin();i!=(c).end();i++)
#define allof(c) (c).begin(),(c).end()
#define mp make_pair

typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef pair<int,int> pii;

int main()
{
	int res=0;
	for(string s;cin>>s;)
		res+=(s==string(s.rbegin(),s.rend()));
	cout<<res<<endl;
	
	return 0;
}

Measured memory_bytes: 0
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Scanner;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        ABC085C solver = new ABC085C();
        solver.solve(1, in, out);
        out.close();
    }

    static class ABC085C {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            // 整数の入力
            int n = Integer.parseInt(in.next());
            int y = Integer.parseInt(in.next());
            int total = 0;
            int k = 0;
            int ans10000 = -1;
            int ans5000 = -1;
            int ans1000 = -1;

            for (int i = 0; i <= n; i++) {
                for (int j = 0; j <= n - i; j++) {
                    k = n - i - j;
                    total = 10000 * i + 5000 * j + 1000 * k;
                    if (total == y) {
                        out.println(String.valueOf(i) + " " + String.valueOf(j) + " " + String.valueOf(k));
                        return;
                    }
                }
            }

            // 出力
            out.println(String.valueOf(ans10000) + " " + String.valueOf(ans5000) + " " + String.valueOf(ans1000));

        }

    }
}



Measured memory_bytes: 24020
#include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for (int i=0;i<(n);++i)
#define rep(i,a,b) for(int i=a;i<(b);++i)
template<class T> inline bool chmin(T &a, T b){ if(a > b) { a = b; return true;} return false;}
template<class T> inline bool chmax(T &a, T b){ if(a < b) { a = b; return true;} return false;}
typedef long long ll;
const ll INF = 1LL << 60;
const ll MOD = 1e9 + 7;


int N,M,K;
int main() {
    cin >> N >> M;
    M += N * 3;
    cout << M / 2 << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
 
using namespace std;
 
#define int long long 
#define INF 1e9
#define LINF 1e18
#define FOR(i, j, k) for(int i = j; i < k; ++i)
#define rep(i, j) FOR(i, 0, j)
#define FORr(i, j, k) for(int i = j; i >= k; --i)
#define repr(i, j) FORr(i, j, 0)

typedef unsigned long long ull;
typedef pair<int, int> P;
typedef pair<int, P> Pi;
typedef pair<P, P> PP;
 
const int MOD = 1e9 + 7;
const int dy[] = { 0, 0, 1, -1 };
const int dx[] = { 1, -1, 0, 0 };
 
template <class T> void chmin(T& a, const T& b) { a = min(a, b); }
template <class T> void chmax(T& a, const T& b) { a = max(a, b); }

int L[100000], R[100000];
int imos[100001];

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

    int N, M;
    cin >> N >> M;
    rep(i, M) {
        cin  >> L[i] >> R[i];
        --L[i]; --R[i];
        ++imos[L[i]]; --imos[R[i] + 1];
    }
    rep(i, N) imos[i + 1] += imos[i];
    int res = 0;
    rep(i, N) {
        if(imos[i] == M) ++res;
    }
    cout << res << endl;
    return 0;
}


Measured memory_bytes: 2560
#include <stdio.h>
#include <assert.h>
#include <fstream>
#include <iostream>
#include <algorithm>
#include <array>
#include <vector>
#include <queue>
#include <set>
#include <cmath>
#include <iomanip>
//#include <unordered_map>
//#include <unordered_set>
//#include <boost/container/static_vector.hpp>
//#include <boost/unordered_set.hpp>
//#include <boost/unordered_map.hpp>
//#include <unistd.h>

//#include <cv.h>
//#include <highgui.h>
#include <stdlib.h>
#include <string>

const int MAX_N = 100050;
const int MOD = 1000000007;
int N, x[MAX_N];

int main(int argc, char **argv) {
    std::cin >> N;

    for (int i = 1; i <= N; i++) {
        std::cin >> x[i];
    }

    int num = 0;
    long long ret = 1;
    for (int i = 1; i <= N; i++) {
        if (num * 2 + 1 <= x[i]) {
            num++;
        } else {
            ret = (ret * (num + 1)) % MOD;
        }
    }

    for (int i = 1; i <= num; i++) {
        ret = (ret * i) % MOD;
    }

    
    std::cout << ret << std::endl;

    return 0;
}


Measured memory_bytes: 640
S = input()
S_front = [""] * (len(S)//2)
S_end = [""] * (len(S)//2)

def check(S):
 for i in range(len(S)//2):
    if S[i] != S[len(S) - i - 1]:
        print("No")
        exit()

for i in range(len(S)//2):
    S_front[i] = S[i]
    S_end[i] = S[len(S) - i - 1]
    if S[i] != S[len(S) - i - 1]:
        print("No")
        exit()

check(S_front)
check(S_end)

print("Yes")

Measured memory_bytes: 3064
n=int(input())
a=list(map(int,input().split()))
l=[0 for i in range(9)]
for j in range(n):
  l[min(a[j],3200)//400]+=1
c=0
for k in range(len(l)-1):
  if l[k]>0:c+=1
if c==0:print(1,c+l[8])
else:print(c,c+l[8])

Measured memory_bytes: 3064
# -*- coding: utf-8 -*-


def fib(n):
    if n == 0 or n == 1:
        return 1
    return fib(n-1) + fib(n-2)

def fib_memo(n, memo):
    if n == 0 or n == 1:
        memo[n] = 1
        return memo[n]
    if memo[n] != -1:
        return memo[n]
    memo[n] = fib_memo(n-1, memo) + fib_memo(n-2, memo)
    return memo[n]

memo = [-1 for i in range(45)]

n = int(input())
print(fib_memo(n, memo))

Measured memory_bytes: 5608
# -*- coding: utf-8 -*-

line =  input().split()
n = int(line[0])
T = int(line[1])
t = [int(x) for x in input().split()]

ret = T
for i in range(n-1):
    if t[i+1]-t[i]>=T:
        ret += T
    else:
        ret += t[i+1]-t[i]
print(ret)


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

int main()
{
	int k, a, b;
	cin >> k >> a >> b;
	for (int i = a; i <= b; ++i)
	{
		if (i%k == 0)
		{
			cout << "OK" << endl;
			return 0;
		}
	}
	cout << "NG" << endl;
	
	return 0;
}


Measured memory_bytes: 3596
#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 a, b, m;
  cin >> a >> b >> m;
  vector<int> as(a);
  vector<int> bs(b);
  int min_a = 1000000;
  int min_b = 1000000;
  int ans = 0;
  rep(i,a){
    cin >> as.at(i);
    min_a = min(min_a, as.at(i));
  }
  rep(i,b){
    cin >> bs.at(i);
    min_b = min(min_b, bs.at(i));
  }
  ans = min_a + min_b;
  rep(i,m){
    int x, y, c;
    cin >> x >> y >> c;
    ans = min(ans, as.at(x-1) + bs.at(y-1) - c);
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 1024
x, y = map(int, input().split())
if (x+y)%3 != 0:
    print(0)
    exit()

a = 2*x - y
b = -x + 2*y
if a < 0 or b < 0:
    print(0)
    exit()

a //= 3
b //= 3
MOD = 10**9+7
MAX_N = 10**6
fact = [1]
fact_inv = [0]*(MAX_N+4)
for i in range(MAX_N+3):
    fact.append(fact[-1]*(i+1)%MOD)

fact_inv[-1] = pow(fact[-1],MOD-2,MOD)
for i in range(MAX_N+2,-1,-1):
    fact_inv[i] = fact_inv[i+1]*(i+1)%MOD

def mod_comb_k(n,k,MOD):
    return fact[n] * fact_inv[k] % MOD * fact_inv[n-k] %MOD


print(mod_comb_k(a+b, a, MOD))

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

typedef long long ll;
#define rep(i,n) for(int (i)=0;(i)<(int)(n);++(i))
#define each(itr,c) for(__typeof(c.begin()) itr=c.begin(); itr!=c.end(); ++itr)
#define all(x) (x).begin(),(x).end()
#define mp make_pair
#define pb push_back
#define fi first
#define se second

int main()
{
    int m,a,b;
    while(cin >>m >>a >>b,m)
    {
        vector<int> p(m);
        rep(i,m) cin >>p[i];

        int ans=b;
        int gap=0;

        //????????????i?????¨??????
        for(int i=b; i>=a; --i)
        {
            int tgap=p[i-1]-p[i];
            if(tgap>gap)
            {
                gap=tgap;
                ans=i;
            }
        }

        cout << ans << endl;
    }
    return 0;
}

Measured memory_bytes: 3036
#include <stdio.h>
#include <math.h>

int main(){
    double pi = 3.141592653589;
    double r;
    scanf("%lf", &r);
    double menseki;
    double enshu;
    menseki = pow(r, 2) * pi;
    enshu = 2 * r * pi;
    printf("%f %f\n", menseki, enshu);
}


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

using namespace std;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    string n;
    cin >> n;
    int len = n.size();
    if (n[len-1]== '2' || n[len-1]== '4' || n[len-1]== '5' || n[len-1]== '7' || n[len-1]== '9') cout << "hon" << '\n';
    else if (n[len-1]=='0' || n[len-1]=='1' || n[len-1]=='6' || n[len-1]=='8') cout << "pon" << '\n';
    else if (n[len-1]=='3') cout << "bon" << '\n';
    return 0;
}

Measured memory_bytes: 3640
from itertools import combinations

N = int(input())
d = list(map(int, input().split(" ")))

def HP(tako1, tako2):
    return tako1*tako2

total_HP = 0
tako_combos = combinations(d, 2)
for takos in tako_combos:
    tako1 = takos[0]
    tako2 = takos[1]

    total_HP += HP(tako1, tako2)

print(total_HP)


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

int main() {

	int A, B;
	cin >> A >> B;

	int Add, Sub, Mul;
	Add = A + B;
	Sub = A - B;
	Mul = A * B;

	cout << max(Add, max(Sub, Mul)) << endl;

	return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
int main()
{
    int n=0,i,soma=0;
    scanf("%d",&n);
    int a=n;
    while(n>0)
    {
        soma+=n%10;
        n=n/10;

    }

    if(a%soma==0)
    {
        printf("Yes\n");
    }
    else if(a%soma!=0)
    {
        printf("No\n");
    }


    return 0;
}


Measured memory_bytes: 128
using System;
using System.Linq;
using System.Collections.Generic;

namespace ABC
{
    class ProgramA
    {
        static void Main(string[] args)
        {
            var k = long.Parse(Console.ReadLine());
            var inputs = Console.ReadLine().Split(" ");
            var a = long.Parse(inputs[0]);
            var b = long.Parse(inputs[1]);
            var result = false;

            for (var i = a; i <= b; i++)
            {
                if (i % k == 0)
                {
                    result = true;
                    break;
                }
            }
            Console.WriteLine(result ? "OK" : "NG");
        }
    }
}


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

int main(){
  int N,K;
  int i = 0;
  int sum = 0;
  cin >> N >> K;
  
  int A = 0; //タイプAの総移動距離
  int B = 0; //タイプBの総移動距離
  
  for(i = 0;i < N; i++){
    int x;
    cin >> x;
    
    A = 2 * x;
    B = 2 * (K - x);
    if (A < B){
      sum += A;
    }
    else{
      sum += B;
    }
  }
  cout << sum << endl;
}

Measured memory_bytes: 3636
#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++)

int main(){
    ll n;
    cin >> n;
    vector<ll> a(n), acc(n+1, 0);
    rep(i, 0, n) cin >> a[i];
    sort(a.begin(), a.end());
    rep(i, 0, n) acc[i+1] = acc[i] + a[i];
    ll ans = 1;
    rep(i, 1, n) {
        if(a[i] <= 2 * acc[i]) {
            ans++;
        } else {
            ans = 1;
        }
    }
    cout << ans << endl;
    return 0;
}

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

using namespace std;

typedef long long int 	ll;
typedef pair<int,int>   ii;
typedef vector< ii >   vii;
typedef vector<int>     vi;
typedef vector< vi >   vvi;

#define mm 100005
#define nn 1005
#define mod 1000000007
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define sz(a) (int)(a.size())
#define all(a) a.begin(),a.end()
#define forn(i, n) for(int i = 0; i < int(n); ++i)
#define rep(i, a, b) for(int i = int(a); i <= int(b); ++i)
#define cases int t;  cin>>t;   while(t--)
#define check(a,n) forn(iiii,int(n)) cout<<ll(a[iiii])<<" "; cout<<endl
#define fast_io ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
map<int,int> map1;

int main()
{
    fast_io;
    int n;
    int a;
    cin>>n;
    forn(i,n) cin>>a,map1[-a]++;
    ll pro=1,flag=0;
    for(auto i:map1)
    {
        if(i.ss>=4) return cout<<max(1LL*i.ff*i.ff,1LL*pro*i.ff),0;
        else if(i.ss>=2) pro*=1LL*i.ff,flag++;
        if(flag==2) return cout<<pro,0;
    }
    cout<<0;
    return 0;
}


Measured memory_bytes: 4992
#include <iostream>
#include <bitset>
#include <fstream>
#include <string>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <vector>
#include <algorithm>
#include <numeric>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <deque>
#include <functional>
#include <cctype>
#include <list>
#include <limits>
//#include <boost/multiprecision/cpp_int.hpp>

const double EPS = (1e-10);


using namespace std;
using Int = long long;
//using namespace boost::multiprecision;

const Int MOD = 1000000007;

Int mod_pow(Int x, Int n) {
    Int res = 1;
    while(n > 0) {
        if(n & 1) res = (res * x) % MOD; //ビット演算(最下位ビットが1のとき)
        x = (x * x) % MOD;
        n >>= 1; //右シフト(n = n >> 1)
    }
    return res;
}

vector<pair<int, int>> primeFactorization(int n) {
    int k = n;
    vector<pair<int, int>> ret;
    for (int i = 2; i <= sqrt(n); i++) {
        int cnt = 0;
        while(k % i == 0) {
            k /= i; // 重複を許さないならここを while に
            cnt++;
        }
        if (cnt) ret.push_back({i, cnt});
    }
    if(k > 1) ret.push_back({k, 1});
    return ret;
}

const int MAXN = 200000;
long long int fact[MAXN], inv[MAXN];

void init_fact() {
    fact[0] = 1;
    for(int i=1; i<MAXN; i++) {
        fact[i] = (fact[i-1] * i) % MOD;
    }

    inv[MAXN - 1] = mod_pow(fact[MAXN - 1], MOD-2);
    for(int i=MAXN - 2; i>=0; i--) {
        inv[i] = (inv[i+1] * (i+1)) % MOD;
    }
}

Int comb(int n, int r) {
    if(r < 0 || n < r) return 0;
    return fact[n] * inv[n-r] % MOD * inv[r] % MOD;
}

int main(){
    cin.tie(0);
    
    init_fact();
    int N, M;
    cin >> N >> M;
    Int ans = 1;
    auto factor = primeFactorization(M);
    for (int i = 0; i < factor.size(); i++){
        int cnt = factor[i].second;
        Int tmp = comb(N+cnt-1, cnt);
        tmp %= MOD;
        ans = (ans * tmp) % MOD;
    }
    cout << ans << endl;
} 


Measured memory_bytes: 3328
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#define file(s) freopen(s".in", "r", stdin), freopen(s".out", "w", stdout);
using namespace std;
typedef long long ll;
const int MAXN = 200005;
const int MAXM = 4005;
const int MAXD = 2000;
const int MOD = 1e9 + 7;
int n;
int A[MAXN], B[MAXN];
int f[MAXM][MAXM], ans;
int jc[MAXM << 1] = {1};

int quick_pow(int a, int x) {
    int res = 1;
    while (x) {
        if (x & 1)
            res = 1ll * res * a % MOD;
        a = 1ll * a * a % MOD, x >>= 1;
    }
    return res;
}

int main() {
    scanf("%d", &n);
    for (int i = 1; i <= n; i++) {
        scanf("%d %d", &A[i], &B[i]);
        f[MAXD - A[i]][MAXD - B[i]]++;
    }
    for (int i = 0; i <= 4000; i++)
        for (int j = 0; j <= 4000; j++) {
            f[i + 1][j] = (f[i + 1][j] + f[i][j]) % MOD;
            f[i][j + 1] = (f[i][j + 1] + f[i][j]) % MOD;
        }
    for (int i = 1; i <= n; i++)
        ans = (ans + f[A[i] + MAXD][B[i] + MAXD]) % MOD;
    for (int i = 1; i <= 8000; i++)
        jc[i] = 1ll * jc[i - 1] * i % MOD;
    for (int i = 1; i <= n; i++)
        ans = (ans - 1ll * jc[(A[i] + B[i]) << 1] * quick_pow(jc[A[i] << 1], MOD - 2) % MOD * quick_pow(jc[B[i] << 1], MOD - 2)
               % MOD + MOD) % MOD;
    ans = 1ll * ans * 500000004 % MOD;
    printf("%d", ans);
    return 0;
}


Measured memory_bytes: 64384
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <map>
#include <numeric>
#include <set>
#include <sstream>
#include <string>
#include <vector>
#include <cmath>
using namespace std;

#define FOR(i,s,e) for (int i = int(s); i < int(e); i++)
#define FORIT(i,c) for (typeof((c).begin()) i = (c).begin(); i != (c).end(); i++)
#define ISEQ(c) (c).begin(), (c).end()

int main(){
	int N,M;
	cin >> N >> M;

	bool hasRed[N+1];
	int num[N+1];
	num[1] = 1;
	hasRed[1] = true;
	FOR(i,2,N+1){
		num[i] = 1;
		hasRed[i] = false;
	}

	FOR(i,0,M){
		int x,y;
		cin >> x >> y;
		if(hasRed[x]) hasRed[y] = true;

		num[x]--;
		num[y]++;
		if(num[x] == 0) hasRed[x] = false;
	}
	int ret = 0;
	FOR(i,1,N+1){
		if (hasRed[i]) ret++;

	}
	cout << ret << endl;

	return 0;
}


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

#define rep(i,n) for(int i=0;i<(n);++i)
#define loop for(;;)
#define trace(var) cerr<<">>> "<<#var<<" = "<<var<<endl;
#define inf (1e9)
#define eps (1e-9)

template<class T> inline
ostream& operator<<(ostream&os, vector<T> v) {
  if (v.size() == 0) {
    os << "(empty)";
    return os;
  }
  os << v[0];
  for (int i=1, len=v.size(); i<len; ++i) os << ' ' << v[i];
  return os;
}

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

void solve(vector<vector<int>> f) {
  int r = 0;
  rep (i, 12) {
    rep (j, 12) {
      if (f[i][j] == 0) continue;
      ++r;
      queue<pair<int, int>> q;
      q.push({i,j});
      while (not q.empty()) {
        auto p = q.front(); q.pop();
        if (f[p.first][p.second] == 0) continue;
        f[p.first][p.second] = 0;
        rep (k, 4) {
          int i2 = p.first + dx[k],
              j2 = p.second + dy[k];
          if (i2 < 0 or j2 < 0 or i2 >= 12 or j2 >= 12) continue;
          if (f[i2][j2] == 0) continue;
          q.push({i2, j2});
        }
      }
    }
  }
  cout << r << endl;
}

int main() {
  string s;
  while (cin) {
    vector<vector<int>> f(12, vector<int>(12));
    rep (i, 12) {
      getline(cin, s);
      rep (j, 12) {
        f[i][j] = s[j] == '1';
      }
    }
    solve(f);
    getline(cin, s);
  }
  return 0;
}

Measured memory_bytes: 1200