akhauriyash/Code-Regression huggingface dataset:
#include<stdio.h>
#include<stdlib.h>

struct node{
  struct node *right;
  struct node *left;
  struct node *parent;
  int key;
};
typedef struct node * Node;
#define NIL NULL

Node root;

void insert(int k){
  Node y = NIL;
  Node x = root;
  Node z;

  z = malloc(sizeof(struct node));
  z->key = k;
  z->left = NIL;
  z->right = NIL;

  while(x != NIL){
    y = x;
    if(z->key < x->key) x = x->left;
    else x = x->right;
  }
  z->parent = y;
  if(y == NIL) root = z;
  else if(z->key < y->key) y->left = z;
  else y->right = z;
}

void inorder(Node u){
  if(u->left != NIL) inorder(u->left);
  printf(" %d", u->key);
  if(u->right != NIL) inorder(u->right);
}

void preorder(Node u){
  printf(" %d", u->key);
  if(u->left != NIL) preorder(u->left);
  if(u->right != NIL) preorder(u->right);
}


int main(){
  int n, i, x;
  char com[20];
  scanf("%d", &n);
  root = NIL;

  for ( i = 0; i < n; i++ ){
    scanf("%s", com);
    if ( com[0] == 'i' ){
      scanf("%d", &x);
      insert(x);
    } else if ( com[0] == 'p' ){
      inorder(root);
      printf("\n");
      preorder(root);
      printf("\n");
    }
  }
  return 0;
}

Measured memory_bytes: 24040
#include<bits/stdc++.h>
typedef long long int ll;
#define mod 1000000007
#define sz 200009
ll n,m,i,j,k,l,t,arr[sz],dp[sz],brr[sz],crr[sz],drr[sz],err[sz];
int main()
{
  scanf("%lld",&n);
  for(i=1;i<=n;i++)
    scanf("%lld",&arr[i]);
  for(i=1;i<=n;i++)
  {
      if(i%2==1)
      {
          dp[i]=dp[i-2]+arr[i];
          brr[i]=dp[i-1]>brr[i-2]+arr[i]?dp[i-1]:brr[i-2]+arr[i];
          crr[i]=brr[i-1]>crr[i-2]+arr[i]?brr[i-1]:crr[i-2]+arr[i];
      }
      else
      {
           dp[i]=dp[i-2]+arr[i]>dp[i-1]?dp[i-2]+arr[i]:dp[i-1];
          brr[i]=brr[i-1]>brr[i-2]+arr[i]?brr[i-1]:brr[i-2]+arr[i];
          crr[i]=crr[i-1]>crr[i-2]+arr[i]?crr[i-1]:crr[i-2]+arr[i];
      }
  }
  if(n%2==1)
    k=brr[n];
  else
    k=dp[n];
  printf("%lld\n",k);
}


Measured memory_bytes: 10044
/*
{
######################
#       Author       #
#        Gary        #
#        2020        #
######################
*/
#pragma GCC optimize(2)
#include<bits/stdc++.h>
#define rb(a,b,c) for(int a=b;a<=c;++a)
#define rl(a,b,c) for(int a=b;a>=c;--a)
#define LL long long
#define IT iterator
#define PB push_back
#define II(a,b) make_pair(a,b)
#define FIR first
#define SEC second
#define FREO freopen("check.out","w",stdout)
#define rep(a,b) for(int a=0;a<b;++a)
#define SRAND mt19937 rng(chrono::steady_clock::now().time_since_epoch().count())
#define random(a) rng()%a
#define ALL(a) a.begin(),a.end()
#define POB pop_back
#define ff fflush(stdout)
#define fastio ios::sync_with_stdio(false)
#define R(a) cin>>a
#define R2(a,b) cin>>a>>b
#define check_min(a,b) a=min(a,b)
#define check_max(a,b) a=max(a,b)
using namespace std;
const int INF=0x3f3f3f3f;
typedef pair<int,int> mp;
/*}
*/
int n;
bool check(vector<int> v){
	int cnt[2]={0};
	for(auto it:v)
		cnt[it&1]++;
	if(cnt[0]&1){
		return 1;
	}
	if(cnt[1]!=1){
		return 0;
	}
	for(auto &it:v){
		if(it&1){
			if(it==1) return 0;
			it--;
		}
	}
	int gcd=v[0];
	for(auto it:v)
		gcd=__gcd(gcd,it);
	for(auto & it:v){
		it/=gcd;
	}
	return !check(v);
}
int main(){
	vector<int> v;
	fastio;
	R(n);
	rb(i,1,n){
		int ai;
		R(ai);
		v.PB(ai);
	}	
	cout<<(check(v)? "First":"Second")<<endl;
	return 0;
}
/** 程序框架：
  *
  *
  *
  *
  **/


Measured memory_bytes: 13080
#include<cstdio>
    #include<cmath>
    #include<cstring>
    #include<algorithm>
    using namespace std;
     
    int main()
    {
        char X,Y;
    	scanf("%c %c \n",&X,&Y);
    	if(X>Y) 
    		printf(">");
    	else if(X<Y) 
    		printf("<");
    	else 
    		printf("=");
    }

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

using namespace std;
using ll = long long;
using vl = vector<ll>;
using vvl = vector<vl>;
using pll = pair<ll, ll>;

const ll oo = 0x3f3f3f3f3f3f3f3fLL;
const double eps = 1e-9;

#define sz(c) ll((c).size())
#define all(c) begin(c), end(c)
#define mp make_pair
#define mt make_tuple
#define pb push_back
#define eb emplace_back
#define xx first
#define yy second
#define FOR(i, a, b) for (ll i = (a); i < (b); i++)
#define FORD(i, a, b) for (ll i = ll(b) - 1; i >= (a); i--)
#define TR(X)                                                  \
    ({                                                         \
        if (1) cerr << "TR: " << (#X) << " = " << (X) << endl; \
    })

constexpr ll MOD = 998244353;

ll exp(ll a, ll n) {
    ll res = 1;
    for (ll acc = a; n; acc = (acc * acc) % MOD, n >>= 1) {
        if (n & 1) {
            res = (res * acc) % MOD;
        }
    }
    return res;
}

struct binom {
    vl facs, ifacs;
    explicit binom(ll N) : facs(N + 1), ifacs(N + 1) {
        facs[0] = 1;
        FOR(i, 1, N + 1) facs[i] = (facs[i - 1] * i) % MOD;
        ifacs[N] = exp(facs[N], MOD - 2);
        FORD(i, 1, N + 1) ifacs[i - 1] = (ifacs[i] * i) % MOD;
    }

    ll get(ll n, ll k) {
        return (((facs[n] * ifacs[k]) % MOD) * ifacs[n - k]) % MOD;
    }
};

int main() {
    cin.sync_with_stdio(0);
    ll N, M, K;
    cin >> N >> M >> K;

    ll ans = 0;
    binom b(N);

    FOR(k, 0, K + 1) {
        ans += (((b.get(N - 1, k) * M) % MOD) * exp(M - 1, N - 1 - k)) % MOD;
        ans %= MOD;
    }

    cout << ans << endl;

}  // cin.tie(0) bei schnellem Wechseln


Measured memory_bytes: 6372
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<iostream>
#include<vector>
#include<set>
#include<map>
#include<bitset>
#include<cmath>
#include<string>

#define ls (t<<1)
#define rs ((t<<1)+1)
#define mid ((l+r)>>1)
#define fi first
#define se second
#define mk make_pair
#define pb push_back

#define N 100005
#define M 200005
#define seed 23333

using namespace std;
int i,j,m,p,k;
long long n,s;
int main()
{
	scanf("%lld%lld",&n,&s);
	for (i=2;i<=min(1000000ll,n);++i)
	{
			long long now=0;
			for (long long r=n;r;r/=i) now+=r%i;
			if (now==s)
			{
					printf("%d\n",i);
					return 0;
			}
	}
	long long Ans=1e18;
	for (i=1;i<=1000000&&i<=s;++i)
	{
			if ((n-(s-i))%i!=0) continue;
			long long x=(n-(s-i))/i;
			if (i>=x||(s-i)>=x) continue;
			Ans=min(Ans,x);
	}
	if (Ans!=1e18) 
	{
			printf("%lld\n",Ans);
			return 0;
	}
	if (n==s)
	{
			printf("%lld\n",n+1);
			return 0;
	}
	puts("-1");
}


Measured memory_bytes: 256
fn main() {
    let (r, w) = (std::io::stdin(), std::io::stdout());
    let mut sc = IO::new(r.lock(), w.lock());
    let s: String = sc.read();
    let t: String = sc.read();
    let a: usize = sc.read();
    let b: usize = sc.read();
    let u: String = sc.read();
    if s == u {
        println!("{} {}", a - 1, b);
    } else {
        println!("{} {}", a, b - 1);
    }
}

pub struct IO<R, W: std::io::Write>(R, std::io::BufWriter<W>);

impl<R: std::io::Read, W: std::io::Write> IO<R, W> {
    pub fn new(r: R, w: W) -> IO<R, W> {
        IO(r, std::io::BufWriter::new(w))
    }
    pub fn write<S: std::ops::Deref<Target = str>>(&mut self, s: S) {
        use std::io::Write;
        self.1.write(s.as_bytes()).unwrap();
    }
    pub fn read<T: std::str::FromStr>(&mut self) -> T {
        use std::io::Read;
        let buf = self
            .0
            .by_ref()
            .bytes()
            .map(|b| b.unwrap())
            .skip_while(|&b| b == b' ' || b == b'\n' || b == b'\r' || b == b'\t')
            .take_while(|&b| b != b' ' && b != b'\n' && b != b'\r' && b != b'\t')
            .collect::<Vec<_>>();
        unsafe { std::str::from_utf8_unchecked(&buf) }
            .parse()
            .ok()
            .expect("Parse error.")
    }
    pub fn vec<T: std::str::FromStr>(&mut self, n: usize) -> Vec<T> {
        (0..n).map(|_| self.read()).collect()
    }
    pub fn chars(&mut self) -> Vec<char> {
        self.read::<String>().chars().collect()
    }
}


Measured memory_bytes: 4352
/*
    飲んだ魔剤で家が建つ。
    created at: 2020-04-12 18:19:58
*/

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

#define all(x) (x).begin(),(x).end()
#define rev(x) greater<x>()
#define MOD 1000000007
#define INF 1000000000

typedef long long LL;
typedef long double LD;

bool compare_by_b(pair<int, int> a, pair<int, int> b)
{
    if (a.second != b.second) {
        return a.second < b.second;
    } else {
        return a.first < b.first;
    }
}

LL modpower(LL n, LL m, LL mod)
{
    if (m == 0) {
        return 1;
    } else if (m % 2 == 0) {
        LL p = modpower(n, m/2, mod);
        return p*p % mod;
    } else {
        return n*modpower(n, m-1, mod) % mod;
    }
}

LL modinv(LL n, LL mod)
{
    return modpower(n, mod-2, mod);
}

LL modcombination(LL n, LL r, LL mod)
{
    LL ret = 1;

    for (int i = 0; i < r; i++) {
        ret *= (n-i);
        ret %= mod;
        ret *= modinv(i+1, mod);
        ret % mod;
    }

    return ret % mod;
}

int gcd(int k, int l)
{
    if (l > 0) return gcd(l, k%l);
    else return k;
}

struct UnionFind
{
    vector<int> par;

    UnionFind(int n) : par(n) {
        for (int i = 0; i < n; i++) par[i] = i;
    }

    int root(int x) {
        if (par[x] == x) return x;
        return par[x] = root(par[x]);
    }

    void unite(int x, int y) {
        int rx = root(x);
        int ry = root(y);
        if (rx == ry) return;
        par[rx] = ry;
    }

    bool same(int x, int y) {
        int rx = root(x);
        int ry = root(y);
        return rx == ry;
    }
};

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

    int n = s.length();
    char ans = '@';
    for (char c = 'z'; c >= 'a'; c--) {
        int nfound = 1;
        for (int i = 0; i < n; i++) {
            if (c == s[i]) nfound = 0;
        }

        if (nfound) ans = c;
    }

    if (ans >= 'a' && ans <= 'z') cout << ans << endl;
    else cout << "None" << endl;

    return 0;
}


Measured memory_bytes: 512
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
#define mod ((int)1e9+7)
#define lim 1000000000000000007
#define lim1 18446744073709551615  //Unsigned
#define sq(a) ((a)*(a))
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define mms(v,i) memset(v,i,sizeof(v))
#define pb push_back
#define pf push_front
#define ppb pop_back
#define ppf pop_front
#define REP(i,a,b) for (int i = a; i <= b; i++)
#define REPN(i,a,b) for (int i = a; i >= b; i--)
using namespace std;
typedef long long int ll;
typedef unsigned long long int ull;
typedef pair<int,int> pi;
typedef pair<ll,ll> PL;
typedef pair<ll,int> PLI;
typedef pair<int,ll> PIL;
typedef pair<int,pair<int,int> > pii;
typedef pair<double,double> pdd;
typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> indexed_set;
typedef tree<pi,null_type,less<pi>,rb_tree_tag,tree_order_statistics_node_update> indexed_set_pair;
ll power(ll a,ll b) {
   ll res=1;
   while(b){
      if(b%2==1) res=(res*a)%mod;
      a=(a*a)%mod;
      b>>=1;
   }
   return res;
}
ll gcdll(ll a,ll b) {
    if (b==0) return a;
    return gcdll(b,a%b);
}
int gcd(int a,int b) {
    if (b==0) return a;
    return gcd(b,a%b);
}

struct custom_hash {
    static uint64_t splitmix64(uint64_t x) {
        // http://xorshift.di.unimi.it/splitmix64.c
        x += 0x9e3779b97f4a7c15;
        x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
        x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
        return x ^ (x >> 31);
    }

    size_t operator()(uint64_t x) const {
        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
        return splitmix64(x + FIXED_RANDOM);
    }
};

const int N = (int)2e5+5;
const int M = (int)1e3+5;
const int Q = 102;
const int logN = 19;

const double pie = acos(-1);

void solve() {
  int a,b,c,k;
  cin>>a>>b>>c>>k;
  int cnt = 0;
  while(b<=a) {
    b<<=1, cnt++;
  }
  while(c<=b) {
    c<<=1, cnt++;
  }
  if(cnt<=k) cout<<"Yes";
  else cout<<"No";
}
int main() {
    //freopen("./sort/b2.in","r",stdin);
    //freopen("output.txt","w",stdout);

    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);

    int T=1;
    //cin>>T;
    REP(TC,1,T) {
        //cout<<"Case #"<<TC<<": ";
        solve();
        cout<<"\n";
    }
}


Measured memory_bytes: 3604
// Standard I/O
#include <iostream>
#include <sstream>
#include <cstdio>
// Standard Library
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <cmath>
// Template Class
#include <complex>
#include <string>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <stack>
// Container Control
#include <algorithm>

using namespace std;

#define rep( i, n ) for( int i = 0; i < n; ++i )
#define irep( i, n ) for( int i = n-1; i >= 0; --i )
#define reep( i, s, n ) for ( int i = s; i < n; ++i )
#define ireep( i, n, s ) for ( int i = n-1; i >= s; --i )
#define foreach(itr, x) for( typeof(x.begin()) itr = x.begin(); itr != x.end(); ++itr)

#define mp make_pair
#define pb push_back
#define eb emplace_back
#define all( v ) v.begin(), v.end()
#define fs first
#define sc second
#define vc vector

// for visualizer.html
double SCALE = 1.0;
double OFFSET_X = 0.0;
double OFFSET_Y = 0.0;
#define LINE(x,y,a,b) cerr << "line(" << SCALE*(x) + OFFSET_X << ","	\
	<< SCALE*(y) + OFFSET_Y << ","										\
	<< SCALE*(a) + OFFSET_X << ","										\
	<< SCALE*(b) + OFFSET_Y << ")" << endl;
#define CIRCLE(x,y,r) cerr << "circle(" << SCALE*(x) + OFFSET_X << ","	\
	<< SCALE*(y) + OFFSET_Y << ","										\
	<< SCALE*(r) << ")" << endl;

typedef long long ll;
typedef complex<double> Point;

typedef pair<int, int> pii;
typedef pair<int, pii> ipii;
typedef vector<int> vi;
typedef vector<double> vd;
typedef vector< vector<int> > vii;
typedef vector< vector<double> > vdd;

typedef vector<int>::iterator vi_itr;

const int IINF = 1 << 28;
const double INF = 1e30;
const double EPS = 1e-10;
const double PI = acos(-1.0);

// Direction : L U R D
const int dx[] = { -1, 0, 1, 0};
const int dy[] = { 0, -1, 0, 1 };

int a[100010];
int main()
{
	int N;
	cin >> N;

	rep(i, N){
		cin >> a[i];
		a[i]--;
	}

	int ans = 0;
	rep(i, N){
		if( a[a[i]] == i ) ++ans;
	}

	cout << ans / 2 << endl;
}


Measured memory_bytes: 888
#include<cstdio>
using namespace std;

const int N = 1000000;
int dp[2][N+1];

int main(){
  for(int i=0;i<=N;i++)dp[0][i] = dp[1][i] = N;
  dp[0][0] = dp[1][0] = 0;

  int val = 1;
  for(int i=1;val<=N;i++){
    for(int j=0;j+val<=N;j++){
      int nxt = j+val;
      if(dp[0][nxt]>dp[0][j]+1)dp[0][nxt] = dp[0][j] + 1;
      if( (val&1) && (dp[1][nxt]>dp[1][j]+1))dp[1][nxt] = dp[1][j] + 1;
    }
    val *= (i+3), val /= i;
  }

  int n;
  while(scanf("%d",&n),n)printf("%d %d\n",dp[0][n],dp[1][n]);
}

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

using namespace std;

int n;
int s[100]={};
int count = 0;
int dai,syou;
int ans[1000]={};
int judge = 0;

int main()
{
    while(1){
        scanf("%d",&n);
        if(n == 0){
            break;
        }
        dai = 0;
        syou = 1000;
        for(int i=0;i<n;i++){
            scanf("%d",&s[i]);
            if(dai <= s[i]){
                dai = s[i];
            }
            if(syou >= s[i]){
                syou = s[i];
            }
        }
        int dai_count = 0;
        int syou_count = 0;
        for(int i=0;i<n;i++){
            if(s[i]==dai && dai_count ==0){
                dai_count=1;
                
            }else if(s[i] == syou && syou_count ==0){
                syou_count = 1;
            }else{
                ans[judge] += s[i];
            }
        }
        ans[judge] = ans[judge] / (n-2);
        
        judge++;

    }
    for(int i=0;i<judge;i++){
        cout << ans[i] << endl;
    }

    
    return 0;
}


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

// 型定義
typedef long long ll;
typedef pair<ll, ll> P;

// forループ
#define REP(i,n) for(ll i=0; i<(ll)(n); ++i)

// 定数宣言
const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;

// グラフ表現
using Graph = vector<vector<int>>;

// グラフの辺表現
using Edge = map<pair<int,int>,int>;

// n次元配列の初期化。第２引数の型のサイズごとに初期化していく。
template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){
    std::fill( (T*)array, (T*)(array+N), val );
}

// 最大公約数
ll gcd(ll a,ll b){
   if (a%b == 0) return(b);
   else return(gcd(b, a%b));
}

// 最小公倍数
ll lcm(ll a, ll b){
    return a*b/gcd(a, b);
}

char c[51][51];
int v[51][51];
int dx[] = {1, -1, 0, 0};
int dy[] = {0, 0, 1, -1};

int main()
{
    cout << fixed << setprecision(15);
    ll H, W;
    cin >> H >> W;

    ll black = 0;
    ll white = 0;
    REP(i, H) {
        REP(j, W) {
            cin >> c[i][j];
            // はじめは全ての頂点を到達不可に
            v[i][j] = -1;

            if(c[i][j] == '.') white++;
            if(c[i][j] == '#') black++;
        }
    }

    if(c[0][0] == '#'){
        cout << -1 << endl;
        return 0;
    }
    if(c[H-1][W-1] == '#'){
        cout << -1 << endl;
        return 0;
    }

    // キューを準備
    queue<P> que;
    // 探索の初期値を入れる
    que.push(P(0, 0));
    v[0][0] = 0;

    while(true) {
        //　もしも探索地点がゴールならば現在の歩数を探索終了
        if(que.empty()) {
            break;
        }
        // キューの中身を取り出す
        P p = que.front(); que.pop();
        int x = p.first;
        int y = p.second;
        int s = v[x][y];

        
        // 4方向へ繰り返す
        REP(i, 4) {
            int nx = x+dx[i];
            int ny = y+dy[i];
            // 移動すると範囲外になったり、#だったり、探索済みだったら終了する
            if(nx < 0 || nx >= H || ny < 0 || ny >= W
                || v[nx][ny] != -1 || c[nx][ny] == '#') continue;
            // 未探索だったら、キューに入れて現在の距離を記録
            que.push(P(nx, ny));
            v[nx][ny] = s+1;
        }
    }
    if(v[H-1][W-1] == -1){
        cout << -1 << endl;
        return 0;
    }
    cout << white - (v[H-1][W-1]+1) << endl;
    return 0;
}

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

#define _GLIBCXX_DEBUG

//vector<int> A(M), B(M);
//vector<vector<char>> answer(N, vector<char>(N, '-'));

int main() {
  string s;
  int a, b, c;
  
  cin >> s;
  
  if(s[0]==s[1] && s[1]==s[2])
    cout << "No" << endl;
  else
    cout << "Yes" << endl;
  
  return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define fore(i,a) for(auto &i:a)
#define all(x) (x).begin(),(x).end()
#pragma GCC optimize ("-O3")
using namespace std; void _main(); int main() { cin.tie(0); ios::sync_with_stdio(false); _main(); }
typedef long long ll; const int inf = INT_MAX / 2; const ll infl = 1LL << 60;
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; }
//---------------------------------------------------------------------------------------------------
/*---------------------------------------------------------------------------------------------------
　　　　　　　　　　　 ∧＿∧  
　　　　　 ∧＿∧ 　（´<_｀ ）　 Welcome to My Coding Space!
　　　　 （ ´_ゝ`）　/　 ⌒i     
　　　　／　　　＼　 　 |　|     
　　　 /　　 /￣￣￣￣/　　|  
　 ＿_(__ﾆつ/　    ＿/ .| .|＿＿＿＿  
　 　　　＼/＿＿＿＿/　（u　⊃  
---------------------------------------------------------------------------------------------------*/




int N, X, A[101], Y, B[101], Z, C[101];
//---------------------------------------------------------------------------------------------------
void _main() {
    cin >> N;
    cin >> X; rep(i, 0, X) cin >> A[i], A[i]--;
    cin >> Y; rep(i, 0, Y) cin >> B[i], B[i]--;
    cin >> Z; rep(i, 0, Z) cin >> C[i], C[i]--;

    int nc = Z;
    int nac = 0;
    rep(i, 0, N) {
        int ok = 0;
        rep(j, 0, X) if (A[j] == i) ok++;
        rep(j, 0, Z) if (C[j] == i) ok++;
        if (ok == 2) nac++;
    }
    int nabc = 0;
    rep(i, 0, N) {
        int ok = 0;
        rep(j, 0, X) if (A[j] == i) ok++;
        rep(j, 0, Y) if (B[j] == i) ok++;
        rep(j, 0, Z) if (C[j] == i) ok++;
        if (ok == 3) nabc++;
    }

    int ans = nc - nac + nabc;
    cout << ans << endl;
}


Measured memory_bytes: 3168
#include <bits/stdc++.h>
using namespace std;
int main()
{
	int a;
	cin>>a;
	if(a==25)
	cout<<"Christmas";
	if(a==24)
	cout<<"Christmas Eve";
	if(a==23)
	cout<<"Christmas Eve Eve";
	if(a==22)
	cout<<"Christmas Eve Eve Eve";
	return 0;
}

Measured memory_bytes: 256
import java.util.*;
import java.io.*;

public class Main {
	static int mod = (int) 1e9 + 7;
	static int DX[] = { -1, 0, 1, 0 }, DY[] = { 0, -1, 0, 1 };

	public static void main(String[] args) {
		FastScanner fs = new FastScanner(System.in);
		int a = fs.nextInt(), b = fs.nextInt();
		String sa = "";
		String sb = "";
		for(int i=0;i<b;i++) {
			sa += a;
		}
		for(int i=0;i<a;i++) {
			sb += b;
		}
		
		if(sa.compareTo(sb)>=0) {
			System.out.println(sb);
		}else {
			System.out.println(sa);
		}
		
	}
}

//高速なScanner
class FastScanner {
	private BufferedReader reader = null;
	private StringTokenizer tokenizer = null;

	public FastScanner(InputStream in) {
		reader = new BufferedReader(new InputStreamReader(in));
		tokenizer = null;
	}

	public String next() {
		if (tokenizer == null || !tokenizer.hasMoreTokens()) {
			try {
				tokenizer = new StringTokenizer(reader.readLine());
			} catch (IOException e) {
				throw new RuntimeException(e);
			}
		}
		return tokenizer.nextToken();
	}

	public String nextLine() {
		if (tokenizer == null || !tokenizer.hasMoreTokens()) {
			try {
				return reader.readLine();
			} catch (IOException e) {
				throw new RuntimeException(e);
			}
		}
		return tokenizer.nextToken("\n");
	}

	public long nextLong() {
		return Long.parseLong(next());
	}

	public int nextInt() {
		return Integer.parseInt(next());
	}

	public double nextDouble() {
		return Double.parseDouble(next());
	}

	public int[] nextIntArray(int n) {
		int[] a = new int[n];
		for (int i = 0; i < n; i++)
			a[i] = nextInt();
		return a;
	}

	public long[] nextLongArray(int n) {
		long[] a = new long[n];
		for (int i = 0; i < n; i++)
			a[i] = nextLong();
		return a;
	}
}

Measured memory_bytes: 21332
package main

import(
    "fmt"
)



func main() {
    var a,b string
    fmt.Scan(&a,&b)
    ans := "="
    switch{
        case a<b:
            ans = "<"
        case a>b:
            ans = ">"
    }
    fmt.Println(ans)
}





func abs32(a int) int {
    if a<0{
        return -a
    }
    return a
}

func abs64(a int64) int64 {
    if a<0{
        return -a
    }
    return a
}

func min32(a, b int) int {
    if a >= b {
        return b
    }
    return a
}

func max32(a, b int) int {
    if a >= b {
        return a
    }
    return b
}

func min64(a, b int64) int64 {
    if a >= b {
        return b
    }
    return a
}

func max64(a, b int64) int64 {
    if a >= b {
        return a
    }
    return b
}

func gcd(a, b int64) int64 {
    if a % b == 0 {
        return b
    } else {
        return gcd(b, a%b)
    }
}

func lcm(a, b int64) int64 {
    return a / gcd(a, b) * b
}

func scanNums(len int) (nums []int){
    var num int
    for i:=0; i<len; i++{
        fmt.Scan(&num)
        nums = append(nums,num)
    }
    return
}

func scanNums64(len int) (nums []int64){
    var num int64
    for i:=0; i<len; i++{
        fmt.Scan(&num)
        nums = append(nums,num)
    }
    return
}

func scanString(len int) (str []string){
    var s string
    for i:=0; i<len; i++{
        fmt.Scan(&s)
        str = append(str,s)
    }
    return
}

func scanTwoNums(n,m int) ([][]int){
    Nums := make([][]int, n)
    for i:=0; i<n; i++{
        Nums[i] = make([]int, m)
    }
    return Nums
}


Measured memory_bytes: 512
#include <stdio.h>

int main()
{
    int n,m,a[100],i,j,sum = 0;

    scanf("%d %d",&n,&m);
    for (i = 0; i < n; i++)
    {
        scanf("%d",&a[i]);
        sum += a[i];
    }
    int ans = 0;
    for (i = 0; i < n; i++)
    {
        if(a[i] * 4 * m >= sum)
        {
            ans++;
        }
    }

    if(m <= ans)printf("Yes");
    else printf("No");
}


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

int main()
{
    priority_queue<int> data;
    string s;
    while (cin >> s && s != "end")
    {
        if (s == "insert")
        {
            int n;
            cin >> n;
            data.push(n);
        }
        else
        {
            cout << data.top() << endl;
            data.pop();
        }
    }
    return 0;
}



Measured memory_bytes: 6988
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  string N;
  cin >> N;
  
  int a = N.size();
  int count = 0;
  
  for(int i = 0; i < a; i++){
    if(N.at(i) == '7'){
      count++;
    }
  }
  
  if(count == 0){
    cout << "No" << endl;
  }
  
  else{
    cout << "Yes" << endl;
  }
}

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

const ll mod=1000000007;

int main() {
  string s;
  cin >> s;
  if(s=="ABC")cout<<"ARC"<<endl;
  else cout<<"ABC"<<endl;
}

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

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

int main()
{   
    int k,s,res=0;cin>>k>>s;
    for(int i=0;i<k+1;i++){
        for(int j=0;j<k+1;j++){
            s-i-j<=k and s-i-j>=0? res++:1;
        }
    }
    cout<<res<<endl;
}


Measured memory_bytes: 256
/// Rustで競技プログラミングの入力をスッキリ記述するマクロ
///
/// https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

#[inline]
#[allow(dead_code)]
fn gcd(mut m: u64, mut n: u64) -> u64 {
    if m < n {
        std::mem::swap(&mut m, &mut n);
    }

    loop {
        let k = m % n;
        if k == 0 {
            return n;
        }

        m = n;
        n = k;
    }
}

#[inline]
#[allow(dead_code)]
fn lcm(m: u64, n: u64) -> u64 {
    m / gcd(m, n) * n
}

macro_rules! eprint(
    ($($arg:tt)*) => { {
        use std::io::Write;
        let r = write!(&mut ::std::io::stderr(), $($arg)*);
        r.expect("failed printing to stderr");
    } }
);

macro_rules! eprintln(
    ($($arg:tt)*) => { {
        use std::io::Write;
        let r = writeln!(&mut ::std::io::stderr(), $($arg)*);
        r.expect("failed printing to stderr");
    } }
);

macro_rules! dbg {
    ($val:expr) => {
        // Use of `match` here is intentional because it affects the lifetimes
        // of temporaries - https://stackoverflow.com/a/48732525/1063961
        match $val {
            tmp => {
                eprintln!(
                    "[{}:{}] {} = {:#?}",
                    file!(),
                    line!(),
                    stringify!($val),
                    &tmp
                );
                tmp
            }
        }
    };
}

fn main() {
    input! {
        n: chars,
    }

    let original = n
        .iter()
        .map(|c| c.to_digit(10).unwrap() as i64)
        .fold(0, |acc, x| acc + x);
    let under = (n[0].to_digit(10).unwrap() as i64 - 1) + (9 * (n.len() as i64 - 1));

    let answer = std::cmp::max(original, under);
    println!("{}", answer);
}


Measured memory_bytes: 4352
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
 
def main():
	K = int(input())
	if K % 2 == 0:
		n = K / 2
		x = round(n**2)
	else:
		n = (K + 1) / 2
		x = round(n * (n-1))
	print(x)

if __name__ == '__main__':
	main()

Measured memory_bytes: 2940
#include<cstdio>
#include<queue>
#define maxn 500005
using namespace std;
int max(int a,int b){
	return a>b?a:b;
}
int n,k,a[maxn],t[maxn<<2],head[maxn],cnt=0,d[maxn],ans[maxn];
struct edge{
	int nxt,to;
}e[maxn<<1];
priority_queue<int> q;
void change(int p,int l,int r,int L,int R){
	if(l==r){
		t[p]=max(t[p],R);
		return;
	}
	int mid=(l+r)>>1;
	if(L<=mid)
		change(p<<1,l,mid,L,R);
	else
		change(p<<1|1,mid+1,r,L,R);
	t[p]=max(t[p<<1],t[p<<1|1]);
}
int Find(int p,int l,int r,int L,int R){
	if(L<=l&&r<=R){
		return t[p];
	}
	int mid=(l+r)>>1;
	if(R<=mid)
		return Find(p<<1,l,mid,L,R);
	else if(L>mid)
		return Find(p<<1|1,mid+1,r,L,R);
	else
		return max(Find(p<<1,l,mid,L,mid),Find(p<<1|1,mid+1,r,mid+1,R));
}
void add(int u,int v){
	e[++cnt].nxt=head[u];
	e[cnt].to=v;
	head[u]=cnt;
	d[v]++;
}
int main(){
	scanf("%d%d",&n,&k);
	k--;
	for(int i=1;i<=n;i++){
		int x;
		scanf("%d",&x);
		a[x]=i;
	}
	for(int i=1;i<=n;i++){
		int x=Find(1,1,n,a[i],a[i]+k);
		if(x>=1&&x<=n)
			add(a[x],a[i]);
		x=Find(1,1,n,a[i]-k,a[i]);
		if(x>=1&&x<=n)
			add(a[x],a[i]);
		change(1,1,n,a[i],i);
	}
	for(int i=1;i<=n;i++){
		if(!d[i])
			q.push(-i);
	}
	cnt=0;
	while(q.size()){
		int u=-q.top();
		q.pop();
		for(int i=head[u];i;i=e[i].nxt){
			int v=e[i].to;
			if(!(--d[v])){
				q.push(-v);
			}
		}
		ans[u]=++cnt;
	}
	for(int i=1;i<=n;i++)
		printf("%d\n",ans[i]);
	return 0;
}

Measured memory_bytes: 25464
#include <algorithm>
#include <functional>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <string>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <vector>
#include <list>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <bitset>
#include <climits>

#define all(c) (c).begin(), (c).end()
#define rep(i,n) for(int i=0;i<(n);i++)
#define pb(e) push_back(e)
#define mp(a, b) make_pair(a, b)
#define fr first
#define sc second

const int INF=100000000;

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

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

int H,W;
string donut[11];
map<string, int> res;

void dfs(string str,int sy,int sx, int y,int x,int a) {
    int ny = (y+dy[a]+H) % H;
    int nx = (x+dx[a]+W) % W;
    res[str]++;
    if(sy==ny && sx==nx) return;

    dfs(str+donut[ny][nx],sy,sx,ny,nx,a);
}

string cmp(string s1,string s2) {
    if(s1.size() > s2.size()) return  s1;
    else if(s1.size() < s2.size()) return s2;
    else return s1 < s2 ? s1 : s2;
}

void solve() {
    res.clear();
    rep(i,11) donut[i]="";
    rep(i,H) cin>>donut[i];
    rep(y,H) rep(x,W) {
        rep(a,8) {
            string tmp;
            tmp = donut[y][x];
            dfs(tmp,y,x,y,x,a);
        }
    }
    string ans;
    for(const auto &it : res){
        if(it.sc >= 2) {
            ans = cmp(ans,it.fr);
        }
    }
    if(ans.size() <= 2) ans = "0";
    cout<<ans<<endl;
}

int main() {
    while(cin>>H>>W) {
        if(H+W==0) break;
        solve();
    }
    return 0;
}

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

// 総数を1000000007（素数）で割った余り
const long long mod = 1e9 + 7;

using ll = long long;
using pii  = pair<int, int>;
using pll = pair<ll, ll>;
#define ull unsigned long long
#define ld long double
#define vi vector<int>
#define vll vector<ll>
#define vc vector<char>
#define vs vector<string>
#define vpii vector<pii>
#define vpll vector<pll>

#define rep(i, n) for (int i = 0, i##_len = (n); i < i##_len; i++)
#define rep1(i, n) for (int i = 1, i##_len = (n); i <= i##_len; i++)
#define repr(i, n) for (int i = ((int)(n)-1); i >= 0; i--)
#define rep1r(i, n) for (int i = ((int)(n)); i >= 1; i--)

#define sz(x) ((int)(x).size())
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()

#define SORT(v, n) sort(v, v + n);
#define VSORT(v) sort(v.begin(), v.end());
#define RSORT(x) sort(rall(x));
#define pb push_back
#define mp make_pair

#define INF (1e9)
#define PI (acos(-1))
#define EPS (1e-7)

ull gcd(ull a, ull b) { return b ? gcd(b, a % b) : a; }
ull lcm(ull a, ull b) { return a / gcd(a, b) * b; }

int main(){
    int n;
    cin >> n;
    string s;
    cin >> s;
    vector<map<char, int>> mp(n);
    rep1(i, n-1) {
        rep(j, i) mp[j][s[i]]++;
    }
    ll ans = 0;
    rep(i, n-2) for (int j=i+1; j<n-1; ++j) {
        if (s[i]==s[j]) continue;
        char k;
        if (s[i]!='R'&&s[j]!='R') k = 'R';
        if (s[i]!='G'&&s[j]!='G') k = 'G';
        if (s[i]!='B'&&s[j]!='B') k = 'B';
        ans += mp[j][k];
        if (i+2*(j-i)<n) {
            if (s[i+2*(j-i)]==k) --ans;
        }
    }
    cout << ans << endl;
    return 0;
}


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

using namespace std;

int main() {
  string s, t;
  cin >> s >> t;
  int count = INT_MAX;
  for (int i = 0; i <= s.size() - t.size(); i++) {
    int total = 0;
    for (int j = 0; j < t.size(); j++) {
      if (s[i + j] != t[j]) {
        total++;
      }
    }
		count = min(count, total);
  }
  cout << count << endl;
}


Measured memory_bytes: 3592
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int top, S[1000];

void push(int x){
  top++;
  S[top] = x;
}

int pop(){
  top--;
  return S[top+1];
}

int main(void){
  int a, b;
  char s[100];
  top = 0;

  while (scanf("%s", s) != EOF) {
    if (s[0] == '+') {
      a = pop();
      b = pop();
      push(a+b);
    }
    else if (s[0] == '-') {
      a = pop();
      b = pop();
      push(b-a);
    }
    else if (s[0] == '*') {
      a = pop();
      b = pop();
      push(a*b);
    }
    else {
      push(atoi(s));
    }
  }
  
  printf("%d\n", pop());

  return 0;
}



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

int main() {
    int a, b, c;
    cin >> a >> b >>c;

    if (a < b) {
        if (a <= c && c <= b)
            puts("Yes");
        else
            puts("No");
    }
    else {
        if (b <= c && c <= a)
            puts("Yes");
        else
            puts("No");
    }
    return 0;
}

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

result = 0
count = 0
tmp = 0
for i in lists:
  if tmp >= i:
    count += 1
    tmp = i
  else:
    result = max(result,count)
    count = 0
    tmp = i

result = max(result,count)
print(result)

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

int main()
{
	ios::sync_with_stdio(false);
	
	int n,s=0;
	cin>>n;
	char a[n];
	int b[4]={0};
	
	for(int i=0;i<n;i++)
	{
		cin>>a[i];
		if(a[i]=='G')
			b[0]=1;
		if(a[i]=='W')
			b[1]=1;
		if(a[i]=='Y')
			b[2]=1;
		if(a[i]=='P')
			b[3]=1;
	}
	
	for(int i=0;i<4;i++)
		if(b[i]==1)
			s++;
	
	if(s==3)
		cout<<"Three"<<endl;
	if(s==4)
		cout<<"Four"<<endl;
	
	return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();
		String op = sc.next();
		int B = sc.nextInt();
		if(op.equals("+")){
			System.out.println(A + B);
		}else{
			System.out.println(A - B);
		}
	}
}

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

using namespace std;

typedef long long ll;
#define NG (-1);

int x,y,z;
ll k,temp,times;
bool pivot = true;
vector <ll> a,b,c;
vector <ll> sumbc;

void enter()
{
    cin >> x >> y >> z >> k;
    a.resize(x);
    b.resize(y);
    c.resize(z);
    for (int i = 0; i < x ; i ++) cin >> a[i];
    for (int i = 0; i < y ; i ++) cin >> b[i];
    for (int i = 0; i < z ; i ++) cin >> c[i];
}

void process()
{
    for (int i = 0 ; i < y ; i ++)
        for (int j = 0 ; j < z ; j++)
        {
            temp = b[i] + c[j];
            sumbc.push_back(temp);
        }
    sort(sumbc.rbegin(),sumbc.rend());

    /*for (int i = 0; i < x ; i ++) cout << a[i] << " ";
    cout << endl;
    for (int i = 0; i < sumbc.size() ; i ++) cout << sumbc[i] << " ";
    cout << endl;*/

    vector <int> bcidx(x);

    for (int turn = 0; turn < k; ++turn)
	{
	    ll bestval = NG;
	    int besti = NG;
	    ll val;

		for (int i = 0 ; i < x ; i ++)
        {
            val = a[i] + sumbc[bcidx[i]];
            if (val > bestval)
            {
                bestval = val;
                besti = i;
            }
        }

        cout << bestval << endl;
        bcidx[besti]++;
	}
}

int main()
{

    enter();
    process();
    return 0;

}


Measured memory_bytes: 10480
import sys
input=sys.stdin.readline
class SegTree:
    def __init__(self, l):
        emp=-1 #空白を埋める数
        #2の冪乗にする
        N=len(l)
        n=N
        layer=1
        bottom=1
        while n>1:
            n=n/2
            layer+=1
            bottom*=2
        L=[emp]*(2*bottom-1)
        #初期化
        for i in range(N):
            L[bottom-1+i]=l[i]
        for i in range(bottom-2,-1,-1):
            L[i]=max(L[2*i+1],L[2*i+2])
        self.tree=L
        self.bottom=bottom
        self.layer=layer
        self.emp=emp

    def add(self,index,num):
        x=self.bottom+index-1
        self.tree[x]+=num
        for _ in range(self.layer-1):
            x=(x-1)//2
            self.tree[x]=max(self.tree[2*x+1],self.tree[2*x+2])

    #l<=x<r
    def segment(self,l,r):
        s=-1
        L=self.bottom+l
        R=self.bottom+r
        while L<R:
            if L&1:
                s=max(s,self.tree[L-1])
                L+=1
            if R&1:
                R-=1
                s=max(s,self.tree[R-1])
            L//=2
            R//=2
        return s
INF=998244353
n=int(input())
l=[]
for i in range(n):
    x,d=map(int,input().split())
    l.append((x,d))
l.sort()
x=[]
d=[]
for i in l:
    x.append(i[0])
    d.append(i[1])
dp=[1]
Sum=[1]
import bisect
t=[0]*n
t=SegTree(t)
for i in range(n):
    y=x[n-1-i]+d[n-1-i]
    m=bisect.bisect_left(x,y)
    z=t.segment(n-1-i,m)
    m=max(m,z)
    t.add(n-1-i,m)
    dp.append(Sum[n-m])
    s=(Sum[-1]+dp[-1])%INF
    Sum.append(s)
print(Sum[-1])


Measured memory_bytes: 122116
#include <bits/stdc++.h>
using namespace std;
//#define int lint
typedef long long lint;
typedef pair<int,int> P;
const int    INF=(int)1e9;
const int    MOD=(int)1e9+7;
const double EPS=(double)1e-10;
struct Accelerate_Cin{
    Accelerate_Cin(){
        cin.tie(0); ios::sync_with_stdio(0);cout<<fixed<<setprecision(20);
    };
};



signed main(){
  int x;cin>>x;
  if(1200>x){
    cout<<"ABC"<<endl;
  }else{
    cout<<"ARC"<<endl;
  }

  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define bug1(x) cout<<#x<<" = "<<x<<endl
#define bug2(x,y) cout<<#x<<" = "<<x<<" "<<#y<<" = "<<y<<endl
#define bug3(x,y,z) cout<<#x<<" = "<<x<<" "<<#y<<" = "<<y<<" "<<#z<<" = "<<z<<endl
#define bug4(x,y,z,m) cout<<#x<<" = "<<x<<" "<<#y<<" = "<<y<<" "<<#z<<" = "<<z<<" "<<#m<<" = "<<m<<endl

using namespace std;

class Debugger {
public:
	template<typename T>
	void printVector(vector<T> const &vec, bool printSize=true){
		if(printSize){
			cout << vec.size() << endl;
		}
		for(auto &elem : vec){
			cout << elem << " ";
		}
		cout << endl;
	}

	template<typename T>
	void printMatrix(vector<vector<T>> const &matrix){
		cout << matrix.size()<< " ";
		if(!matrix.empty()){
			cout << matrix[0].size();
		}
		cout << endl; 
		for(auto &vec : matrix){
			printVector(vec, false);
		}
		cout << endl;
	}
};

const int maxN = 200000 + 5;
const double PI = acos(-1);
#define ll long long

class TaskC {
private:
	Debugger debugger;
	vector<pair<int,int>> values[105];
public:
	void solveOne(int it){
		int n, k;
		cin >> n >> k;
		vector<int> nums(n);
		for(int i = 0; i < n; i++){
			cin >> nums[i];
		}
		int step = 0;
		while(k--){
			step++;
			vector<int> sum(n);
			for(int i = 0; i < n; i++){
				int b = max(0, i - nums[i]);
				int e = min(n,i + nums[i] + 1);
				sum[b]++;
				if(e < n){
					sum[e]--;
				}
			}
			for(int i = 1; i < n; i++){
					sum[i] += sum[i-1];
			}
			if(sum == nums){
				break;
			}
			nums = sum;
		}
		for(int i = 0; i < n; i++){
			cout << nums[i] << " ";
		}
		cout << endl;
	}

	void solve(){
		int tc = 1;
		for(int it = 1; it <= tc; it++){
			solveOne(it);
		}
	}
};


int main(){
	ios_base::sync_with_stdio(false);
	TaskC solver;
	solver.solve();
	return 0;
}


Measured memory_bytes: 4940
#include <iostream>
#include <cstring>
#include <cmath>
#include <bitset>
using namespace std;
const int N = 100;
const int M = 6401;
const int Y = 6400;
int H, W, A[N][N], B[N][N];
bitset<M*2> dp[N][N];


int main(){
    cin >> H >> W;
    for (int i = 1; i <= H; i++){
        for (int j = 1; j <= W; j++){
            cin >> A[i][j];
        }
    }
    for (int i = 1; i <= H; i++){
        for (int j = 1; j <= W; j++){
            cin >> B[i][j];
        }
    }
    dp[0][1][Y] = dp[1][0][Y] = 1;
    for (int i = 1; i <= H; i++){
        for (int j = 1; j <= W; j++){
            int cha = abs(A[i][j] - B[i][j]);
            dp[i][j] |= ((dp[i-1][j] << cha)|(dp[i-1][j] >> cha));
            dp[i][j] |= ((dp[i][j-1] << cha)|(dp[i][j-1] >> cha));
        }
    }
    int ans = 0x3f3f3f3f;
    for (int i = 0; i < 2*M; i++){
        if (dp[H][W][i]) ans = min(ans, abs(i-Y));
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 14208
// https://atcoder.jp/contests/abc172/tasks/abc172_d
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define REP(i, n) FOR(i, 0, n)
#define REPR(i, n) for (int_fast32_t i = n - 1; i >= 0; i--)
#define FOR(i, s, n) for (int_fast32_t i = (s), i##_len = (n); i < i##_len; ++i)
#define ALL(obj) (obj).begin(), (obj).end()
#define ALLR(obj) (obj).rbegin(), (obj).rend()
#define DIV(a, b) ((a - 1) / b + 1)

// 二乗法によるべき乗
int ipow(int base, int exp) {
    int result = 1;
    while (exp) {
        if (exp & 1)
            result *= base;
        exp >>= 1;
        base *= base;
    }

    return result;
}

// 等比数列の和(a=初項、r=公比、項数=n)
int sumOfTouhi(int a, int r, int n) { return a * ipow(r, n) - a / (r - 1); }

// 等差数列の和(a=初項、d=公差、項数=n)
int sumOfTousa(int a, int d, int n) { return n * (2 * a + (n - 1) * d) / 2; }

signed main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int N;
    cin >> N;
    // １の倍数＋２の倍数＋３の倍数＋・・・
    int ans = 0;
    FOR(i, 1, N + 1) { ans += sumOfTousa(i, i, N / i); }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 3596
// includes {{{
#include<iostream>
#include<iomanip>
#include<algorithm>
#include<vector>
#include<stack>
#include<queue>
#include<deque>
#include<map>
#include<set>
#include<tuple>
#include<cmath>
#include<random>
#include<cassert>
// }}}
// #include<bits/stdc++.h>
using namespace std;
using ll = long long;

signed main() {
  std::ios::sync_with_stdio(false), std::cin.tie(0);
  int n;cin>>n;
  int x[101], y[101], h[101];
  int t;
  for(int i = 0; i < n;i++) {
    cin >> x[i] >> y[i] >> h[i];
    if(h[i] > 0) t = i;
  }
  for(int i = 0; i < 101; i++)
    for(int j = 0; j < 101; j++) {
      int hh = h[t] + abs(x[t]-i) + abs(y[t]-j);
      int ok = 1;
      for(int k = 0; k < n; k++) {
        if(max(0,hh - abs(x[k]-i) - abs(y[k]-j)) != h[k]) ok = 0;
      }
      if(ok) {
        cout << i << " " << j << " "<<hh<<endl;
        return 0;
      }
    }
  assert(0);
  return 0;
}


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

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

  if(500*k >= x)
    cout << "Yes";
  else
  {
    cout << "No";
  }

}


Measured memory_bytes: 3592
#include <bits/stdc++.h>
 
#define FOR(i, a, b) for(int i=(a);i<(b);++i)
#define rep(i, n)  for(int i=0;i<(n);++i)
#define REPr(i, n) for(int i=(n)-1;i>=0; --i)
#define FORq(i, m, n) for(int i = (m);i <= (n);++i)
#define FORqr(i, m, n) for(int i = (n);i >=(m);--i)
#define PB push_back
#define MP make_pair
#define DEBUG printf("%s\n","debug")
#define fst first
#define snd second
#define SIN(x, S) (S.count(x) != 0)
#define M0(x) memset(x,0,sizeof(x))
#define FILL(x, y) memset(x,y,sizeof(x))
#define MM(x) memset(x,-1,sizeof(x))
#define ALL(x) (x).begin(),(x).end()
using namespace std;
typedef pair<int, int> PII;
typedef pair<long long, long long> PLL;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<long long> VL;
typedef long long ll;
typedef long long integer;
///////////////////////////////////////////////
/* (๑╹◡╹) */
ll gcd(ll x, ll y) { return y ? gcd(y, x % y) : x; }
ll MOD = 1000000007;
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;
}
/* (๑╹◡╹)(๑╹◡╹)(๑╹◡╹)(๑╹◡╹)(๑╹◡╹)(๑╹◡╹) */
///////////////////////////////////////////////
const int MAX = 510000;
 
long long fac[MAX], finv[MAX], inv[MAX];
 



int main() {
	int ans = 0;
	int r; cin >> r;
	ans = 3*r*r;
	cout << ans << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define For(i,n,k) for(int i=(n);i<(k);i++)
#define ALL(a)  (a).begin(),(a).end()
const ll MAX = 100010;
const ll MOD = 1000000007;
ll fac[MAX], finv[MAX], inv[MAX];
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (ll i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}
ll COM(ll n, ll k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}
void Main(){
    int n;
    cin >> n;
    vector<int> p(n+1,-1);
    ll outer;
    For(i,0,n+1){
        int a;
        cin >> a;
        if(p[a]==-1) p[a] = i;
        else{
            outer = n - i + p[a];
        }
    }
    COMinit();
    For(k,1,n+2){
         ll ans = COM(n+1,k) - COM(outer,k-1);
         cout << (ans+MOD)%MOD << endl;
    }
}
int main(){
    Main();
    /*
    東方風神録は神が出てくるので当然神ゲー
    */
    return 0;
}

Measured memory_bytes: 3968
from collections import Counter

N = int(input())
l = [input() for _ in range(N)]
cnt = Counter(l)
M = max(list(cnt.values()))
ans = []

for k in cnt.keys():
    if cnt[k]==M:
        ans.append(k)

ans.sort()

for ans_i in ans:
    print(ans_i)

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

int main(){
  int n;
  cin >> n;
  vi a(n);
  rep(i,n) cin >> a[i];
  sort(a.begin(),a.end());
  cout << a[n-1] << ' ';
  double half=a[n-1];
  half/=2;
  int ans=a[0];
  for(int i=1;i<n-1;i++){
    if(abs(half-a[i])<abs(half-ans)) ans=a[i];
  }
  cout << ans << "\n";
  return 0;
}

Measured memory_bytes: 3788