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


#define li          long long int
#define rep(i,to)   for(li i=0;i<((li)(to));i++)
#define repp(i,start,to)    for(li i=(li)(start);i<((li)(to));i++)
#define pb          push_back
#define sz(v)       ((li)(v).size())
#define bgn(v)      ((v).begin())
#define eend(v)     ((v).end())
#define allof(v)    (v).begin(), (v).end()
#define dodp(v,n)       memset(v,(li)n,sizeof(v))
#define bit(n)      (1ll<<(li)(n))
#define mp(a,b)     make_pair(a,b)
#define rin rep(i,n)
#define EPS 1e-12
#define ETOL 1e-8
#define MOD 1000000007
typedef pair<li, li> PI;

#define INF bit(60)

#define DBGP 1


#define idp if(DBGP)
#define F first
#define S second
#define p2(a,b)     idp cout<<a<<"\t"<<b<<endl
#define p3(a,b,c)       idp cout<<a<<"\t"<<b<<"\t"<<c<<endl
#define p4(a,b,c,d)     idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<endl
#define p5(a,b,c,d,e)       idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<endl
#define p6(a,b,c,d,e,f)     idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<"\t"<<f<<endl
#define p7(a,b,c,d,e,f,g)       idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<"\t"<<f<<"\t"<<g<<endl
#define p8(a,b,c,d,e,f,g,h)     idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<"\t"<<f<<"\t"<<g<<"\t"<<h<<endl
#define p9(a,b,c,d,e,f,g,h,i)       idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<"\t"<<f<<"\t"<<g<<"\t"<<h<<"\t"<<i<<endl
#define p10(a,b,c,d,e,f,g,h,i,j)        idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<"\t"<<f<<"\t"<<g<<"\t"<<h<<"\t"<<i<<"\t"<<j<<endl
#define foreach(it,v)   for(__typeof((v).begin()) it=(v).begin(); it!=(v).end(); ++it)
#define p2p(x)      idp p2((x).F, (x).S)
#define dump(x,n)   idp{rep(i,n){cout<<x[i]<<" ";}puts("");}
#define dump2(x,n)  idp{rep(i,n){cout<<"["<<x[i].F<<" , "<<x[i].S<<"] ";}puts("");}
#define dumpi(x)    idp{foreach(it, x){cout<<(*it)<<" ";}puts("");}
#define dumpi2(x)   idp{foreach(it, x){cout<<"["<<(it)->F<<" , "<<(it)->S<<"] ";}puts("");}

#define read2d(a,w,h)   rep(i,h)rep(j,w)cin>>a[i][j]
#define dump2d(a,w,h)   rep(i,h){rep(j,w)cout<<a[i][j]<<" ";puts("");}

typedef pair<li, li> PI;

li d;
li c[111];
li s[444][33];

li last[33];

int main() {
    cin >> d;
    rep(i, 26) {
        cin >> c[i];
        last[i] = -1;
    }
    rep(i, d) {
        rep(j, 26) {
            cin >> s[i][j];
        }
    }

    rep(i, d) {
        li ma = -INF;
        li mai = -1;
        rep(j, 26) {
            li score = s[i][j] + c[j] * (i - last[j]);
            if (score > ma) {
                ma = score;
                mai = j;
            }
        }
        cout << mai + 1 << endl;
        last[mai] = i;
    }


    return 0;
}

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

int main(){
  int v[10];
  int temp;
  int i,j;

  for(i=0;i<10;i++)
    cin>>v[i];

  for(i=0;i<9;i++)
    for(j=0;j<9;j++)
      if(v[j]>v[j+1]){
	temp = v[j];
	v[j] =v[j+1];
	v[j+1] = temp;
      }
  for(i=9;i>6;i--)
    cout<<v[i]<<endl;

  return 0;
}

  
    

Measured memory_bytes: 1160
from itertools import accumulate

N, M = map(int, input().split())
LRs = [tuple(map(int, input().split())) for _ in range(M)]

cards = [0]*N
for L, R in LRs:
    cards[L-1] += 1
    if R < N:
        cards[R] -= 1

cards = list(accumulate(cards))

print(cards.count(M))


Measured memory_bytes: 21492
#include <bits/stdc++.h>
using namespace std;
#define ll long long
const int MOD=1e9+7;
const long double Pi=acos(-1);
vector<long long> fact_inv, inv, Com;
void init_nCk(ll n,ll k){
  fact_inv.resize(k+5);
  inv.resize(k+5);
  fact_inv[0]=fact_inv[1]=1;
  inv[1]=1;
  for(ll i=2;i< k+5;i++){
    inv[i]=MOD-inv[MOD%i]*(MOD/i)%MOD;
    fact_inv[i]=fact_inv[i-1]*inv[i]%MOD;
  }
  Com.resize(k+5);
  Com[0]=1;
  for (ll i=1;i<k+5;i++){
    Com[i]=Com[i-1]*((n-i+1)*inv[i]%MOD)%MOD;
  }
}
ll nCk(ll k){
    assert(!(k<0));
    return Com[k];
}
int main(){
  ll X,Y;
  cin>>X>>Y;
  //1,2
  //2,1
  ll ans=0;
  ll ansx=0;
  ll ansy=0;
  for(ll i=0;i<=X;i++){
    ll leftx=X-i;
    ll lefty=Y-2*i;
    if(leftx<0 || lefty<0){break;}
    if(leftx%2==0 && leftx/2==lefty){
      ansx=i;
      ansy=Y-2*i;
    }
  }
  //cout<<ansx<<" "<<ansy<<endl;
  init_nCk((ll)ansx+ansy,(ll)ansx);
  if(ansx!=0 || ansy!=0){cout<<nCk((ll)ansx);}
  else{cout<<0<<endl;}
}

Measured memory_bytes: 10112
#include <bits/stdc++.h>
#define FIO ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define endl "\n"

using namespace std;

const int N = int(10e5 + 5);

int main() {
	FIO
	int X; cin >> X;
	cout << (10 -(X/200)) << endl;
	return 0;
}

Measured memory_bytes: 3588
using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;


public class A
{
	public static void Main()
	{
		string S = Console.ReadLine();
		int flag = 0;
		for(int i = 0; i < 3; i++)
			flag |= (1 << (int)(S[i] - 'A'));

		Console.WriteLine((flag == 7) ? "Yes" : "No");
	}
}





Measured memory_bytes: 13140
#include <bits/stdc++.h>
#define f first
#define s second
#define mp make_pair
#define pb push_back
#define lp(i,a,n) for(int i=(a);i<=(int)(n);++i)
#define lpd(i,a,n) for(int i=(a);i>=(int)(n);--i)
#define mem(a,b) memset(a,b,sizeof a)
#define all(v) v.begin(),v.end()
#define println(a) cout <<(a) <<endl
#define sz(x) ((int)(x).size())
#define readi(x) scanf("%d",&x)
#define read2i(x,y) scanf("%d%d",&x,&y)
#define read3i(x,y,z) scanf("%d%d%d",&x,&y,&z)
#define mod 1000000007
#define eps 1e-8
#define infi 1000000000
#define infll 1000000000000000000ll
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vll;
typedef set<int> si;
typedef map<int,int> mii;

const int N = 100002;
int n;
vvi g(N);

int dfs(int i){
    if(!sz(g[i])) return 0;
    multiset<int> st;
    for(int j : g[i]) st.insert(dfs(j));
    int l = -1, ret = 0;
    for(int j : st){
        if(j > l) l = j+1;
        else ++l;
        ret = max(ret, l);
    }
    return ret;
}

int main(){
    readi(n);
    lp(i,2,n){
        int p;
        readi(p);
        g[p].pb(i);
    }

    cout <<dfs(1);
}

/*
freopen("input.txt","r",stdin);
freopen("output.txt","w",stdout);
*/


Measured memory_bytes: 15104
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <cstring>
#include <string>
#include <vector>
#include <queue>
#include <cmath>
#include <stack>
#include <set>
#include <map>
typedef long long ll;
typedef unsigned int uint;
using namespace std;

class UnionFind{
public:
  vector<int> par;
  vector<int> rank;
  vector<int> sz;
  int N;

  UnionFind(int n){N=n;}

  //初期化
  void init(){
    for(int i=0;i<N;i++){
      par.push_back(i);
      rank.push_back(0);
      sz.push_back(1);
    }
  }

  //木の根を求める
  int find(int x){
    if(par[x]==x) return x;
    else{
      par[x]=find(par[x]);
      return par[x];
    }
  }

  //xとyの集合の併合
  void unite(int x, int y){
    x=find(x);
    y=find(y);
    if(x == y) return;

    if(rank[x] < rank[y]){
      par[x] = y;
      sz[y] += sz[x];
    }else{
      par[y] = x;
      sz[x] += sz[y];
      if(rank[x] == rank[y]) rank[x]++;
    }
  }

  //x,yが同じ集合にあるか
  bool same(int x, int y){
    return find(x) == find(y);
  }

  //xの木のサイズ
  int size(int x){
    return sz[find(x)];
  }
};

//====================================================

int main(){
  int N,K,L;
  cin >> N >> K >> L;

  UnionFind ufa = UnionFind(N);
  UnionFind ufb = UnionFind(N);
  ufa.init();
  ufb.init();

  for(int i=0;i<K;i++){
    int a,b;
    cin >> a >> b;
    a--; b--;
    ufa.unite(a,b);
  }
  for(int i=0;i<L;i++){
    int a,b;
    cin >> a >> b;
    a--; b--;
    ufb.unite(a,b);
  }

  pair<pair<int,int>,pair<int,int>> p[N];//道路 鉄道　ind cnt
  for(int i=0;i<N;i++){
    p[i].first.first = ufa.find(i);
    p[i].first.second = ufb.find(i);
    p[i].second.first = i;
    p[i].second.second = 1;
  }
  
  sort(p,p+N);

  int s=0,t=0;
  for(int i=1;i<N;i++){
    if(p[i].first.first == p[i-1].first.first
        && p[i].first.second == p[i-1].first.second){
      s++;
    } else {
      for(int j=t;j<=i-1;j++) p[j].second.second += s;
      s = 0;
      t = i;
    }

    if(i==N-1){
      for(int j=t;j<=i;j++) p[j].second.second += s;
    }
  }

  int cnt[N];
  for(int i=0;i<N;i++){
    cnt[p[i].second.first] = p[i].second.second;
  }

  for(int i=0;i<N;i++){
    cout << cnt[i] << " ";
  }
  cout << endl;
  return 0;
}

Measured memory_bytes: 9312
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <numeric>

#define REP(i, a, b) for (int i = int(a); i < int(b); i++)
using namespace std;
typedef long long int ll;

// clang-format off
#ifdef _DEBUG_
#define dump(...) do{ cerr << __LINE__ << ":\t" << #__VA_ARGS__ << " = "; PPPPP(__VA_ARGS__); cerr << endl; } while(false)
template<typename T> void PPPPP(T t) { cerr << t; }
template<typename T, typename... S> void PPPPP(T t, S... s) { cerr << t << ", "; PPPPP(s...); }
#else
#define dump(...)
#endif
template<typename T> vector<T> make_v(size_t a, T b) { return vector<T>(a, b); }
template<typename... Ts> auto make_v(size_t a, Ts... ts) { return vector<decltype(make_v(ts...))>(a, make_v(ts...)); }
template<typename T>
bool chmin(T &a, T b) { if (a > b) {a = b; return true; } return false;}
template<typename T>
bool chmax(T &a, T b) { if (a < b) {a = b; return true; } return false;}
// clang-format on

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    string s;
    cin >> s;
    int k;
    cin >> k;
    int n = s.size();
    auto dp = make_v(n + 1, k + 1, 2, 0LL);
    dp[0][0][1] = 1;
    REP(i, 0, n) {
        REP(j, 0, k + 1) {
            REP(t, 0, 2) {
                int mx = (t ? s[i] + 1 : '9' + 1);
                REP(a, '0', mx) {
                    if (a == '0') {
                        dp[i + 1][j][t && a + 1 == mx] += dp[i][j][t];
                    } else {
                        if (j != k) {
                            dp[i + 1][j + 1][t && a + 1 == mx] += dp[i][j][t];
                        }
                    }
                }
            }
        }
    }
    ll ans = 0;
    REP(i, 0, 2) {
        ans += dp[n][k][i];
    }
    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int temp = sc.nextInt();
		int a = temp*sc.nextInt();
		int b = sc.nextInt();
		if(a>b)System.out.println(b);
		else System.out.println(a);

	}

}


Measured memory_bytes: 22612
#include <stdio.h>

int main(){
    int a,b,c,cnt=0;
    
    scanf("%d%d%d",&a,&b,&c);
    
    for(a=a;a<=b;a++){
        if(c%a==0)cnt+=1;
    }
    printf("%d\n",cnt);
    
    return 0;
}


Measured memory_bytes: 2144
#include<iostream>
#include<string>
#include<cstdio>
#include<algorithm>
#include<cstdlib>
#include<cmath>
#include<vector>
#include<utility>
#include<queue>
#include<stack>
#include<set>
#include<map>
#include<unordered_set>
#include<bitset>
using namespace std;
//#define MODE 1
#ifdef MODE
#define DEB(X) cout<< #X <<": "<<X<<" ";
#define ARDEB(i,X) cout<< #X <<"["<<i<<"]: "<<X[i]<<" ";
#define END cout<<endl;
#else
#define DEB(X) {}
#define ARDEB(i,X) {}
#define END {}
#endif
typedef long long int ll;
#define int long long
typedef pair<int,int> P;
struct edge{int to,cost;};
#define REP(i,n) for(int i=0;i<(n);i++)
const int INF=100000000000000000;

signed main(){
	string S;
	cin>>S;
	int Y=stoll(S.substr(0,4));
	int M=stoll(S.substr(5,2));
	int D=stoll(S.substr(8,2));
	if(Y>2019){
		cout<<"TBD"<<endl;
	}
	else if(M>4){
		cout<<"TBD"<<endl;
	}
	else if(D>30){
		cout<<"TBD"<<endl;
	}
	else{
		cout<<"Heisei"<<endl;
	}
	return 0;
}


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

using namespace std;

typedef long long ll;

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int X,Y,A,B,C;
    cin>>X>>Y>>A>>B>>C;
    ll* red=new ll[A];
    ll* green=new ll[B];
    ll* cless=new ll[C];
    for(int i=0;i<A;i++){
        cin>>red[i];
    }
    for(int i=0;i<B;i++){
        cin>>green[i];
    }
    for(int i=0;i<C;i++){
        cin>>cless[i];
    }
    sort(red,red+A,greater<int>());
    sort(green,green+B,greater<int>());
    sort(cless,cless+C,greater<int>());
    vector<ll> v;
    int x=min(X,A);
    for(int i=0;i<x;i++){
        v.push_back(red[i]);
    }
    int y=min(Y,B);
    for(int i=0;i<y;i++){
        v.push_back(green[i]);
    }
    int z=min((X+Y),C);
    for(int i=0;i<z;i++){
        v.push_back(cless[i]);
    }
    sort(v.begin(),v.end(),greater<int>());
    ll ans=0;
    for(int i=0;i<X+Y;i++){
        ans=ans+v[i];
    }
    cout<<ans;
    return 0;
}

Measured memory_bytes: 8816
//	Totally unrelated and not AT ALL stolen from hohohaha's, generic_placeholder_name's or katoriyuu's template
#include <bits/stdc++.h>

using namespace std;

#pragma GCC optimize("O3")
#pragma GCC target("avx")
//#pragma GCC optimize("unroll-loops")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")

#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define gcd __gcd
#define rep(i,s,end) for(int i = (s); i <  (end); ++i)
#define rep0(i, end) for(int i =   0; i <= (end); ++i)
#define rep1(i, end) for(int i =   1; i <= (end); ++i)
#define lb lower_bound
#define ub upper_bound

#define vt vector
#define endl "\n"

#define fileopen(filename, in_type, out_type) if (fopen(filename in_type, "r")) {freopen(filename in_type, "r", stdin);freopen(filename out_type, "w", stdout);}
#define local_input(x) if (x && fopen("input.txt","r")) freopen("input.txt","r",stdin);
#define fastio ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL)

#define fscan(x)   scanf("%d",  &x)
#define fscandb(x) scanf("%lf", &x)
#define fscanll(x) scanf("%lld",&x)
//	Until next time, remember:
//			You are closer than you think.
//						_Dan Lok_

#define db double
#define ll long long
typedef pair<int,int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<bool> vb;
typedef vector<pii> vpii;
typedef vector<pll> vpll;
#define pi 3.1415926535897932	//faster than pi = acos(-1); but sometimes doesn't work?
//	srand(chrono::steady_clock::now().time_since_epoch().count());
//	freopen("input.txt","r",stdin);

#define lnode id<<1
#define rnode id<<1|1
#define mn 100002

int a[2][mn];
void input(const int& o){
	string s; cin >> s; a[o][0] = 0; rep(i,0,s.length()){
		a[o][i+1] = a[o][i] + (s[i] == 'A' ? 2 : 1);
	}
	return;
}
signed main()
{
	fastio;
	input(0); input(1); int q; cin >> q; while(q--){
		int l,r,l1,r1; cin >> l >> r >> l1 >> r1;
		cout << ((a[0][r]-a[0][l-1] - a[1][r1]+a[1][l1-1]) % 3 
		? "NO\n" : "YES\n");
	}
	return 0;
}
// with the aura of Dora, AC!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!1!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
// Why is there a one in my row of exclamation marks?




Measured memory_bytes: 4580
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#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)))
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<pair<int, int>> vpii;
typedef pair<int, int> pii;
#define PB push_back
#define EB emplace_back
#ifdef LOCAL_DEBUG
#define DEBUG(...) printf(__VA_ARGS__)
#else
#define DEBUG(...)
#endif

#define N 112345
#define MOD 1'000'000'007LL
ll a[13][N]={};
char s[N];
void ad(int i, int j, int k){
	a[(j*10+k)%13][i+1] += a[j][i];
}

int main(){
	scanf("%s", s);
	int n = strlen(s);
	a[0][0] = 1;
	REP(i, n){
		if(s[i] == '?'){
			REP(j, 13) REP(k, 10) ad(i, j, k);
		} else {
			REP(j, 13) ad(i, j, s[i]-'0');
		}
		REP(j, 13) a[j][i+1] %= MOD;
	}
	printf("%lld\n", a[5][n]);
}


Measured memory_bytes: 11392
#include <iostream>
#include <stdio.h>
#include <vector>
#include <algorithm>
#include <cmath>
#define rep(i,cc,n) for(int i=cc;i<=n;++i)
#define drep(i,cc,n) for(int i=cc;i>=n;--i)
typedef long long ll;
using namespace std;
int main(){
    int a,b;
    cin>>a>>b;
    if((a+b)%2==0) cout<<(a+b)/2<<endl;
    else cout<<(a+b)/2+1<<endl;
    return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
int main(void) {

	int a = 0;
	int r, g, b;

	scanf("%d %d %d", &r, &g, &b);

	a = 100 * r + 10 * g + b;

	if (a % 4 == 0)printf("YES\n");
	else printf("NO\n");

	return 0;
}

Measured memory_bytes: 128
N, M = map(int, input().split())
students = [input().split() for i in range(N)]
checkpoints = [input().split() for i in range(M)]

ans = []
for s in students:
  dist = float("inf")
  nearest = -1
  for idx, c in enumerate(checkpoints):
    d_i = abs(int(s[0])-int(c[0])) + abs(int(s[1])-int(c[1]))
    if dist > d_i:
      dist = d_i
      nearest = idx+1
  ans.append(nearest)
for a in ans:
  print(a)



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

void add(int *bit,int index,int v){
  const int n=bit[0];
  for(int i=index;i<=n;i+=i&-i) bit[i]+=v;
}

int sum(int *bit,int index){
  int res=0;
  for(int i=index;i>0;i-=i&-i) res+=bit[i];
  return res;
}

int getSum(int *bit,int l,int r){
  return sum(bit,r)-sum(bit,l-1);
}

void run(void){
  int n,q;
  scanf("%d%d",&n,&q);
  int *bit=(int *)calloc(n+1,sizeof(int));
  bit[0]=n;
  while(q--){
    int c,x,y;
    scanf("%d%d%d",&c,&x,&y);
    if(c==0){
      add(bit,x,y);
    } else {
      printf("%d\n",getSum(bit,x,y));
    }
  }
}

int main(void){
  run();
  return 0;
}



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


int main() {
    string S;
    cin >> S;
    int Q;
    cin >> Q;
    bool rev = false;
    string head = "", tail = "";
    for (int z = 0; z < Q; z++) {
        int T;
        cin >> T;
        if (T == 1){
            rev = !rev;
        }
        if (T == 2) {
            int F;
            cin >> F;
            char c;
            cin >> c;
            if ((F == 1) == (!rev)) {
                head += c;
            }else {
                tail += c;
            }
        }
    }
    reverse(head.begin(), head.end());
    if (!rev) {
        cout << head << S << tail << endl;
    }else {
        reverse(head.begin(), head.end());
        reverse(S.begin(), S.end());
        reverse(tail.begin(), tail.end());
        cout << tail << S << head << endl;
    }
    return 0;
}


Measured memory_bytes: 1088
#include <bits/stdc++.h>
using namespace std;
#define forn(i, n) for (int i = 0; i < (int)(n); ++i)
#define fore(i, b, e) for (int i = (int)(b); i <= (int)(e); ++i)
#define ford(i, n) for (int i = (int)(n) - 1; i >= 0; --i)
#define pb push_back
#define fi first
#define se second
#define all(x) (x).begin(), (x).end()
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef long long i64;
typedef unsigned long long u64;
typedef long double ld;
typedef long long ll;

int main() {
#ifdef LOCAL
//     freopen("a.in", "r", stdin);
#endif

    int n;
    cin >> n;
    int x = 0, y = 0;
    forn(i, n) {
        cin >> x;
        if (x%2) y ^= 1;
    }
    if (y) cout << "NO\n";
    else cout << "YES\n";


#ifdef LOCAL
    cerr << "Time elapsed: " << clock() / 1000 << " ms" << endl;
#endif
    return 0;
}


Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main()
{
	int n;
	int x;
	int count = 0;
	int min;
	cin >> n >> x;
	while (!((x >> count++) & 1));
	min = --count;
	for (int i = 1; i < n; i++) {
		count = 0;
		cin >> x;
		while (!((x >> count++) & 1));
		if(--count < min)
			min = count;
	}
	cout << min << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i=0; i<n; i++)
#define rrep(i, n) for(int i=n-1; i>=0; i--)
#define FOR(i, a, b) for(int i=a; i<b; i++)
#define ALL(v) v.begin(),v.end()
#define pb push_back
#define eb emplace_back
#define mp make_pair
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<int, ll> pil;
typedef pair<ll, int> pli;
typedef pair<ll, ll> pll;
const int INF = 1e9;
const ll LLINF = 1e18;
const ll MOD = 1e9+7;
const double EPS = 1e-10;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

int h, w, c[10][10], a[205][205];

int main() {
    cin >> h >> w;
    rep(i, 10) rep(j, 10) cin >> c[i][j];
    rep(i, h) rep(j, w) cin >> a[i][j];

    // Floyd-Warshall
    rep(k, 10) {
        rep(i, 10) {
            rep(j, 10) {
                chmin(c[i][j], c[i][k] + c[k][j]);
            }
        }
    }

    int ans = 0;
    rep(i, h) {
        rep(j, w) {
            if (a[i][j] == -1) continue;
            ans += c[a[i][j]][1];
        }
    }
    cout << ans << endl;
}


Measured memory_bytes: 384
#include <iostream>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
using namespace std;
int main (void){
    int L;
    int N;
    int X[1000],W[1000];
    int g=0;
    scanf("%d %d",&L,&N);
    for (int i = 0; i < N; ++i)
    {
    scanf("%d %d",&X[i],&W[i]);
    }
    for (int i = 0; i < N; ++i)
    {
       g+=X[i]*W[i];
    }
    if(g==0) printf("0\n");
    else if(g>0) {
        printf("%d\n",abs(g));
        for (int i = 0; i < abs(g); ++i)
        {
            printf("-1 1\n");
        }
    }else{
        printf("%d\n",abs(g));
        for (int i = 0; i < abs(g); ++i)
        {
            printf("1 1\n");
        }
    }
    return 0;
}

Measured memory_bytes: 1204
#include <bits/stdc++.h>
using namespace std;
#include <math.h>
int main() {
 int A,B,C;
 cin>>A>>B>>C;
 if((max({A,B,C})*3-(A+B+C))%2==0){cout<<(max({A,B,C})*3-(A+B+C))/2<<endl;}
 else{cout<<((max({A,B,C})+1)*3-(A+B+C))/2<<endl;}
 return 0;}

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

int main() {
	// your code goes here
	int n;
	cin>>n;
	int f=0;
	while(n>0)
	{
		if(n%10 ==7 )
		{
			f=1;break;
		}
		n=n/10;
	}
	if(f==1)
	 cout<<"Yes"<<endl;
	else cout<<"No"<<endl; 
	return 0;
}

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

#define REP(i,s,n) for(int i=s;i<n;++i)
#define rep(i,n) REP(i,0,n)
#define fst first
#define snd second
#define pb push_back
#define ALL(x) x.begin(),x.end()
#define EPS (1e-9)
#define equals(a,b) (fabs((a)-(b))<EPS)

using namespace std;

bool LT(double a,double b) { return !equals(a,b) && a < b; }
bool LTE(double a,double b) { return equals(a,b) || a < b; }

const string YES = "";
const string NO  = "";

typedef long long ll;
typedef pair<int,int> ii;

// A

void solve() {

}

int main() {
  int x;
  cin >> x;
  if( x >= 30 ) puts("Yes");
  else puts("No");
  
  return 0;
}


Measured memory_bytes: 3620
#include <bits/stdc++.h>
#include <algorithm>
#include <iostream>
#include <stdlib.h>
using namespace std;

#define INF 100000000001
#define INFS 1000000
#define PI 3.141592653589793238

int main() {
    int n;
    cin >> n;
    if(n%1000!=0)cout << 1000-(n%1000) << endl;
    else cout << 0 << endl;

    return 0;
}

Measured memory_bytes: 3548
using System;
using System.Text;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
using static System.Console;
using static System.Math;

namespace AtCorder
{
    class Program
    {
        static void Main(string[] args)
        {
            new Program().Solve(new ConsoleInput(Console.In, ' '));
        }
        public void Solve(ConsoleInput cin)
        {
            var N = cin.ReadInt;
            var D = cin.ReadInt;
            var X = new int[N, D];
            for(int i = 0; i < N; i++)
            {
                for(int j = 0; j < D; j++)
                {
                    X[i, j] = cin.ReadInt;
                }
            }
            var ans = 0;
            for(int i = 0; i < N; i++)
            {
                for(int j = i+1; j < N; j++)
                {
                    double tmp = 0;
                    for(int k = 0; k < D; k++)
                    {
                        tmp += Pow(X[i, k] - X[j, k], 2);
                    }
                    tmp = Sqrt(tmp);
                    var tmpD = (int)tmp;
                    if(tmp - tmpD == 0)
                    {
                        ans++;
                    }
                }
            }
            WriteLine(ans);
        }
    }

    public class ConsoleInput
    {
        private readonly System.IO.TextReader _stream;
        private char _separator = ' ';
        private Queue<string> inputStream;
        public ConsoleInput(System.IO.TextReader stream, char separator = ' ')
        {
            this._separator = separator;
            this._stream = stream;
            inputStream = new Queue<string>();
        }
        public string Read
        {
            get
            {
                if (inputStream.Count != 0) return inputStream.Dequeue();
                string[] tmp = _stream.ReadLine().Split(_separator);
                for (int i = 0; i < tmp.Length; ++i)
                    inputStream.Enqueue(tmp[i]);
                return inputStream.Dequeue();
            }
        }
        public string ReadLine { get { return _stream.ReadLine(); } }
        public int ReadInt { get { return int.Parse(Read); } }
        public long ReadLong { get { return long.Parse(Read); } }
        public double ReadDouble { get { return double.Parse(Read); } }
        public string[] ReadStrArray(long N) { var ret = new string[N]; for (long i = 0; i < N; ++i) ret[i] = Read; return ret; }
        public int[] ReadIntArray(long N) { var ret = new int[N]; for (long i = 0; i < N; ++i) ret[i] = ReadInt; return ret; }
        public long[] ReadLongArray(long N) { var ret = new long[N]; for (long i = 0; i < N; ++i) ret[i] = ReadLong; return ret; }
    }
}


Measured memory_bytes: 11220
#include <stdio.h>
#include <algorithm>
#include <utility>
#include <functional>
#include <cstring>
#include <queue>
#include <stack>
#include <cmath>
#include <iterator>
#include <vector>
#include <string>
#include <set>
#include <iostream>
#include <random>
#include <map>
#include <iomanip>
#include <stdlib.h>
#include <list>
#include <typeinfo>
#include <list>
#include <set>
#include <cassert>
#include <fstream>
#include <unordered_map>
#include <cstdlib>
#include <complex>
#include <cctype>
#include <bitset>
using namespace std;

using ll = long long;
using vll = vector<long long>;
using pll = pair<long long, long long>;
#define rep(i,n) for(long long i(0);(i)<(n);(i)++)

const string YES = "Yes";
const string NO = "No";

void solve(long long N, std::vector<std::string> W){
    set<string> st;
    rep(i, N){
        if(!st.count(W[i]))
            st.insert(W[i]);
        else{
            cout << NO << endl;
            return;
        }
        if(i > 0){
            if(W[i][0] != W[i-1][W[i-1].length()-1]){
                cout << NO << endl;
                return;
            }
        }

    }
    cout << YES << endl;
}

int main(){
    long long N;
    scanf("%lld",&N);
    std::vector<std::string> W(N);
    for(int i = 0 ; i < N ; i++){
        std::cin >> W[i];
    }
    solve(N, std::move(W));
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <bitset>
#include <vector>
#include <string>
#include <algorithm>
#include <set>
#include <map>
#include <cmath>
#include <regex>
#include <iomanip>
#include <climits>
#include <utility>
#include <queue>
using namespace std;
using ll = long long int;
using dd = long double;
const ll MOD = 1e9 + 7;

ll gcd(ll a, ll b)
{
    if (a % b == 0)
    {
        return b;
    }
    return gcd(b, a % b);
}

ll fact(ll n)
{
    if (n == 0)
    {
        return 1;
    }
    if (n == 1)
    {
        return 1;
    }
    return n * fact(n - 1) % MOD;
}

int main()
{
    string a, b;
    cin >> a >> b;
    string n = a + b;

    map<ll, bool> mp;
    for (ll i = 1; i < 1000; i++)
    {
        mp[i * i] = true;
    }
    
    cout << (mp[stoi(n)] ? "Yes" : "No") << endl;
}

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

using namespace std;
typedef long long ll;
const int MAXN = 1000100;
const ll MOD = 1e9 + 7;

int N;
ll res[MAXN];
ll rps[MAXN];

int main()
{
    ios_base::sync_with_stdio(0);

    cin >> N;
    rps[N+1] = 0;
    res[N] = 1;
    res[N-1] = N;
    for (int i = N; i >= 0; i--)
    {
        if (i == N)
            res[i] = 1;
        else if (i == N - 1)
            res[i] = N;
        else
        {
            res[i] = (N - 1) * ((ll) N - 1) % MOD;
            res[i] = (res[i] + res[i+1]) % MOD;

            res[i] = (res[i] + rps[i+3]) % MOD;
            res[i] = (res[i] + i + 1) % MOD;
        }
        rps[i] = (res[i] + rps[i+1]) % MOD;
    }
    cout << res[0] << "\n";
}

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

int main() {
  char c;
  cin >> c;
  
  if (c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u') {
   cout << "vowel" << endl;
  }
  else {
  cout << "consonant" << endl;
  }
}

Measured memory_bytes: 256
#include<stdio.h>
int main(void)
{
	int x,y,z,i,cnt;
	scanf("%d %d",&x,&y);
	cnt=0;
	for(i=1;i<=x;i++){
		z=i*y%x;
		if(z==0) cnt++;
	}
	printf("%d\n",x+y-cnt+1);
	return 0;
}


Measured memory_bytes: 2724
#define _USE_MATH_DEFINES
//#include <bits/stdc++.h>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <complex>
#include <deque>
#include <iomanip>
#include <ios>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <vector>

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

string result[4]={"AC","WA","TLE","RE"};
int cs[4]={};
void solve(long long N, std::vector<std::string> S){
  REP(i,N){
    REP(j,4){
      if(S[i]==result[j]){
	cs[j]++;
      }
    }
  }
  REP(j,4){
    cout<<result[j]<<" x "<<cs[j]<<endl;
  }
}

int main(){
  long long N;
  scanf("%lld",&N);
  std::vector<std::string> S(N);
  for(int i = 0 ; i < N ; i++){
    std::cin >> S[i];
  }
  solve(N, std::move(S));
  return 0;
}


Measured memory_bytes: 6444
#include<stdio.h>

int l,cnt,gcount;
int ary[1000000];
int n;
int G[100];

void insertsort(int ary[],int n,int g){
  for(int i=g;i<n;i++){
    int v=ary[i];
    int j=i-g;
    while(j>=0 && ary[j]>v){
      ary[j+g]=ary[j];
      j-=g;
      cnt++;
    }
    ary[j+g]=v;
  }
}

void shellsort(int ary[],int n){
  int i,h=1;
  gcount=0;
  while(1){
    if(h>n)break;
    G[gcount]=h;
    h=3*h+1;
    gcount++;
  }
  for(i=gcount-1;i>=0;i--){
    insertsort(ary,n,G[i]);
  }
}

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

  shellsort(ary,n);

  printf("%d\n",gcount);
  for(i=gcount-1;i>=0;i--){
    printf("%d",G[i]);
    if(i>0)printf(" ");
  }
  printf("\n");
  printf("%d\n",cnt);
  for(i=0;i<n;i++)printf("%d\n",ary[i]);
  return 0;
}



Measured memory_bytes: 5644
#include <bits/stdc++.h>
using namespace std;
int n;int d[100004],ans=0;
int main(){
	cin>>n;
	for (int i=0;i<n;i++) cin>>d[i];
	sort (d,d+n);
	for (int i=1;i<=1e5;i++){
		int x=lower_bound(d,d+n,i)-d;
		if (x==n/2) ans++;
	}
	cout<<ans;
}

Measured memory_bytes: 640
def main():
    N = int(input())
    A = [int(i) for i in input().split()]
    v = A[0]
    for a in A[1:]:
        v ^= a
    ans = []
    for a in A:
        ans.append(v ^ a)
    print(*ans)


if __name__ == '__main__':
    main()


Measured memory_bytes: 111784
N  = int(input())
As = [int(i) for i in input().split()]

# 約数
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
    return divisors

# 最大公約数
def gcd(n, m):
    # 最大公約数
    a = max(n,m)
    b = min(n,m)
    while b:
        a, b = b, a % b
    return a

## 高々3種類調べれば良い

if N > 2:
    devs = make_divisors(gcd(As[0],As[1]))
    devs.extend(make_divisors(gcd(As[1],As[2])))
    devs.extend(make_divisors(gcd(As[2],As[0])))
    devs = list(set(devs))
    cnt = 1
    for dev in sorted(devs)[::-1]:
        a = sum([a%dev==0 for a in As])
        if N - a == 0 or N - a == 1:
            print(dev)
            break
else:
    print(max(As))

Measured memory_bytes: 14400
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define P pair<ll,ll>
#define FOR(I,A,B) for(ll I = ll(A); I < ll(B); ++I)
#define FORR(I,A,B) for(ll I = ll((B)-1); I >= ll(A); --I)
#define TO(x,t,f) ((x)?(t):(f))
#define SORT(x) (sort(x.begin(),x.end())) // 0 2 2 3 4 5 8 9
#define POSL(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin()) //xi>=v  x is sorted
#define POSU(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin()) //xi>v  x is sorted
#define NUM(x,v) (POSU(x,v)-POSL(x,v))  //x is sorted
#define REV(x) (reverse(x.begin(),x.end())) //reverse
ll gcd(ll a,ll b){if(a%b==0)return b;return gcd(b,a%b);}
ll lcm(ll a,ll b){ll c=gcd(a,b);return ((a/c)*(b/c)*c);}
#define NEXTP(x) next_permutation(x.begin(),x.end())
const ll INF=ll(1e16)+ll(7);
const ll MOD=1000000007LL;
#define out(a) cout<<fixed<<setprecision((a))
//tie(a,b,c) = make_tuple(10,9,87);
#define pop(a) __builtin_popcount((a))
ll keta(ll a){ll r=0;while(a){a/=10;r++;}return r;}











int main(){

  ll n,a,b;
  cin >> n >> a >> b;
  ll ans = INF;

  if((a-b)%2==0){
    ans = abs(a-b)/2;
  }else{
    ll x = 1;
    ll y = b-a;
    ans = a + (y-x)/2;

    y = a + n - b + 1;
    x = n;
    ans = min( n-b+1 + (x-y)/2 , ans );
  }
  cout << ans << endl;

}


Measured memory_bytes: 256
import java.util.*;

public class Main {
	static int goal;

	static ArrayList<Integer> list = new ArrayList<>();
	static int[] cache;

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		goal = sc.nextInt();

		int c = sc.nextInt();
		for (int i = 0; i < c; i++) {
			list.add(sc.nextInt());
		}
		cache = new int[goal + 1];
		Collections.sort(list, Collections.reverseOrder());
		System.out.println(compute(goal));

	}

	public static int compute(int value) {
		if (cache[value] != 0) {
			return cache[value];
		}
		HashSet<Integer> set = new HashSet<Integer>();
		for (int e : list) {
			if (e == value) {
				cache[value] = 1;
				return 1;
			}
			if (e < value) {
				int coins = 1;
				coins += compute(value - e);
				set.add(coins);

			}
		}
		int result = Integer.MAX_VALUE;
		for (int e : set) {
			if (e < result) {
				result = e;
			}
		}
		cache[value] = result;
		return result;

	}

}

Measured memory_bytes: 62408
def chk_result(x, y, z):
    a = int(x)
    b = int(y)
    c = int(z)
    if (a < b and b < c):
        return True
    else:
        return False


s = input().split()
intAR = int(s[0])
intBG = int(s[1])
intCB = int(s[2])

s = input().split()
intK = int(s[0])

res = False

while intK > 0:
    if (intAR >= intBG):
        intBG = intBG * 2
    elif (intBG >= intCB):
        intCB = intCB * 2
    
    #print(str(intAR) + ' ' + str(intBG) + ' ' + str(intCB))
    res = chk_result(intAR, intBG, intCB)
    if (res):
        print('Yes')
        exit()
    intK -= 1

print('No')

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

using namespace std;

int main()
{
    ios::sync_with_stdio(0);
    int n;
    cin >> n;

    int a[n+1], b[n+1];
    for(int i=0; i<n-1; i++)
        cin >> a[i];

    long long int ans = a[0]+a[n-2];
    for(int i=1; i<n-1; i++){
        ans += min(a[i], a[i-1]);
    }

    cout << ans << "\n";
    
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep( i, a, b ) for( int i = (a); i <= (b); ++i )
#define dep( i, a, b ) for( int i = (a); i >= (b); --i )
using namespace std;
typedef long long ll;
const int N = 1e6+9, INF = 0x3f3f3f3f;
string dt[N];

int getnum( char ch ) {
    if( ch == 'A' ) return 1;
    else if( ch == 'C' ) return 2;
    else if( ch == 'G' ) return 3;
    else if( ch == 'T' ) return 4;
    return 0;
}

ll getkey( string s ) {
    ll len = s.length(), q = 1, res = 0;
    rep( i, 0, len - 1 ) {
        res += getnum( s[i] ) * q;
        q *= 5;
    }
    return res;
}

int h1( int key ) {
    return key % N;
}

int h2( int key ) {
    return 1 + key % ( N - 1 );
}

int h( int key, int i ) {
    return ( h1(key) + h2( key ) * i ) % N;
}

void insert( string key ) {
    int i = 0;
    while( true ) {
        int j = h( getkey( key ), i );
        if( dt[j] == "" ) {
            dt[j] = key;
            return ;
        }
        else ++i;
    }
}

bool serch( string key ) {
    int i = 0;
    while( true ) {
        int j = h( getkey( key ), i );
        if( dt[j] == key ) return true;
        else if( dt[j] == "" || i >= N ) return false;
        else ++i;
    }
}

int main( void ) {
    ios::sync_with_stdio( false );
    int n;
    string a, b;
    cin >> n;
    rep(i, 1, n) {
        cin >> a >> b;
        if( a == "insert" ) insert( b );
        else cout << ( serch( b ) ? "yes" : "no" ) << '\n';
    }
    return 0;
}


Measured memory_bytes: 38428
#include <iostream>
#include <cmath>
#include <string.h> 
#include <vector>
#include <bits/stdc++.h> 
#include <iomanip>
#include<algorithm> 
#include <string> 
using namespace std;

int main(){
    int n;
    cin>>n;
    int arr[n];
    for(int i=0;i<n;i++){
        cin>>arr[i];
    }
    int fib[n];
    fib[0]=0; fib[1]=abs(arr[1]-arr[0]);
    for(int i=2;i<n;i++){
        fib[i] = min(abs(arr[i]-arr[i-1])+fib[i-1],abs(arr[i]-arr[i-2])+fib[i-2]);
    }
    cout<<fib[n-1];
    return 0;
}


Measured memory_bytes: 1024
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <string>
#include <cstring>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <cmath>
#include <iomanip>
#include <cassert>
#include <bitset>
using namespace std;

typedef pair<int, int> P;
#define rep(i, n) for (int i=0; i<(n); i++)
#define all(c) (c).begin(), (c).end()
#define uniq(c) c.erase(unique(all(c)), (c).end())
#define index(xs, x) (int)(lower_bound(all(xs), x) - xs.begin())
#define _1 first
#define _2 second
#define pb push_back
#define INF 1145141919
#define MOD 1000000007
const int B = 200;

int N, Q;
int U[40000], R[40000];
int find(int x) {
  if (U[x] == x) return x;
  return U[x] = find(U[x]);
}
void unite(int x, int y) {
  x = find(x), y = find(y);
  if (x == y) return;
  if (R[x] < R[y]) swap(x, y);
  U[x] = y;
}

int QT[40000], QU[40000], QV[40000];
bool used[40000];
set<int> G[40000];

void dfs(int x) {
  used[x] = true;
  for (int t : G[x]) if (!used[t]) dfs(t);
}

signed main() {
  ios::sync_with_stdio(false); cin.tie(0);
  cin >> N >> Q;
  rep(i, Q) {
    cin >> QT[i] >> QU[i] >> QV[i];
  }
  set<P> edges;
  vector<int> vs;
  vector<P> dyn;
  rep(q, Q) {
    if (q%B == 0) {
      rep(i, N) U[i] = i, R[i] = 1, G[i].clear();
      rep(i, N) used[i] = true;
      vs.clear();
      dyn.clear();
      for (int i=q; i<min(q+B, Q); i++) {
        vs.pb(QU[i]);
        vs.pb(QV[i]);
        dyn.pb(P(QU[i], QV[i]));
      }
      sort(all(vs)); uniq(vs);
      sort(all(dyn)); uniq(dyn);
      for (P p : edges) if (!binary_search(all(dyn), p)) unite(p._1, p._2);
      for (P p : edges) if (binary_search(all(dyn), p)) {
        int u = find(p._1), v = find(p._2);
        G[u].insert(v);
        G[v].insert(u);
      }
    }
    int u = find(QU[q]), v = find(QV[q]);
    if (QT[q] == 1) {
      edges.insert(P(QU[q], QV[q]));
      G[u].insert(v);
      G[v].insert(u);
    }
    else if (QT[q] == 2) {
      edges.erase(P(QU[q], QV[q]));
      G[u].erase(v);
      G[v].erase(u);
    }
    else {
      for (int x : vs) used[find(x)] = false;
      dfs(u);
      if (used[v]) cout << "YES\n";
      else cout << "NO\n";
    }
  }
  return 0;
}



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

using namespace std;

const int maxn = 2*1e3+10;

vector<int> graph[maxn];

int main(){

	int n,x,y;

	cin >> n >> x >> y;

	vector<int> ans(n+1,0);

	for(int i=1;i<=n;++i){
		for(int j=i;j<=n;++j){
			int m_dist = min({abs(j-i),
				abs(x-i)+1+abs(y-j),
				abs(x-j)+1+abs(y-i)});
			ans[m_dist]++;
		}
	}

	for(int i=1;i<n;++i){
		cout << ans[i] << '\n';
	}

	return 0;
}

Measured memory_bytes: 256
from bisect import bisect_right
from numpy import cumsum
from sys import stdin
input=stdin.readline
n,m,k=map(int,input().split())
a=[0]+list(map(int,input().split()))
b=list(map(int,input().split()))
a=cumsum(a)
b=cumsum(b)
ans=0
for i in range(len(a)):
  x=k-a[i]
  if x>=0:
    y=bisect_right(b,x)
    if ans<y+i:
      ans=y+i
  else:
    break
print(ans)

Measured memory_bytes: 59244
N=int(input())
A=[int(i) for i in input().split()]
B=[[A[i],-10**15] for i in range(2**N)]
for i in range(N):
    for b in range(2**N):
        if ((1&(b>>i))==1):
            merge=B[b]+B[b^(1<<i)]
            merge.sort(reverse=True)
            B[b]=merge[:2]
ans=-10**15
for i in range(1,2**N):
    ans=max([ans,sum(B[i])])
    print(ans)


Measured memory_bytes: 143756
using System;
using static System.Math;
using System.Linq;
using System.Collections.Generic;
class AC
{
    static void Main(string[] args)
    {
        var N = Cin.Int();
        const long inf = long.MaxValue / 3;
        long[] px = { inf, -inf };//移した後の最小値、最大値
        long[] py = { inf, -inf };
        for(var i = 0; i < N; i++)
        {
            var (x, y) = Cin.Input<long, long>();
            px[0] = Min(px[0], x + y);
            px[1] = Max(px[1], x + y);

            py[0] = Min(py[0], x - y);
            py[1] = Max(py[1], x - y);
        }
        Console.WriteLine(Max(px[1] - px[0], py[1] - py[0]));
    }
}
static class Cin
{
    public static string Str() => Console.ReadLine();
    public static int Int() => int.Parse(Cin.Str());
    public static long Long() => long.Parse(Cin.Str());
    public static double Double() => double.Parse(Cin.Str());

    private static T Conv<T>(string value) => (T)Convert.ChangeType(value, typeof(T));
    public static (T, U) ReadTuple<T, U>(string[] input) => (Conv<T>(input[0]), Conv<U>(input[1]));
    public static (T, U, V) ReadTuple<T, U, V>(string[] input) => (Conv<T>(input[0]), Conv<U>(input[1]), Conv<V>(input[2]));
    public static (T, U, V, W) ReadTuple<T, U, V, W>(string[] input) => (Conv<T>(input[0]), Conv<U>(input[1]), Conv<V>(input[2]), Conv<W>(input[3]));
    public static (T, U, V, W, X) ReadTuple<T, U, V, W, X>(string[] input) => (Conv<T>(input[0]), Conv<U>(input[1]), Conv<V>(input[2]), Conv<W>(input[3]), Conv<X>(input[4]));

    public static (T, U) Input<T, U>() => ReadTuple<T, U>(ReadSplit());
    public static (T, U, V) Input<T, U, V>() => ReadTuple<T, U, V>(ReadSplit());
    public static (T, U, V, W) Input<T, U, V, W>() => ReadTuple<T, U, V, W>(ReadSplit());
    public static (T, U, V, W, X) Input<T, U, V, W, X>() => ReadTuple<T, U, V, W, X>(ReadSplit());

    public static string[] ReadSplit() => Console.ReadLine().Split();
    public static string[] ReadSplit(char separator) => Console.ReadLine().Split(separator);
    public static int[] ReadSplitInt() => Array.ConvertAll(ReadSplit(), int.Parse);
    public static long[] ReadSplitLong() => Array.ConvertAll(ReadSplit(), long.Parse);
    public static double[] ReadSplit_Double() => Array.ConvertAll(ReadSplit(), double.Parse);
}


Measured memory_bytes: 46304
while True:
	cards=list(input())
	n=len(cards)
	if cards[0] == "-":
		break
	work=[0 for i in range(n)]
	for h in (int(input()) for i in range(int(input()))):
		for i in range(h,n):
			work[i-h]=cards[i]
		for i in range(h):
			work[n-h+i]=cards[i]
		for i in range(n):
			cards[i] = work[i]
	print("".join(cards))



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

#define int long long

#define ii pair<int, int>
#define fi first
#define sc second
#define set unordered_set
#define map unordered_map
#define all(x) (x).begin(), (x).end()

signed main() {
#ifdef _DEBUG
	//freopen("in", "r", stdin);
#endif
	ios::sync_with_stdio(0); cin.tie(0);
	set<string> s;
	int n; cin >> n;
	while (n--) {
		string t; cin >> t;
		s.insert(t);
	}
	cout << s.size() << '\n';
}


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

int main() {
  string S;
  cin >> S;
  if (S == "abc"||
      S == "acb"||
      S == "bac"||
      S == "bca"||
      S == "cab"||
      S == "cba")
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}


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

int main(){ 
    int n;
    cin>>n;
    int b=0;
    vector<int> a(n);
    for (int i = 0; i < n; i++) {
  cin >> a.at(i);
}
 for (int i = 1; i < n; i++) {
 for (int j = 0;  j< i; j++) {
 b+=a[i]*a[j];
 }}
 cout<<b;
    return 0;
}


Measured memory_bytes: 256
unittest
{
	assert( [ "3 2 1", "1 2 1 2", "1 3 2 4", "1 11", "1 2", "2 5" ].parse.expand.solve == "2\n14" );
	assert( [ "4 4 1", "1 2 1 5", "1 3 4 4", "2 4 2 2", "3 4 1 1", "3 1", "3 1", "5 2", "6 4" ].parse.expand.solve == "5\n5\n7" );
	assert( [ "6 5 1", "1 2 1 1", "1 3 2 1", "2 4 5 1", "3 5 11 1", "1 6 50 1", "1 10000", "1 3000", "1 700", "1 100", "1 1", "100 1" ].parse.expand.solve == "1\n9003\n14606\n16510\n16576" );
	assert( [ "4 6 1000000000", "1 2 50 1", "1 3 50 5", "1 4 50 7", "2 3 50 2", "2 4 50 4", "3 4 50 3", "10 2", "4 4", "5 5", "7 7" ].parse.expand.solve == "1\n3\n5" );
	assert( [ "2 1 0", "1 2 1 1", "1 1000000000", "1 1" ].parse.expand.solve == "1000000001" );
}



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

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

auto parse( Range )( Range input )
if( isInputRange!Range && is( ElementType!Range == string ) )
{
	auto nms = input.front.split.to!( long[] );
	auto uvabs = new long[ 4 ][ nms[ 1 ] ];
	foreach( ref uvab; uvabs )
	{
		input.popFront;
		uvab = input.front.split.to!( long[] );
		uvab[ 0 .. 2 ] -= 1;
	}
	auto cds = new long[ 2 ][ nms[ 0 ] ];
	foreach( ref cd; cds )
	{
		input.popFront;
		cd = input.front.split.to!( long[] );
	}
	return tuple( nms[ 0 ], nms[ 2 ], uvabs, cds );
}

auto solve( long n, long s, long[ 4 ][] uvabs, long[ 2 ][] cds )
{
	auto nss = toAdjacencyListEx( n, uvabs, cds );
	auto anss = dijkstraEx( nss, uvabs.length + cds.length, 0, s );
	anss.popFront;
	return anss.to!( string[] ).join( "\n" );
}

// 辺配列から隣接リストを作成
auto toAdjacencyListEx( long n, long[ 4 ][] uvabs, long[ 2 ][] cds )
{
	auto nss = new Tuple!( long, long, long )[][ n ];
	foreach( uvab; uvabs )
	{
		nss[ uvab[ 0 ] ] ~= tuple( uvab[ 1 ], -uvab[ 2 ], uvab[ 3 ] );
		nss[ uvab[ 1 ] ] ~= tuple( uvab[ 0 ], -uvab[ 2 ], uvab[ 3 ] );
	}
	foreach( i, cd; cds )
	{
		nss[ i ] ~= tuple( i.signed, cd[ 0 ], cd[ 1 ] );
	}
	return nss;
}

// 正の重み付きグラフの始点指定最短経路探索（ダイクストラ法）
auto dijkstraEx( Tuple!( long, long, long )[][] nss, long ec, long s, long c )
{
	import std.container.binaryheap;
	
	auto am = nss.length.signed * 50;
	c = min( am, c );
	
	auto dss = new long[][]( nss.length, 1 + am );
	foreach( ref ds; dss ) ds[] = long.max;
	dss[ s ][ c ] = 0;
	auto dms = new long[ nss.length ];
	dms[] = long.max;
	dms[ s ] = 0;
	auto uss = new bool[][]( nss.length, 1 + am );
	
	auto queue = heapify!( ( a, b ) => b[ 2 ] < a[ 2 ] || ( b[ 2 ] == a[ 2 ] && b[ 1 ] < a[ 1 ] ) )( new Tuple!( long, long, long )[ ec ], 0 );
	queue.insert( tuple( s, c, 0L ) );
	while( !queue.empty )
	{
		auto fi = queue.front[ 0 ];
		auto fc = queue.front[ 1 ];
		auto fd = queue.front[ 2 ];
		queue.popFront();
		
		if( uss[ fi ][ fc ] ) continue;
		uss[ fi ][ fc ] = true;
		
		foreach( t; nss[ fi ] )
		{
			auto ti = t[ 0 ];
			auto tc = min( fc + t[ 1 ], am );
			auto td = fd + t[ 2 ];
			
			if( tc < 0 || uss[ ti ][ tc ] ) continue;
			
			dss[ ti ][ tc ] = td;
			dms[ ti ] = min( dms[ ti ], td );
			queue.insert( tuple( ti, tc, td ) );
		}
	}
	return dms;
}


Measured memory_bytes: 11352
#include <bits/stdc++.h> 
using namespace std; 
  
double maxvolume(double s) 
{ 
    // finding length 
    double length = s / 3; 
  
    s -= length; 
  
    // finding breadth 
    double breadth = s / 2; 
  
    // finding height 
    double height = s - breadth; 
  
    return length * breadth * height; 
} 
int main() 
{ double n;
 cin>>n;
 n=n*1.000000;
    cout<<fixed<<setprecision(6) << maxvolume(n) << endl; 
    return 0; 
} 

Measured memory_bytes: 256