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

using namespace std;

typedef struct node_{
    int id;
    node_* left;
    node_* right;
}* node;

void printPreorder(node root){
    printf(" %d", root -> id);
    if(root -> left != NULL){
        printPreorder(root -> left);
    }
    if(root -> right != NULL){
        printPreorder(root -> right);
    }
}

void printInorder(node root){
    if(root -> left != NULL){
        printInorder(root -> left);
    }
    printf(" %d", root -> id);
    if(root -> right != NULL){
        printInorder(root -> right);
    }
}

void printTree(node root){
    if(root == NULL){
        printf("\n\n");
    }else{
        printInorder(root);
        printf("\n");
        printPreorder(root);
        printf("\n");
    }
}

void nodeInsert(node root, node nd){
    if(root -> id > nd -> id){
        if(root -> left == NULL){
            root -> left = nd;
        }else{
            nodeInsert(root -> left, nd);
        }
    }else{
        if(root -> right == NULL){
            root -> right = nd;
        }else{
            nodeInsert(root -> right, nd);
        }
    }
    
}

int findNode(node root, int key){
    if(key == root -> id){
        return 1;
    }else if(key < root -> id && root -> left != NULL){
        int ans = findNode(root -> left, key);
        return(ans);
    }else if(key > root -> id && root -> right != NULL){
        int ans = findNode(root -> right, key);
        return ans;
    }else{
        return 0;
    }
    return 0;
}

int main(){
    int n;
    scanf("%d", &n);
    char* option = new char[7];
    node root = NULL;
    for(int i = 0; i < n; i++){
        scanf("%s", option);
        if(strcmp(option, "insert") == 0){
            int id;
            scanf("%d", &id);
            node nd = new node_;
            nd -> id = id;
            nd -> left = NULL;
            nd -> right = NULL;
            if(root == NULL){
                root = nd;    
            }else{
                nodeInsert(root, nd);
            }
        }else if(strcmp(option, "print") == 0){
            printTree(root);
        }else{
            int key;
            scanf("%d", &key);
            if(findNode(root, key) == 1){
                printf("yes\n");
            }else{
                printf("no\n");
            }
        }
    }
    return 0;
}


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

using namespace std;

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

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

void solve(){
    int x, y; cin >> x >> y;

    for(int i = 0; i <= x; i++){
        int rem = x - i;
        int sum = i * 2 + rem * 4;
        if(sum == y){
            cout << "Yes" << endl;
            return;
        }
    }

    cout << "No" << endl;
}

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

    solve();
    
    return 0;
}



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

int binarySearch(int *,int);

int N,M;

int main(){
  int count=0,a;
  int i,*arrayS,*arrayT;
  
  scanf("%d",&N);
  arrayS = (int *)malloc(sizeof(int) * N);
  for(i=0;i<N;i++){
    scanf("%d",&arrayS[i]);
  }

  scanf("%d",&M);
  arrayT = (int *)malloc(sizeof(int) * M);
  for(i=0;i<M;i++){
    scanf("%d",&arrayT[i]);
  }

  for(i=0;i<M;i++){
    a = binarySearch(arrayS,arrayT[i]);
    count+=a;
  }
  
  printf("%d\n",count);

free(arrayS);
free(arrayT);

return 0;
}

int binarySearch(int arrayS[],int key){
  int i,left,right,mid;

  left = 0;
  right = N;
  
  while(left<right){
    mid = (left+right)/2;
    
    if(key == arrayS[mid]){
      return 1;
    }
    
    if(key>arrayS[mid]){
      left = mid + 1;
    }
    
    else if(key<arrayS[mid]){
      right = mid;
    }
  }
  return 0;
}

Measured memory_bytes: 1152
#include <bits/stdc++.h>
#include <stdlib.h>
using namespace std;
typedef long long ll;
const ll mod=1000000007;
const ll BIG=1e15;

int main(){
    int N;
    cin>>N;
    ll ans=0;
    ll memory=-1, count=0;
    for(int i=0;i<N;i++){
        ll x; cin>>x;
        if(x<=memory) {count++; memory=x;}
        else {ans=max(ans,count); memory=x; count=0;}
        
    }
    ans=max(ans,count);
    cout<<ans<<endl;
}

Measured memory_bytes: 256
import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		String T = sc.next();
		
		int N = T.length();
		
		String ans = "No";
		

		for (int i = 0; i < N; i++) {
			String S1 = S.substring(0, i);
			String S2 = S.substring(i, N);
			
			if( T.equals( S2+S1 ) ){
				ans = "Yes"; 
				break;
			}
		}
		System.out.println(ans);
	}
}

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

struct UnionFind {
    int par[200000];

    UnionFind(int N) {
        rep(i, N) par[i] = i;
    }
    int root(int x) {
        return par[x] == x ? x : par[x] = root(par[x]);
    }
    void unite(int x, int y) {
        x = root(x);
        y = root(y);
        if (x == y) return;
        par[x] = y;
    }
    bool same(int x, int y) {
        return root(x) == root(y);
    }
};

int main() {
    int N, K, L, a, b;
    cin >> N >> K >> L;
    UnionFind road(N), rail(N);
    rep(i, K) {
        cin >> a >> b;
        road.unite(a-1, b-1);
    }
    rep(i, L) {
        cin >> a >> b;
        rail.unite(a-1, b-1);
    }
    
    map<pair<int, int>, int>mp;
    pair<int, int> key[N];
    rep(i, N) {
        key[i] = make_pair(road.root(i), rail.root(i));
        mp[key[i]]++;
    }
    rep(i, N) {
        cout << mp[key[i]] << endl;
    }
}

Measured memory_bytes: 15104
import java.io.*;

import java.util.*;

import java.math.*;



class Main{	

		public static void main(String args[]) throws IOException{
			ArrayList<String> inp = new ArrayList<String>();

			

			Scanner scan = new Scanner(System.in);

			String str1 = scan.next();
			String str2;



			BigInteger big_a;
			BigInteger big_b;
			BigInteger big_sum;


			String str_c;



			int n = Integer.valueOf(str1).intValue();

			

			while(scan.hasNext()){

				str1 = scan.next();
				str2 = scan.next();
				big_a = new BigInteger(str1);
				big_b = new BigInteger(str2);
				big_sum = big_a.add(big_b);
				str_c = big_sum.toString();
				if(str_c.length() > 80)System.out.println("overflow");

				else System.out.println(big_sum);

			}



	}

}

Measured memory_bytes: 12000
#include <bits/stdc++.h>
using namespace std;
#define finish(x) return cout << x << endl, 0
#define ll long long

int n, X;
vector <ll> b, l, r;

ll calc(int day, int a){
	return (a <= b[day] ? l[day] : r[day]) * (a - b[day]);
}
ll sum(int day, int len){
	if(len <= b[day]) return len * l[day];
	return b[day] * l[day] + (len - b[day]) * r[day];
}
ll calc(ll h){
	int q = h / X;
	int r = h % X;
	vector <pair <ll, int> > c;
	for(int i = 0 ; i < n ; i++){
		c.emplace_back(sum(i, X), i);
	}
	sort(c.rbegin(), c.rend());
	ll s = 0;
	for(int i = 0 ; i < q ; i++){
		s += c[i].first;
	}
	if(r == 0) return s;
	ll ret = 0;
	for(int i = 0 ; i < q ; i++){
		ret = max(ret, s - sum(c[i].second, X) + sum(c[i].second, r) + sum(c[q].second, X));
	}
	for(int i = q ; i < n ; i++){
		ret = max(ret, s + sum(c[i].second, r));
	}
	return ret;
}
int main(){
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cin >> n >> X;
	b.resize(n);
	l.resize(n);
	r.resize(n);
	for(int i = 0 ; i < n ; i++){
		cin >> b[i] >> l[i] >> r[i];
	}
	ll D = 0;
	for(int i = 0 ; i < n ; i++){
		D += calc(i, 0);
	}
	ll l = 0, r = 1LL * n * X;
	while(l <= r){
		ll mid = (l + r) / 2;
		if(D + calc(mid) >= 0) r = mid - 1;
		else l = mid + 1;
	}
	cout << l << endl;
}


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

int main(){
  int a, b, n;

  cin >> n;

  int min = 999999;
  for (int a = 1; a < n; a++) {
    int b = n - a;
    int asum, bsum, x, y;
    asum = bsum = 0;
    x = a;
    y = b;
    while (x > 0) {
      asum += x % 10;
      x /= 10;
    }
    while (y > 0) {
      bsum += y % 10;
      y /= 10;
    }
    if (min > asum + bsum) {
      min = asum + bsum;
    }
  }

  cout << min << endl;

  return 0;
}

Measured memory_bytes: 256
#include <algorithm>  
#include <iostream>  
#include <sstream>  
#include <string>  
#include <cstring>
#include <vector>  
#include <queue>  
#include <set>  
#include <map>  
#include <cstdio>  
#include <cstdlib>  
#include <cctype>  
#include <cmath>  
#include <list>  
#include <cassert>
#include <ctime>
#include <climits>
using namespace std;  

#define PB push_back  
#define MP make_pair  
#define SZ(v) ((int)(v).size())  
#define FOR(i,a,b) for(int i=(a);i<(b);++i)  
#define REP(i,n) FOR(i,0,n)  
#define FORE(i,a,b) for(int i=(a);i<=(b);++i)  
#define REPE(i,n) FORE(i,0,n)  
#define FORSZ(i,a,v) FOR(i,a,SZ(v))  
#define REPSZ(i,v) REP(i,SZ(v))  
typedef long long ll;
typedef unsigned long long ull;
ll gcd(ll a,ll b) { return b==0?a:gcd(b,a%b); }

const int MAXN = 200000;
struct V { int id, n0, n1; V() {} V(int id, int n0, int n1) :id(id), n0(n0), n1(n1) {} };
bool operator<(const V &a, const V &b) {
	if (a.n0 == 0 && b.n0 == 0) return a.id < b.id;
	if (a.n0 == 0 || b.n0 == 0) return b.n0 == 0;
	if((ll)a.n1*b.n0 != (ll)b.n1*a.n0) return (ll)a.n1*b.n0 < (ll)b.n1*a.n0;
	return a.id < b.id;
}

int n;
int par[MAXN];
int val[MAXN];

V v[MAXN];
int dsupar[MAXN];
int dsusz[MAXN];
int dsuroot[MAXN];

set<V> opt;

int dsuget(int x) { if (dsupar[x] == x) return x; return dsupar[x] = dsuget(dsupar[x]); }
int dsumerge(int x, int y) {
	assert(x == dsupar[x] && y == dsupar[y] && x != y);
	if (dsusz[x] < dsusz[y]) swap(x, y);
	dsupar[y] = x, dsusz[x] += dsusz[y]; return x;
}

void run() {
	scanf("%d", &n); par[0] = -1; FOR(i, 1, n) scanf("%d", &par[i]), --par[i]; REP(i, n) scanf("%d", &val[i]);

	REP(i, n) v[i] = V(i, val[i] == 0 ? 1 : 0, val[i] == 1 ? 1 : 0), dsupar[i] = i, dsusz[i] = 1, dsuroot[i] = i;
	opt.clear(); FOR(i, 1, n) opt.insert(v[i]);
	ll ret = 0;
	while (SZ(opt) > 0) {
		V a = *opt.begin(); opt.erase(a);
		int aroot = dsuroot[a.id];
		V b = v[dsuget(par[aroot])]; opt.erase(b);
		ret += (ll)b.n1*a.n0;
		int cid = dsumerge(a.id, b.id); dsuroot[cid] = dsuroot[b.id];
		V c(cid, a.n0 + b.n0, a.n1 + b.n1); v[cid] = c; if (dsuroot[cid] != 0) opt.insert(c);
	}
	printf("%lld\n", ret);
}

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


Measured memory_bytes: 19072
#include <cstdio>
#include <iostream>
#include <vector>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <string>
#include <cstring>
#include <sstream>
#include <algorithm>
#include <functional>
#include <queue>
#include <stack>
#include <cmath>
#include <iomanip>
#include <list>
#include <tuple>
#include <bitset>
#include <ciso646>
#include <cassert>

using namespace std;

#define int long long
#define double long double

typedef pair<int, int> P;
typedef tuple<int, int, int> T;

template<class T> string tostr(T x) { stringstream o; o << x; return o.str(); }
template<class T> T sqr(T x) { return x*x; }
template<class T> T mypow(T x, int n) { T r = 1; while (n > 0) { if (n & 1)r = r*x; x = x*x; n >>= 1; }return r; }

int toint(string s) { int v; stringstream i(s); i >> v; return v; }
bool check(int x, int y, int w, int h) { return x >= 0 && y >= 0 && w > x && h > y; }
int gcd(int a, int b) { return b ? gcd(b, a%b) : a; }
int lcm(int a, int b) { return a / gcd(a, b) * b; }

#define REP(i,a,b)	for(int (i) = (a);i < (b);(i)++)
#define rep(i,n)	REP(i,0,n)
#define PER(i,a,b)	for(int (i) = (a-1);i >= (b);(i)--)
#define per(i,n)	PER(i,n,0)
#define each(i,n)	for(auto &i : n)
#define clr(a)		memset((a), 0 ,sizeof(a))
#define mclr(a)		memset((a), -1 ,sizeof(a))
#define all(a)		(a).begin(),(a).end()
#define sz(a)		(sizeof(a))
#define dump(val) 	cerr << #val " = " << val << endl;
#define dum(val)	cerr << #val " = " << val;
#define Fill(a,v)	fill((int*)a,(int*)(a+(sz(a)/sz(*(a)))),v)

const int dx[8] = { +1,+0,-1,+0,+1,+1,-1,-1 };
const int dy[8] = { +0,-1,+0,+1,-1,+1,-1,+1 };
const int mod = 1e9 + 7;
const int INF = 1e17 + 9;

int dp[40][401][401];

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

	Fill(dp, -1);

	int N, Ma, Mb;
	cin >> N >> Ma >> Mb;

	vector<int> va(N), vb(N), vc(N);

	rep(i, N) {
		cin >> va[i] >> vb[i] >> vc[i];
	}

	function<int(int, int, int)> dfs = [&](int m, int a, int b) {
		if (a && b && a * Mb == b * Ma) return 0ll;
		if (N == m)return INF;
		if (dp[m][a][b] != -1)return dp[m][a][b];
		return dp[m][a][b] = min(min(INF, dfs(m + 1, a + va[m], b + vb[m]) + vc[m]), dfs(m + 1, a, b));
	};
	int ans = dfs(0, 0, 0);
	if (ans == INF) ans = -1;
	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 50560
#include <bits/stdc++.h>
#include <algorithm>
using namespace std;
typedef long long ll;
  
int main(void){
    int x, n;
    cin >> x >> n;
    
    vector<int> p;
    for(int i=0; i<n; i++){
        int tmp;
        cin >> tmp;
        p.push_back(tmp);
    }

    //sort(p.begin(), p.end());
    
    int dif =1000;
    for(int j=0; j<n; j++){
        //if(p[j] == x) continue;
        if(dif >= abs(x - p[j])){
            dif = abs(x - p[j]);
        }
    }
    //if(dif==0) dif++;

    for(int i=0;i<100;i++){
        if(!(find(p.begin(), p.end(), x-i) != p.end())
           && (!(find(p.begin(), p.end(), x+i) != p.end()))){
            cout << x-i << endl;
            //cout << "-hoge";
            return 0;
        } else if((find(p.begin(), p.end(), x-i) != p.end())
           && (find(p.begin(), p.end(), x+i) != p.end())){
            //cout << "x=" << x << " cont" << endl;
            continue;
        }else if(!(find(p.begin(), p.end(), x-i) != p.end())
           && ((find(p.begin(), p.end(), x+i) != p.end()))){
            cout << x-i << endl;
            //cout << "-hoge";
            return 0;
        }else if((find(p.begin(), p.end(), x-i) != p.end())
               && (!(find(p.begin(), p.end(), x+i) != p.end()))){
            cout << x+i << endl;
            //cout <<"+hoge";
            return 0;
        }
    }
    
    


    cout << "hoge" ;
    
    return 0;
}


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

#define int long long

int V, E, Q, a, b;
vector<int> G[100001];
vector<int> rG[100001];
vector<int> vs;
bool used[100001];
int cmp[100001];

auto dfs(int v) -> void {
    used[v] = true;
    for (int i = 0; i < G[v].size(); ++i)
        if (!used[G[v][i]])
            dfs(G[v][i]);

    vs.push_back(v);
}

auto rdfs(int v, int k) -> void{
    used[v] = true;
    cmp[v] = k;
    for (int i = 0; i < rG[v].size(); i++)
        if (!used[rG[v][i]])
            rdfs(rG[v][i], k);
}

/**
 * ?????£?????????????§£
 * @return ?????£???????????????????????????????????????????????§???
 */
auto scc() -> int {
    fill(used, used + V, false);
    vs.clear();
    for (int v = 0; v < V; v++) {
        if (!used[v]) dfs(v);
    }
    fill(used, used + V, false);
    int k = 0;
    for (int i = vs.size() - 1; i >= 0; i--)
        if (!used[vs[i]])
            rdfs(vs[i], k++);

    return k;
}

auto main() -> signed {
    cin >> V >> E;
    for (int i = 0; i < E; i++) {
        cin >> a >> b;
        G[a].push_back(b);
        rG[b].push_back(a);
    }
    int k = scc();

    cin >> Q;
    for (int i = 0; i < Q; i++) {
        cin >> a >> b;
        cout << ((cmp[a] == cmp[b]) ? 1 : 0) << endl;
    }
    return 0;
}

Measured memory_bytes: 9004
import java.util.Scanner;
import java.util.stream.Collectors;
import java.util.stream.IntStream;

public class Main {
    public static void main(String[] args) {
        Scanner stdin = new Scanner(System.in);
        int a = stdin.nextInt();
        int b = stdin.nextInt();
        int c = stdin.nextInt();
        
        if (b == c) System.out.println(a);
        if (c == a) System.out.println(b);
        if (a == b) System.out.println(c);
    }
}

Measured memory_bytes: 23252
#include<iostream>
#include<stdio.h>
//#include <bits/stdc++.h>
#include<vector>
#include<float.h>
#include<iomanip>
#include<algorithm>
#include<string>
#include<cstring>
#include<math.h>
#include<cmath>
#include<sstream>
#include<set>
#include<map>
#include<queue>
#include <cassert>
#include <cmath>
#include<cstdint>

#define INF 1e9
#define rep(i,n)for(int i=0;(i)<(int)(n);i++)
#define REP(i,a,b)for(int i=(int)(a);(i)<=(int)(b);i++)
#define VEC(type, c, n) std::vector<type> c(n);for(auto& i:c)std::cin>>i;
#define vec(type,n) vector<type>(n)
#define vvec(m,n) vector<vector<int>> (int(m),vector<int>(n))
#define ALL(a)  (a).begin(),(a).end()

using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
using P = pair<int,int>;

vector<int>bitSearch(int bit,int n){
    vector<int>S;
    rep(i,n)if(bit&(1<<i))S.push_back(i);
    return S;
}



int main(){
   string s;cin>>s;
   int n = s.size();
   bool f = false;
   rep(i,2){
       if(s[i] == s[i+1] && s[i+1] == s[i+2])f = true;
   }
   cout<<(f?"Yes":"No");
}



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


int main() {
  int n;
  cin >> n;
  vector<int> v(n);
  rep(i,n) cin >> v[i];
  vector<int> c(n);
  rep(i,n) cin >> c[i];
  int ans = 0;
  rep(i,n){
    if (v[i] > c[i]){
      ans += v[i] -c[i];
    }
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<cstring>
using namespace std;
int main()
{
    string a;
    cin>>a;
    int flag=0;
    for(int i=0;i<a.size();i++)
    {
        if(a[i]=='C')
        flag=1; 
        if(a[i]=='F'&&flag==1) 
        {
            cout<<"Yes";
            return 0;
        }
    } 
    cout<<"No"<<endl;
    return 0;
}

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

#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
using namespace __gnu_pbds; 
  
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update> 
 
#define FS              ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define ll              long long int
#define ld              long double
#define pb              push_back
#define bp              __builtin_popcount
#define sz              size()
#define ff              first
#define ss              second
#define vll             vector<ll>
#define vbool           vector<bool>
#define vpll            vector<pair<ll,ll>>
#define pll             pair<ll,ll>
#define vllv            vector<vector<ll>>
#define setpri(x)       cout<<setprecision(x)<<fixed;
#define all(v)          v.begin(),v.end()
#define allr(v)         v.rbegin(),v.rend()
#define yesr {cout<<"YES"<<endl;return;}
#define nor {cout<<"NO"<<endl;return;}
// getline (std::cin,name);
ll MOD=1e9+7;
ll ceil1(ll n,ll x){return (n-1)/x+(n>0);}

ll gcd(ll a,ll b){return __gcd(a,b);}
ll lcm(ll a,ll b){return (max(a,b)/gcd(a,b))*min(a,b);}

ll pow1(ll n,ll m ,ll mod=MOD );
ll pow2(ll n,ll k);

ll modinv(ll n,ll mod=MOD){  return pow1(n,mod-2,mod);}

bool func(pair<ll,ll> &a,pair<ll,ll> &b ){
        if(a.ff != b.ff)return a.ff < b.ff;
        return a.ss > b.ss;
}
ll const N=(ll)1e5+11;
ll const LG=(ll)log2(N)+1;


void solve(){
        ll i,j,k,l,n,m,x,y,z,r;
        
        cin>>n;
        vll a(n);
        for(i=0;i<n;i++){
                cin>>a[i];
        }
        for(i=0;i<n;i++){
                cin>>x;
                a[i]=a[i]-x;
        }
        sort(allr(a));
        ll ans=0;
        ll sum=0;
        for(i=0;i<n;i++){
                sum+=a[i];
                ans=max(ans,sum);
        }
        cout<<ans<<endl;
        
        
        
        
        
}       
int main(){
        FS;
        
        ll i,j,k,n,m,x,y,z,q;
        q=1;
        // cin>>q;
        while(q--){
                solve();
        }
        return 0;
}


ll pow1(ll n,ll m,ll mod){
        if(m==0)return 1;
        
        if(m%2==0)return pow1((n*n)%mod,m/2,mod);
    	
    	return (pow1((n*n)%mod,m/2,mod)*n)%mod;
}

ll pow2(ll n,ll k){
        ll ans=1;
            while(k>0){
                if(k%2==1)ans=ans*n;
                n=n*n;
                k/=2;
            }
            return ans;
}

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

typedef long long ll;
using namespace std;

int main()
{
    int n, m, cnt = 0, tmp;
    ll ans = 0;
    pair <ll, ll> a[200000];

    cin >> n >> m;
    for (int i = 0; i < n; i++) {
        cin >> a[i].first;
        a[i].second = 1;
    }
    for (int i = 0; i < m; i++) {
        cin >> a[i+n].second >> a[i+n].first;
    }
    sort(a, a+n+m);

    ll num = n;
    for (int i = n+m-1; i >= 0; i--) {
        if (num > a[i].second) {
            ans += a[i].first * a[i].second;
			num -= a[i].second;
        }
        else {
            ans += a[i].first * num;
            break;
        }
    }
    cout << ans << endl;
    return 0;
}


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

int main(){
    int a[5];
    for(int i = 0; i < 3; i++){
        cin >> a[i];
    }
    sort(a, a+3);
    cout << a[0] << " " << a[1] << " " << a[2];
    cout << endl;
}



Measured memory_bytes: 3160
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MM = 1000000000;
const int MOD = MM + 7;
const int MAX = 510000;
#define rep(i, n) for(ll i=0; i<n; i++)
#define Rep(i, j, n) for(ll i=j; i<n; i++)
#define all(vec) vec.begin(), vec.end()
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 ll INF = 1LL << 60;

int main() {
  int a, b; cin >> a >> b;
  cout << a * b << endl;
}


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

#define repi(i,a,b) for(int i=(a);i<(b);i++)
#define rep(i,n) for(int i=0;i<(n);i++)

int main() {
	ios::sync_with_stdio(false);
	
	char c[1001];
	cin >> c;
	int l = strlen(c);
	rep(i, l) {
		c[i] = (c[i]-'A'+23)%26+'A';
	}
	cout << c << endl;
	return 0;
}

Measured memory_bytes: 1168
#include<bits/stdc++.h>
using namespace std; 
typedef long long ll;
const int N=3 +5;
#define FOR(i,a) for(int i=0;i<(a);i++)
int main(){
	ios_base::sync_with_stdio(0); cin.tie(0);
	bool aux;
	int  n;
	cin>>n;
	while(n--){
		int x; 
		cin>>x;
		if(x%2==0){
			if(x%3==0||x%5==0 ){
				aux=false;
			}
			else {
				aux=true;
				break;
			}
		}	
		
	}
	if(aux)cout<<"DENIED"<<endl;
	else cout<<"APPROVED"<<endl;
	return 0;
}

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

class Program
{
    static void Main()
    {
        var rDx = ReadLine().Split().Select(int.Parse).ToArray();
        var r = rDx[0];
        var D = rDx[1];
        var x = rDx[2];
        for (int i = 0; i < 10; i++)
        {
            x = r * x - D;
            WriteLine(x);
        }
    }
}


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

int main() {
  int n;
  cin >> n;
  vector<int> a(n+1);
  rep(i, n) {
    cin >> a[i+1];
//    cout << a[i+1] << endl;
  }
  vector<bool> memo(n+1);
  
  memo[1]=true;
  int now = 1;
  int ans = 0;
  do {
    int next = a[now];
//    cout << next << " " << memo[next] << endl;
    if(memo[next]) {
      cout << -1 << endl;
      return 0;
    }
    memo[next] = true;
    now = next;
    ++ans;
  } while(now != 2);
  
  cout << ans << endl;
  
  return 0;
}


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

using namespace std;

#define DEBUG(x) cerr<<#x<<": "<<x<<endl;
#define DEBUG_VEC(v) cerr<<#v<<":";for(int i=0;i<v.size();i++) cerr<<" "<<v[i]; cerr<<endl
#define DEBUG_MAT(v) cerr<<#v<<endl;for(int i=0;i<v.size();i++){for(int j=0;j<v[i].size();j++) {cerr<<v[i][j]<<" ";}cerr<<endl;}


typedef long long ll;
#define vi vector<int>
#define vl vector<ll>
#define vii vector< vector<int> >
#define vll vector< vector<ll> >
#define vs vector<string>
#define pii pair<int,int>
#define pis pair<int,string>
#define psi pair<string,int>
#define pll pair<ll,ll>
template<class S, class T> pair<S, T> operator+(const pair<S, T> &s, const pair<S, T> &t) { return pair<S, T>(s.first + t.first, s.second + t.second); }
template<class S, class T> pair<S, T> operator-(const pair<S, T> &s, const pair<S, T> &t) { return pair<S, T>(s.first - t.first, s.second - t.second); }
template<class S, class T> ostream& operator<<(ostream& os, pair<S, T> p) { os << "(" << p.first << ", " << p.second << ")"; return os; }
#define X first
#define Y second
#define rep(i,n) for(int i=0;i<(n);i++)
#define rep1(i,n) for(int i=1;i<=(n);i++)
#define rrep(i,n) for(int i=(n)-1;i>=0;i--)
#define rrep1(i,n) for(int i=(n);i>0;i--)
#define REP(i,a,b) for(int i=a;i<b;i++)
#define in(x, a, b) (a <= x && x < b)
#define all(c) c.begin(),c.end()
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 (a>b) { a = b; return 1; } return 0; }
#define UNIQUE(v) v.erase(std::unique(v.begin(), v.end()), v.end());
const ll inf = 1000000001;
const ll INF = (ll)1e18 + 1;
const ll MOD = 1000000007;
//const ll MOD = 998244353;
const double pi = 3.14159265358979323846;
#define Sp(p) cout<<setprecision(15)<< fixed<<p<<endl;
int dx[4] = { -1,0, 1,0 }, dy[4] = { 0,1,0,-1 };
int dx2[8] = { 1,1,0,-1,-1,-1,0,1 }, dy2[8] = { 0,1,1,1,0,-1,-1,-1 };
#define fio() cin.tie(0); ios::sync_with_stdio(false);
// #define mp make_pair
//#define endl '\n'


int main() {
  string s;
  cin >> s;
  sort(all(s));
  if (s[0] == s[1] && s[2] == s[3] && s[1] != s[2]) {
    cout << "Yes" << endl;
  }
  else {
    cout << "No" << endl;
  }
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(){
  int N, K, Q;
  cin >> N >> K >> Q;
  vector<int> S(N, K - Q);
  for (int i = 0; i < Q; i++){
    int A;
    cin >> A;
    A--;
    S[A]++;
  }
  for (int i = 0; i < N; i++){
    if (S[i] > 0){
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  }
}

Measured memory_bytes: 1024
#include <iostream>
using namespace std;
int main()
{
  int A, B;
  cin >> A >> B;
  if (A == 1)
    A = 14;
  if (B == 1)
    B = 14;
  string ans = "Alice";
  if (A < B)
    ans = "Bob";
  else if (A == B)
    ans = "Draw";
  cout << ans << endl;
  return 0;
}

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


int main(){
    int a,b;
    cin>>a>>b;
    if(b%a==0)cout<<a+b<<endl;
    else cout<<b-a<<endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <limits>
#include <vector>
#include <map>
#include <cmath>
#include <limits>
#include <iomanip>
#define ll long long int
#define rep(i,n) for(int i = 0;i < n;i++)
#define all(x) x.begin(),x.end()
#define pb push_back
#define mp make_pair

using namespace std;

int main(){

    ll n,k;
    cin >> n >> k;

    vector<ll> a(n);
    rep(i,n) cin >> a[i];

    vector<int> b(41,0);
    rep(i,41){
        rep(j,n){
            b[i] += a[j] >> i & 1ll;
        }
    }

    int k2[41];
    rep(i,40){
        k2[i] = k >> i & 1ll;
    }

    vector<vector<ll> > dp(41,vector<ll>(2,0));
    rep(i,41) dp[i][1] = -1;

    for(int i = 39;i >= 0;i--){
        int sa = n - b[i];
        ll k3 = (1ll << i);
        if(dp[i + 1][1] != -1) dp[i][1] = max(dp[i][1],dp[i+1][1] + k3 * max(b[i],sa));

        if(k2[i]){//k2[i] == 1なら0,1どっちでもok
            dp[i][1] = max(dp[i][1],dp[i+1][0] + k3 * b[i]);
            dp[i][0] = max(dp[i][0], dp[i+1][0] + k3 * sa);
        }
        else{
            dp[i][0] = max(dp[i][0], dp[i+1][0] + k3 * b[i]);
        }
    }

    /*rep(i,41){
        cout << b[i] << " ";
    }
    cout << endl;

    rep(i,41){
        cout << k2[i] << " ";
    }
    cout << endl;

    rep(i,2){
        rep(j,20){
            cout << dp[j][i] << " ";
        }
        cout << endl;
    }*/

    cout << max(dp[0][0],dp[0][1]) << endl;

    return 0;
}

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

using namespace std;

using ll = long long;
using P = pair<ll, ll>;
using Graph = vector<vector<ll>>;
#define rep(i, n) for(ll i=0;i<(ll)(n);i++)
#define rep2(i, m, n) for(ll i=m;i<(ll)(n);i++)
#define rrep(i, n, m) for(ll i=n;i>=(ll)(m);i--)
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
const int ddx[8] = {0, 1, 1, 1, 0, -1, -1, -1};
const int ddy[8] = {1, 1, 0, -1, -1, -1, 0, 1};
const ll MOD = 1000000007;
const ll INF = 1000000000000000000L;
#ifdef __DEBUG

/**
 * For DEBUG
 * https://github.com/ta7uw/cpp-pyprint
 */
#include "cpp-pyprint/pyprint.h"

#endif

void Main() {
    int N;
    cin >> N;
    map<int, vector<P>> info;
    rep(i, N) {
        int a;
        cin >> a;
        rep(j, a) {
            int x, y;
            cin >> x >> y;
            x--;
            info[i].push_back({x, y});
        }
    }
    int ans = 0;
    rep(i, 1 << N) {
        int cnt = 0;
        vector<bool> tmp(N, false);
        rep(j, N) {
            if (i & (1 << j)) {
                cnt++;
                tmp[j] = true;
            }
        }
        bool check = true;
        rep(j, N) {
            if (tmp[j]) {
                vector<P> items = info[j];
                for(P p : items) {
                    if (p.second == 1) {
                        if (tmp[p.first]) {
                            continue;
                        }else{
                            check = false;
                        }
                    }else{
                        if (tmp[p.first]) {
                            check = false;
                        }else{
                            continue;
                        }
                    }
                }
            }
        }
        if (check) {
            ans = max(ans, cnt);
        }
    }
    cout << ans << '\n';
}

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(15);
    Main();
    return 0;
}


Measured memory_bytes: 256
#include <iostream>      // cout, endl, cin

using namespace std;

int main() {
    int n, m, mem, A[100][100], B[100], ans;
    for (auto i=0; i<100; i++) for (auto j=0; j<100; j++) A[i][j] = 0;
    for (auto k=0; k<100; k++) B[k] = 0;
    
    cin >> n >> m;
    for (auto i=0; i<n; i++) {
        for (auto j=0; j<m; j++) {
            cin >> mem;
            A[i][j] = mem;
        }
    }
    for (auto k=0; k<m; k++) {
        cin >> mem;
        B[k] = mem;
    }
    
    for (auto i=0; i<n; i++) {
        ans = 0;
        for (auto j=0; j<m; j++) {
            ans += A[i][j] * B[j];
        }
        cout << ans << endl;
    }
    return 0;
}


Measured memory_bytes: 3136
#include <cstdio>
#include <algorithm>
#include <cctype>
#include <cmath>
using namespace std;
inline int read(int f = 1, int x = 0, char ch = ' ')
{
    while(!isdigit(ch = getchar())) if(ch == '-') f = -1;
    while(isdigit(ch)) x = x*10+ch-'0', ch = getchar();
    return f*x;
}
const int INF = 0x7fffffff;
int a, b, ans = INF;
int main()
{
    a = read(), b = read();
    if(a <= b) ans = min(ans, b-a);
    if(a > b) ans = min(ans, a-b+2);
    if(-a <= b) ans = min(ans, a+b+1);
    if(-a > b) ans = min(ans, -a-b+1);
    printf("%d\n", ans);
    return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std::literals::string_literals;
using i64 = long long;
using std::cout;
using std::endl;
using std::cin;

template<typename T>
std::vector<T> make_v(size_t a){return std::vector<T>(a);}

template<typename T,typename... Ts>
auto make_v(size_t a,Ts... ts){
  return std::vector<decltype(make_v<T>(ts...))>(a,make_v<T>(ts...));
}

int main() {
	i64 n, s; scanf("%lld%lld", &n, &s);

	if(s == n) {
		printf("%lld\n", n + 1);
		return 0;
	}
	
	const i64 sqrtN = [n] {
		i64 ok = 1, ng = 1e6;
		while(ng - ok > 1) {
			i64 mid = (ok + ng) >> 1;

			if(mid * mid <= n) ok = mid;
			else ng = mid;
		}
		return ok;
	}();

	auto f = [](auto&& f, i64 b, i64 n) {
		if(n < b) return n;
		return f(f, b, n / b) + n % b;
	};

	i64 ans = 1LL << 60;
	for(i64 b = 2; b < sqrtN + 10; b++) {
		if(f(f, b, n) != s) continue;
		ans = std::min(ans, b);
	}

	for(i64 b = 2; b <= sqrtN; b++) {
		i64 tmp = b;
		while(tmp <= n) tmp *= b;
		if(tmp != n) continue;
		ans = std::min(ans, b);
	}
	
	for(i64 A = sqrtN; A > 0; A--) {
		const i64 b = [A, n] {
				i64 ok = n, ng = 1;
				while(std::abs(ok - ng) > 1) {
					i64 mid = (ok + ng) >> 1;

					if(n / mid <= A) ok = mid;
					else ng = mid;
				}
				return ok;
			}();
		const i64 B = (n - A * b);
		if(b <= A) continue;
		if(b == 1) continue;
		
		assert(0 <= B and B < b);
		assert(A * b + B == n);
		assert(f(f, b, n) == A + B);
		if((A + B - s) % A or A + B - s < 0) continue;
		i64 k = (A + B - s) / A;

		if(B - k * A < 0) continue;
		ans = std::min(ans, b + k);
	}

	if(ans != 1LL << 60) printf("%lld\n", ans);
	else printf("-1\n");
	return 0;
}


Measured memory_bytes: 256
#include <algorithm>
#include<iostream>
using namespace std;
int main(){
  
 	long long n;
  	long long a[5];
  	long long m = 9223372036854775807;
  	cin >> n;
  	long long sum = 0;
  	long long tmp = 0;
  	for(int i=0; i<5; ++i){
     	cin >> a[i]; 
    }
    for(int i=0; i<5; ++i){
      if(a[i] < m){	
      	m = a[i];
        tmp =  i;
      }
    }
  	
  	sum += (n + (m-1)) / m;
    sum += 4;
  
  	cout << sum << endl;
}

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

int main(){
    int AC,WA,TLE,RE,n;
    string in;
    AC = 0;
    WA = 0;
    TLE = 0;
    RE = 0;
    cin >> n;
    for(int i = 0; i < n; i++){
        cin >> in;
        if(in == "AC"){
            AC++;
        }else if(in == "WA"){
            WA++;
        }else if(in == "TLE"){
            TLE++;
        }else if(in == "RE"){
            RE++;
        }
    }
    cout << "AC" << " x " << AC << endl;
    
    cout << "WA" << " x " << WA << endl;
    
    cout << "TLE" << " x " << TLE << endl;
    
    cout << "RE" << " x " << RE << endl; 
}

Measured memory_bytes: 3628
/*input
3200
pink
*/

#include<bits/stdc++.h>
#define ll long long int
#define nl cout<<"\n"
using namespace std;


int main()
{
  int a;
  cin>>a;
  string s;
  cin>>s;
  if(a<3200)
    cout<<"red"<<endl;
  else
    cout<<s<<endl;

return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define prArr(Arr,n) for(int _=0;_<n;_++)   cout<<(Arr)[_]<<" ";
using namespace std;
const long long INF=(long long)0x3f3f3f3f3f3f3f3f;
const int MOD=(int)1e9+7;

int main()
{
    /*ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);*/
    //freopen("output.txt","w+",stdout);
    //freopen("input.txt","r+",stdin);
    int n,s,tmp;
    cin>>n;
    tmp=n;
    while(tmp)
        s+=tmp%10,tmp/=10;
    cout<<(n%s?"No":"Yes");
    return 0;
}


Measured memory_bytes: 3588
#include <iostream>
#include <algorithm>
#include <vector>
#include <cmath>
#include <map>
using namespace std;

struct Point {
  int x, y;
  Point() {}
  Point(int x, int y) : x(x), y(y) {}
  
  Point operator + (const Point &a) {
	return Point(x - a.x, y - a.y);
  }
  Point operator - (const Point &a) {
	return Point(x - a.x, y - a.y);
  }
  
  bool operator < (const Point &a) const {
	return x == a.x ? y < a.y : x < a.x;
  }
  
  bool operator == (const Point &a) const {
	return x==a.x && y==a.y;
  }
  
  double norm() {
	return x*x+y*y;
  }
};

typedef Point Vector;

Vector rotate90R(Vector V) {
  return Vector(V.y, -V.x);
}

bool in(Point p) {
  return 0<=p.x && p.x<=5000 && 0<=p.y && p.y<=5000;
}

int main() {
  int n;
  int x, y;
  while(cin >> n && n) {

  	vector<Point> vec;
	map<Point, int> exist;

	for(int i=0; i<n; i++) {
	  cin >> x >> y;
	  Point p(x, y);
	  vec.push_back(p);
	  exist[p] ++;
 	}
	
	int ans = 0;
	
	for(int i=0; i<n-1; i++) {
	  for(int j=i+1; j<n; j++) {
		Vector V1 = vec[i] - vec[j];
		Vector V2 = rotate90R(V1);
		int area = V1.norm();
		
		Vector VV1 = vec[j]+V2;
		Vector VV2 = vec[i]+V2;
		if(in(VV1) && in(VV2))
		  if(exist.count(VV1) && exist.count(VV2))
			ans = max(ans, area);
		
		VV1 = vec[j]-V2;
		VV2 = vec[i]-V2;
		if(in(VV1) && in(VV2))
		  if(exist.count(VV1) && exist.count(VV2))
			ans = max(ans, area);
	  }
	}
	cout << ans << endl;
  }
  
  return 0;
}

Measured memory_bytes: 1436
#include <iostream>
#include <string>
#include<iomanip>
using namespace std;
/*struct*/
struct aaa {
	aaa() {
		cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(20);
	};
}aaaaaaa;
constexpr int32_t MOD = 1e9 + 7; //10^9
/*global*/

string S;

//#define int int64_t
signed main()
{
	unsigned long long dp[13] = { 0 }, dp_next[13];
 
	dp[0] = 1;
	cin >> S;
 
	for (const char& s : S) {
		for (int i = 0; i < 13; i++) dp_next[i] = 0;
 
		if (s == '?') {
			for (int i = 0; i < 10; i++) {
				for (int j = 0; j < 13; j++) {
					dp_next[((j * 10 + i) % 13)] += dp[j];
				}
			}
		}
		else {
			for (int i = 0; i < 13; i++) {
				dp_next[(i * 10 + s-'0') % 13] += dp[i];
			}
		}
 
		for (int i = 0; i < 13; i++) {
			dp[i] = dp_next[i] % MOD;
		}
	}
 
	cout << dp[5];	
}


Measured memory_bytes: 512
#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<unordered_set>
#include<unordered_map>
using namespace std;
typedef long long ll;
#define mod 1000000007
#define mad(a,b) a=(a+b)%mod;

int main(){
  ll a,b;cin>>a>>b;
  cout<<abs(a-b)<<endl;
  return 0;
}



Measured memory_bytes: 3120
#include <bits/stdc++.h>
using namespace std;
 
#define ll long long
#define ull unsigned long long
#define db long double
#define pb push_back
#define ppb pop_back
#define F first
#define S second
#define mp make_pair
#define all(x) (x).begin(), (x).end()
 
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;
typedef vector <int> vi;
typedef vector <ll> vl;

const int N = 1e5 + 123;
int n, a[N], even, odd;

int main() {
	ios_base::sync_with_stdio(false), cin.tie(NULL);
	#ifdef LOCAL
		freopen("input.txt", "r", stdin);
	#endif
	
	cin >> n;
	for (int i = 1; i <= n; i++) {
		cin >> a[i];
		if (a[i] & 1) {
			odd++;
		}	else {
			even++;
		}
	}
	if (odd % 2 == 0) {
		even += odd / 2;
		if (even >= 1) {
			cout << "YES";
		}	else {
			cout << "NO";
		}
		return 0;
	}
	even += odd / 2;
	odd = 1;
	if (even > 0) {
		cout << "NO";
	}	else {
		cout << "YES";
	}
}


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


#define ll long long 
// vector<ll>odd;
// vector<ll>even;

vector<ll> count_odd(int(pow(10,6)));
vector<ll> count_even(int(pow(10,6)));

int main(void){
    for(int i=0;i<count_odd.size();i++){
        count_odd[i]=0;
        count_even[i]=0;
    }

    ll n;
    cin >> n;
    for(int i=0;i<n;i++){
        ll tmp;
        cin >> tmp;
        if(i%2==0){
            // even.push_back(tmp);
            count_even[tmp]++;
            
        }else{
            // odd.push_back(tmp);
            count_odd[tmp]++;
        }
    }

    ll odd_one=0,odd_two=0,odd_num1;
    for(int i=0;i<count_odd.size();i++){
        if(odd_two < count_odd[i]){
            if(odd_one < count_odd[i]){
                odd_num1 = i;
                odd_two = odd_one;
                odd_one = count_odd[i];
            }else{
                odd_two = count_odd[i];
            }
        }
    }
    ll even_one=0,even_two=0,even_num1;
    for(int i=0;i<count_even.size();i++){
        if(even_two < count_even[i]){
            if(even_one < count_even[i]){
                even_num1 = i;
                even_two = even_one;
                even_one = count_even[i];
            }else{
                even_two = count_even[i];
            }
        }
    }
    ll ans = 0;
    if(odd_num1 == even_num1){
        ll a=odd_one+even_two,b=odd_two+even_one;
        (a<b) ?ans = b :ans = a;
    }else{
        ans = odd_one + even_one;
    }
    // cout << odd_num1<<' ' << even_num1<<' '<<ans  <<  endl;
    // cout << odd_one << ' '<< odd_two << ' '<< even_one << ' ' <<even_two << endl;
    cout << n-ans<<endl;





}

Measured memory_bytes: 15872
using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using System.Linq;
using static MyIO;


public class A
{
    public static void Main()
    {
        var a = GetInt();
        var op = GetString()[0];
        var b = GetInt();
        
        switch (op)
        {
            case '+':
                Console.WriteLine(a+b);
                break;
            case '-':
                Console.WriteLine(a-b);
                break;
            default:
                break;
        }
    }
}

public static class MyIO
{
    private static string[] args = null;
    private static int num = -1;
    private static int used = -1;

    private static string getArg()
    {
        if (used == num)
        {
            args = Console.ReadLine().Split(' ');
            num = args.Length;
            used = 0;
        }
        return args[used++];
    }

    public static int GetInt() { return int.Parse(getArg()); }
    public static long GetLong() { return long.Parse(getArg()); }
    public static double GetDouble() { return double.Parse(getArg()); }
    public static string GetString() { return getArg(); }
}

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

int main() {
  long long int N;
  cin >> N;
  vector<long long int> A(N), S(N + 1);
  S.at(0) = 0;
  for (long long int i = 0; i < N; i++) {
    cin >> A.at(i);
    S.at(i + 1) = S.at(i) + A.at(i);
  }
  sort(S.begin(), S.end());
  long long int K = 1;
  long long int ans = 0;
  for (long long int i = 1; i <= N; i++) {
    if (S.at(i) == S.at(i - 1)) {
      ans += K;
      K++;
    }
    else K = 1;
  }
  cout << ans << endl;
}

Measured memory_bytes: 6412
/************************************************
   Start coding only after you have clear idea. 
*************************************************/

#include <bits/stdc++.h>

#define x first
#define y second
#define pii pair<int,int>
#define sz(x) (int)(x).size()
#define all(x) (x).begin(),(x).end()
using namespace std;
typedef long long LL;
const int maxm = 2e3+23;
const int maxn = 2e5+35;
int main(){
    int a,b; cin >> a >> b;
    cout << a * b << endl;
    return 0;
}

Measured memory_bytes: 3636
#pragma GCC optimize("O3")
#include <bits/stdc++.h>
#define ll long long
#define rep(i,n) for(ll i=0;i<(n);i++)
#define pll pair<ll,ll>
#define pii pair<int,int>
#define pq priority_queue
#define pb push_back
#define eb emplace_back
#define fi first
#define se second
#define endl '\n'
#define ios ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
#define lb(c,x) distance(c.begin(),lower_bound(all(c),x))
#define ub(c,x) distance(c.begin(),upper_bound(all(c),x))

using namespace std;


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

const ll INF=1e9+7;

int main(){
    ll n,c,k;
    cin >> n >> c >> k;
    vector<ll> t(n);
    rep(i,n){
        cin >> t[i];
    }
    sort(t.begin(),t.end());
    ll st=t[0];
    ll pos=0;
    ll ans=0;
    while(true){
        if(pos+c-1<=n-1 && t[pos+c-1]<=st+k){
            pos=pos+c;
            ans++;
            if(pos==n) break;
            st=t[pos];
        }
        else{
            auto it=upper_bound(t.begin(),t.end(),st+k)-t.begin();
            ans++;
            if(it==n) break;
            pos=it;
            st=t[pos];
            
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 4052
//Ruthless Coding 
#include <bits/stdc++.h>

#define uni(x)      (x).resize(unique(all(x)) - (x).begin())
#define fprint(v)   for(auto x : v) cout << x << ' '
#define ALL(x)      (x).begin(), (x).end()
#define MP(x, y)    make_pair(x, y)
#define PII         pair<int, int>
#define SZ(x)       int((x).size())
#define PB(x)       push_back(x)
#define ll          long long
#define S           second 
#define F           first
#define nl          '\n'

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

template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif
mt19937_64 rnd;

const int N = 2e5 + 5;

int main() {
    ios_base::sync_with_stdio(0);cin.tie(0);
    int n;
    cin >> n;
    vector<int> a(n);
    for(auto &x : a){
        cin >> x;
    }
    sort(ALL(a));
    int pos = n / 2 - 1;
    int delta = a[pos + 1] - (a[pos] + 1) + 1;
    cout << delta;
    return 0;
}


Measured memory_bytes: 640