akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
#include<cstdlib>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cmath>
#include <vector>
#include<queue>
using namespace std;

struct node
{
    long long  x,y;
};
node p[100005];
bool cmp(node a,node b)
{
    return a.x<b.x;
}
int main()
{
    long long  n,k;
    while (cin>>n>>k)
    {
        memset(p,0,sizeof(p));
        for (long long  i=0;i<n;i++)
        {
            cin>>p[i].x>>p[i].y;
        }
        sort(p,p+n,cmp);
        long long  sum=0;
        for (long long  i=0;i<n;i++)
        {
            sum+=p[i].y;
            if (sum>=k)
            {
                cout<<p[i].x<<endl;
                break;
            }
        }
    }
}


Measured memory_bytes: 1920
#include<cstdio>
#include<cstring>
#include<cmath>
#include<bitset>
#include<iostream>
#include<algorithm>
#include<string>
#include<utility>
#include<tuple>
#include<vector>
#include<list>
#include<map>
#include<set>
#include<queue>
#include<stack>
#include<numeric>
#include<functional>
#include<iomanip>
#include<random>

#define IOS ios::sync_with_stdio(false),cin.tie(0)
#define REP(i,n) for(int i = 0;i < n;i++)
#define FOR(i,a,b) for(int i = a;i < b;i++)
#define MEM(a,b) memset(a,b,sizeof(a))
#define LMAX 9223372036854775807
#define LMIN -9223372036854775808

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;
typedef pair<ull, ull> UP;
typedef tuple<int, int, int> T;

int gcd(int a, int b) {
	if (a < b)swap(a, b);
	int k = a % b;
	if (k == 1)return 1;
	if (k == 0)return b;
	int ans = gcd(b, k);
	return ans;
}
int digisum(ll a) {
	int sum = 0;
	while (a) {
		sum += a % 10;
		a /= 10;
	}
	return sum;
}


int main() {
	int n;
	cin >> n;
	set<int> s;
	int x;
	REP(i, n) {
		cin >> x;
		s.insert(x);
	}
	cout << s.size() << endl;
}



Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <algorithm>
#include <climits>
#include <cmath>
#include <string>
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep01(i, n) for(int i = 0; i < (n) + 1; i++)
#define rep10(i, n) for(int i = 1; i < (n); i++)
#define rep11(i, n) for(int i = 1; i < (n) + 1; i++)
#define all(a) (a).begin(), (a).end()
typedef long long int ll;
typedef struct { int x; int y; } Pos;
using namespace std;

int N, M;
vector<pair<int, int>> a;
vector<int> b;
int main() {
    cin >> N >> M;
    a = vector<pair<int, int>> (M);
    rep(i, M) cin >> a[i].first >> a[i].second;
    // 終点で小さい順ソート
    sort(all(a), [](auto x, auto y) -> bool { return x.second < y.second; });
    //まず一番小さい終点の橋を壊す
    b.push_back(a[0].second-1);
    rep10(i, M) {
        bool ok = false;
        //i番目の要望が達成できているかチェック
        rep(j, b.size()) {
            if (b[j] >= a[i].first && b[j] < a[i].second) ok = true;
        }
        //達成できていない場合、終点の橋を壊す
        if (!ok) b.push_back(a[i].second-1);
    }
    cout << b.size() << endl;
    return 0;
}

Measured memory_bytes: 3996
from heapq import heappush,heappop,heapify
from collections import deque,defaultdict,Counter
import itertools
from itertools import permutations,combinations
import sys
import bisect
import string
import math
import time
#import random
def I():
    return int(input())
def MI():
    return map(int,input().split())
def LI():
    return [int(i) for i in input().split()]
def LI_():
    return [int(i)-1 for i in input().split()]
def StoI():
    return [ord(i)-97 for i in input()]
def ItoS(nn):
    return chr(nn+97)
def show(*inp,end='\n'):
    if show_flg:
        print(*inp,end=end)
YN=['Yes','No']
mo=10**9+7
inf=float('inf')
l_alp=string.ascii_lowercase
u_alp=string.ascii_uppercase
ts=time.time()
#sys.setrecursionlimit(10**6)
input=lambda: sys.stdin.readline().rstrip()

show_flg=False
#show_flg=True

w=['SUN','MON','TUE','WED','THU','FRI','SAT']

s=input()

for i in w:
    d=w.index(i)
    show(i,7-d)

d=w.index(s)
show(7-d)
print(7-d)


Measured memory_bytes: 38512
#include <bits/stdc++.h>
using namespace std;
int main()
{
    ios_base::sync_with_stdio(0) , cin.tie(NULL) , cout.tie(NULL);
    long long n , k , a[200005] , s = 0;
    cin >> n >> k;
    for(int i = 0 ; i < n ; i++)
        cin >> a[i];
    sort(a , a+n , greater<long long>());
    while(k < n)
        s += a[k++];
    cout << s << "\n";
    return 0;
}

Measured memory_bytes: 1792
#include<algorithm>
#include<iostream>
#include<cstring>
#include<cstdlib>
#include<string>
#include<cstdio>
#include<vector>
#include<queue>
#include<cmath>
#include<set>
#include<map>
using namespace std;
typedef long long LL;
const int N = 3e5+10;
inline int read()
{
	register int x = 0 , f = 0; register char c = getchar();
	while(c < '0' || c > '9') f |= c == '-' , c = getchar();
	while(c >= '0' && c <= '9') x = (x << 3) + (x << 1) + c - '0' , c = getchar();
	return f ? -x : x;
}
int n;
int s[N];
struct BIT
{
	int n;
	int p[N] , tr[N];
	inline void Add(int pos , int val) { while(pos <= ::n) tr[pos] += val , pos += (pos & (-pos)); }
	inline int Ask(int pos) { int ans = 0; while(pos) ans += tr[pos] , pos -= (pos & (-pos)); return ans; }
	LL calc()
	{
		LL ans = 0;
		for(int i = 1 ; i <= n ; ++i)
			ans += Ask(::n) - Ask(p[i]) , Add(p[i] , 1);
		for(int i = 1 ; i <= n ; ++i) Add(p[i] , -1);
		return ans;
	}
}R;
int main()
{
	n = read();
	for(int i = 1 ; i <= n ; ++i) s[i] = read();
	R.n = n;
	for(int i = 1 ; i <= n ; ++i) R.p[i] = s[i];
	LL res = R.calc();
	if(res % 3) { puts("No"); return 0; }
	for(int i = 1 ; i <= n ; ++i) if((s[i] & 1) != (i & 1)) { puts("No"); return 0; }
	R.n = 0;
	for(int i = 1 ; i <= n ; ++i) if(i & 1) R.p[++R.n] = s[i];
	LL tmp = R.calc(); // cout << tmp << '\n';
	R.n = 0;
	for(int i = 1 ; i <= n ; ++i) if(!(i & 1)) R.p[++R.n] = s[i];
	tmp += R.calc(); // cout << tmp << '\n';
	if(tmp * 3 != res) { puts("No"); return 0; }
	puts("Yes");
	return 0;
}
/*
5
5 2 1 4 3
2
*/

Measured memory_bytes: 3712
#include <bits/stdc++.h>
using namespace std;
using ll = long long;

#define print2(a, b) cerr << "(" << a << "," << b << ")" << endl
#define print3(a, b, c) cerr << "(" << a << "," << b << "," << c << ")" << endl


void solve(long long r){
    cout << 3 * r * r << endl;
}

int main(){
    long long r;
    scanf("%lld",&r);
    solve(r);
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define fi first
#define se second
#define pb push_back
#define SZ(x) ((int)x.size())
#define L(i,u) for (register int i=head[u]; i; i=nxt[i])
#define rep(i,a,b) for (register int i=(a); i<=(b); i++)
#define per(i,a,b) for (register int i=(a); i>=(b); i--)
using namespace std;
typedef long long ll;
typedef unsigned int ui;
typedef pair<int,int> Pii;
typedef vector<int> Vi;
template<class T> inline void read(T &x){
	x=0; char c=getchar(); int f=1;
	while (!isdigit(c)) {if (c=='-') f=-1; c=getchar();}
	while (isdigit(c)) {x=x*10+c-'0'; c=getchar();} x*=f;
}
template<class T> inline void umin(T &x, T y){x=x<y?x:y;}
template<class T> inline void umax(T &x, T y){x=x>y?x:y;}
inline ui R() {
	static ui seed=416;
	return seed^=seed>>5,seed^=seed<<17,seed^=seed>>13;
}
const int N = 105,mo=1e9+7;
inline void add(int &x, int y){x=x+y<mo?x+y:x+y-mo;}
int n,k,f[N][N*N],mx;
int main() {
	read(n);read(k);f[n+1][0]=1;
	per(i,n,1)mx+=1+mx/i;mx+=10;
	per(i,n,1)rep(j,0,mx)if(f[i+1][j]){
		if(i<=k)f[i][j]=(f[i][j]+1LL*f[i+1][j]*(k-i))%mo;
		rep(x,0,min(i,k))add(f[i][j+(x+j)/i],f[i+1][j]);
	}
	int res=1LL*k*(k+1)/2*n%mo;rep(i,1,n-1)res=1LL*res*(k+1)%mo;
	rep(j,0,mx)res=(res-1LL*f[1][j]*j)%mo;
//	rep(j,0,mx)if(f[1][j])printf("%d:%d\n",j,f[1][j]);
	res=(res%mo+mo)%mo;cout<<res;
	return 0;
}


Measured memory_bytes: 2560
/*
  ∧,,∧
( 'ω' )つ ＜WA,またお前か！！　
（m9 ＼ 　　
　 ＼　 ＼
　 　 ) ) ＼
　 ／／ ＼ ＼
　 (＿） 　 (＿)
*/

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

#define all(x) (x).begin(),(x).end()

typedef long long LL;
typedef long double LD;

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

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;
    }
}

ostringstream oss_global;
string s_global = oss_global.str();

int main()
{
    int N, M;
    cin >> N >> M;
    vector<int> P(M, 0), Y(M, 0);
    for (int j = 0; j < M; j++)
        cin >> P[j] >> Y[j];

    vector<vector<pair<int, int>>> years(N, {{0, 0}});
    for (int j = 0; j < M; j++)
        years[P[j]-1].push_back(make_pair(Y[j], j));

    vector<int> index(M, 0);
    for (int i = 0; i < N; i++) {
        sort(all(years[i]), compare_by_a);
        years[i].erase(years[i].begin());

        for (int j = 0; j < years[i].size(); j++)
            index[years[i][j].second] = j+1;
    }

    for (int j = 0; j < M; j++) {
        for (int m = 0; m < 5 - (int)log10(P[j]); m++)
            cout << 0;
        cout << P[j];
        for (int m = 0; m < 5 - (int)log10(index[j]); m++)
            cout << 0;
        cout << index[j] << endl;
    }

    return 0;
}


Measured memory_bytes: 9472
#include <iostream>
#include <vector>
using namespace std;
typedef long long ll;
#define ERROR 0
ll func(int n, ll x);
ll a[51], p[51];

int main() {
  int n;
  ll x, sum;
  cin >> n >> x;
  
  a[0] = 1, p[0] = 1;
  for (int i = 1; i <= n; i++) {
    a[i] = 2*a[i-1]+3;
    p[i] = 2*p[i-1]+1;
  }

  sum = func(n, x);
  cout << sum << endl;
  return 0;
}

ll func(int n, ll x) {
  if (n==0) return x>0;
  if(x == 1) return 0;
  else if(1 < x && x <= 1+a[n-1]) return func(n-1, x-1);
  else if(x == 2+a[n-1]) return p[n-1]+1;
  else if(2+a[n-1] < x && x <= 2+2*a[n-1]) return (p[n-1]+1)+func(n-1, x-a[n-1]-2);
  else if(x == a[n]) return p[n];
  else return ERROR;
}


Measured memory_bytes: 256
#include<iostream>

using namespace std;

int main() {
	int A, B;
	string op;

	//入力
	cin >> A >> op >> B;

	//出力
	if (op=="+") {
		cout << A + B << endl;
	}
	else if (op=="-") {
		cout << A - B << endl;
	}
}

Measured memory_bytes: 256
#include <cstdio>
#include <cstring>
#include <iostream>
using namespace std;
int main(){


        int a=0;
        int count=0;
        int ans=0;
        string str1;
        string str[102];

        cin >> str1;
        cin >> a;
        for(int i=0;i<a;i++){
                cin >> str[i];
        }

        for(int j=0;j<a;j++){
                if(-1 < (ans = (str[j]+str[j]).find(str1))){
                ans=0;
                count++;
                }
                ///else if()
        }
        cout << count << endl;
}

Measured memory_bytes: 1216
#include <stdio.h>
long long a [100010];
int main (){
  int n;
  scanf("%d",&n);
  for(int i=0;i<n;i++) scanf("%lld",&a[i]);
  
  int zero =0;
  
  for(int i=0;i<n;i++)if(a[i]==0) zero ++;
  
  if(zero >0){
// a[i] contains 0
    printf("0\n");
    return 0;
  }
  
  long long prod =1;
  
  for(int i=0;i<n;i++){
    if(a[i ] <=1000000000000000000/ prod ){
// This condition is equivalent to prod*a[i] <=10ˆ18
      prod *=a[i];
    }else{
      printf("-1\n");
      return 0;
    }
  }
  
  printf("%lld\n",prod );
}

Measured memory_bytes: 2512
from collections import defaultdict
N = int(input())
A = list(map(int, input().split()))

L = A[:]
L = list(set(L))

mod = 10 ** 9 + 7

d = defaultdict(int)
for i in range(N):
    d[A[i]] += 1

if N % 2 == 1:
    bfr = 0
    for i in L:
        if i - bfr != 2 and i != 0:
            print(0)
            exit()

        if i == 0:
            if d[i] != 1:
                print(0)
                exit()
            else:
                continue
        if d[i] != 2:
            print(0)
            exit()
        bfr = i

    print((2 ** (N // 2)) % mod)
else:
    bfr = 1
    for i in L:
        if i - bfr != 2 and i != 1:
            print(0)
            exit()

        if d[i] != 2:
            print(0)
            exit()
        bfr = i

    print((2 ** (N // 2)) % mod)


Measured memory_bytes: 20464
#include <stdio.h>
#include <stdlib.h>
int main(){
  unsigned short *A,*B;
  
  int n;
  int i,j;
  int C[10001];
  
  scanf("%d",&n);

  A = malloc(sizeof(short)*n+1);
  B = malloc(sizeof(short)*n+1);

  for(i=0;i<=10000;i++) C[i]=0;

  for(i=0;i<n;i++){
    scanf("%hu",&A[i+1]);
    C[A[i+1]]++;
  }

  for(i=1;i<=10000;i++) C[i]=C[i]+C[i-1];

  for(j=1;j<=n;j++){
    B[C[A[j]]]=A[j];
    C[A[j]]--;
  }

  for(i=1;i<=n;i++){
    if(i>1) printf(" ");
    printf("%d",B[i]);
  }

  printf("\n");

  return 0;
}

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

#define int long long
#define vvi vector<vector<int>>
#define vec vector
#define pq priority_queue
#define all(v) (v).begin(), (v).end()
#define uniqueV(x) sort(x.begin(), x.end()); x.erase(unique(x.begin(), x.end()), x.end());
#define rep(i, n) for (int (i) = (0); (i) < (n); ++(i))
#define repp(i, m, n) for (int (i) = (m); (i) < (n); ++(i))
#define dbg(x) cerr << #x << ": " << x << endl;
#define dbg2(x, y) cerr<<"("<<#x<<", "<<#y<<") = "<<"("<<x<<", "<<y<<")"<<endl;
#define dbg3(x, y, z) cerr<<"("<<#x<<", "<<#y<<", "<<#z<<") = "<<"("<<x<<", "<<y<<", "<<z<<")"<<endl;
#define dbgB(value, size) cerr<<#value<<": "<<bitset<size>(value) << endl;
#define line() cerr << "---------------" << endl;

const int dx[] = {1, -1, 0, 0};
const int dy[] = {0, 0, -1, 1};
const double PI = 3.14159265358979323846;

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; }

template<typename T>
void print1(T begin, T end) {
  while (begin != end) {
    cout << (*begin) << " ";
    *begin++;
  }
  cout << endl;
}

template<typename T>
void print2(T Array, int height, int width) {
  for (int i = 0; i < height; i++) {
    for (int j = 0; j < width; j++) {
      cout << " " << Array[i][j];
    }
    cout << endl;
  }
}

void print() { std::cerr << endl; }
template <class Head, class... Tail>
void print(Head&& head, Tail&&... tail) {
  std::cerr << head << " ";
  print(std::forward<Tail>(tail)...);
}

template<class T>
void Add(T &a, const T &b, const T &mod=1000000007) {
  int val = ((a % mod) + (b % mod)) % mod;
  if (val < 0) { val += mod; }
  a = val;
}

template <typename X, typename T> auto vectors(X x, T a) { return vector<T>(x, a); }
template <typename X, typename Y, typename Z, typename... Zs> auto vectors(X x, Y y, Z z, Zs... zs) { auto cont = vectors(y, z, zs...); return vector<decltype(cont)>(x, cont); }

// ------------------------------------------------------------------------------------------

int N;
int A[111111];
int dp[111111];

signed main() {
  cin >> N;
  rep (i, N) {
    cin >> A[i];
  }

  if (count(A, A+N, 0)) {
    int sum = 0;
    rep (i, N) {
      sum += abs(A[i]);
    }
    cout << sum << endl;
    return 0;
  }

  rep (i, N-1) {
    if (A[i] < 0) {
      A[i] *= -1;
      A[i+1] *= -1;
    }
  }

  int mCnt = 0;
  rep (i, N) {
    if (A[i] < 0) mCnt++;
  }

  if (mCnt) {
    rep (i, N) {
      A[i] = abs(A[i]);
    }
    sort(A, A+N);
    int sum = -A[0];
    repp (i, 1, N) {
      sum += A[i];
    }
    cout << sum << endl;
    return 0;
  } else {
    int sum = 0;
    rep (i, N) {
      sum += abs(A[i]);
    }
    cout << sum << endl;
    return 0;
  }


  return 0;
}

Measured memory_bytes: 1024
#include<iostream>
#include<cstdio>
#include<cstring>
#include<string>
#include<algorithm>
#include<bitset>
#include<vector>
#include<deque>
#include<queue>
#include<list>
#include<map>
#include<set>
#include<stack>
#include<cmath>
#include<iomanip>
#include <functional>
using namespace std;
typedef long long ll;
const int mod = 1000000007;
const int INF = 1 << 28;
const double EPS = 1e-10;
//cout << fixed << std::setprecision(9)
//memset(a, 0, sizeof(a));
//--------------------------

ll Pow(ll x, ll k)
{
	if (k == 0)     return 1;
	if (k % 2 == 0) return Pow(x*x, k / 2);
	else            return x*Pow(x, k - 1);
}


int main()
{
	ll n, p;
	ll ans = 1;
	cin >> n >> p;

	if (n == 1) {
		cout << p << endl;
		return 0;
	}

	if (n > 40) {
		cout << 1 << endl;
		return 0;
	}

	ll a = 2;
	while (a * a <= p) {
		if (p%a == 0) {
			ll div = Pow(a, n);
			while (p%div==0) {
				p /= div;
				ans *= a;
			}
		}
		a++;
	}

	cout << ans << endl;

	return 0;
}


Measured memory_bytes: 256
import java.util.*;

public class Main {
  public static void main(String[] args) throws Exception {
    Scanner sc = new Scanner(System.in);
    int A = sc.nextInt();
    int B = sc.nextInt();
    int C = sc.nextInt();
    int D = sc.nextInt();
    
    if(Math.abs(A-C) <= D){
      System.out.println("Yes");
    }
    else if((Math.abs(A-B) <= D) && (Math.abs(B-C) <= D)){
      System.out.println("Yes");
    }
    else{
      System.out.println("No");
    }
  }
}


Measured memory_bytes: 21972
import collections
N = int(input())
A = list(map(int,input().split()))
Q = int(input())
COL = collections.Counter(A)
ret = 0
ans = list()
for c in COL.keys():
    ret += COL[c] * c
for i in range(Q):
    B,C = map(int,input().split())
    if B in COL.keys():
        if C in COL.keys():
            COL[C] += COL[B]
            
            ret += (C-B) * COL[B]           
        else:
            COL[C] = COL[B]
            ret += (C-B) * COL[B]
        COL.pop(B)
    ans.append(ret)

for a in ans:
    print(a)

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

string s,t;
bool memo[4003][4003];
int main() {
	while(cin>>s>>t){
		for (int i = 0; i < 4003; i++){
			for (int j = 0; j < 4003; j++){
				memo[i][j] = false;
			}
		}
		
		for(int i=0;i<s.size();i++){
			for(int j=0;j<t.size();j++){
				if(s[i]==t[j]){
					memo[i][j]=true;
				}
			}
		}
		
		int ans=0;
		for(int i=0;i<s.size();i++){
			for(int j=0;j<t.size();j++){
				if(memo[i][j]){
					int sum=1;
					memo[i][j]=false;
					for(int k=1;k<max(s.size()-i,t.size()-j);k++){
						if(memo[i+k][j+k]){
							sum++;
							memo[i+k][j+k]=false;
						} else{
							ans=max(ans,sum);
							break;
						}
					}
				}
			}
		}
		
		cout<<ans<<endl;
	}
	return 0;
}

Measured memory_bytes: 16856
#include <stdio.h>
#include <iostream>
#include <vector>
#include <algorithm>
#include <functional>
#include <cstdlib>
#include <list>
#include <numeric>
#include <map>
#include <cmath>
#include <string>
#define rep(i,n) for(int i=0;i<n;i++)
#define all(x) (x).begin(),(x).end()
#define sz(x) ((int)(x).size())
#define Cout(s) cout<<s<<endl

bool sosuu(const int x)
{
	if (x == 2)return true;
	if (x < 2 || x % 2 == 0)return false;
	for (int i = 3; i * i <= x; i += 2)
		if (x % i == 0)return false;
	return true;
}
int gcd(int a, int b)
{
	if (a % b == 0) { return b; }
	else { return gcd(b, a % b); }
}

typedef long long ll;
using namespace std;
string Yes(bool b) { if (b) { return "Yes"; } else { return "No"; } }
string YES(bool b) { if (b) { return "YES"; } else { return "NO"; } }
//================================================

int a = 0, b = 0, c, d, n, k = 0,ans=0;
string s, t;


int main()
{
	int n, m;
	cin >> n >> m;
	int x[50] = {};
	rep(i, m * 2)
	{
		cin >> a; x[a-1]++;
	}
	rep(i, n)
		cout << x[i] << endl;

	return 0;
}

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

#define mod 1000000007;

using namespace std;


int main(){
    ios::sync_with_stdio(0);
    cin.tie(0);
    string S;
    cin >> S;
    deque<string> d;
    for(auto i = S.begin(); i != S.end(); i++){
        switch(*i){
            case '1':
                d.push_back("1");
                break;
            case '0':
                d.push_back("0");
                break;
            case 'B':
                if(!d.empty()) d.pop_back();
                break;
        }
    } 

    for(auto i = d.begin(); i != d.end(); i++){
        cout << *i;
    }
} 


Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

	static int[][] memo;

	public static int hoge(int current, int n, String last) {
		return 0;
	}

	public static void main(String[] args) throws IOException {
		BufferedReader bf = null;
		bf = new BufferedReader(new InputStreamReader(System.in));
		int a,e,k;
		String str;
		str = bf.readLine();
		a = Integer.parseInt(str);
		str = bf.readLine();
		str = bf.readLine();
		str = bf.readLine();
		str = bf.readLine();
		e = Integer.parseInt(str);
		str = bf.readLine();
		k = Integer.parseInt(str);
		if(e-a <= k) {
			System.out.println("Yay!");
		} else {
			System.out.println(":(");
		}
	}
}

Measured memory_bytes: 22228
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
int main(){
    int n, k, num=1;
    cin >> n >> k;
    rep(i, n){
        if(num*2 < num+k) num *= 2;
        else num += k;
    }
    cout << num << endl;
}

Measured memory_bytes: 256
import java.io.*;
import java.util.*;
import java.text.*;
import java.math.*;
import java.util.regex.*;

public class Main {
    static void func(int n,int k,int[] xa){
        int min = Integer.MAX_VALUE;
        for(int i = 0; i <= n - k; i++){
            min = Math.min(min,Math.min(Math.abs(xa[i]),Math.abs(xa[i+k-1])) + xa[i+k-1] - xa[i]);
            //System.out.println(min+":xa[i+k-1]"+xa[i+k-1]+":xa[i]"+xa[i]);
        }
        System.out.println(min);
    }

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int k = in.nextInt();
        int[] xa = new int[n];
        for(int i = 0; i < n; i++){
            xa[i] = in.nextInt();
        }
        func(n,k,xa);
        in.close();
    }
}

Measured memory_bytes: 50416
def solve():
    c = input()

    if c == "a":
        return True
    elif c == "e":
        return True
    elif c == "i":
        return True
    elif c == "o":
        return True
    elif c == "u":
        return True

    return False


if __name__ == '__main__':
    res = solve()

    if res:
        print("vowel")
    else:
        print("consonant")


Measured memory_bytes: 38256
#include<stdio.h>
 
struct Card{
  char suit;
  char value;
};
 
void bubble(Card A[], int n){
  int i, j;
  Card t;
  for ( i = 1; i <= n; i++ ){
    for ( j = n; j >= i+1; j-- ){
      if ( A[j].value < A[j-1].value ){
    t = A[j]; A[j] = A[j-1]; A[j-1] = t;
      }
    }
  }
}
 
void selection(Card A[], int n){
  int i, j, mini;
  Card t;
 for ( i = 1; i <= n; i++ ){
    mini = i;
    for ( j = i; j <= n; j++ ){
      if ( A[j].value < A[mini].value ) mini = j;
    }
    t = A[i]; A[i] = A[mini]; A[mini] = t;
  }
}
 
void print(Card A[], int n){
  int i;
  for ( i = 1; i <= n; i++ ){
    if ( i >1) printf(" ");
    printf("%c%c", A[i].suit, A[i].value);
  }
  printf("\n");
}
 
int isStable(Card C1[], Card C2[], int n){
  int i;
  for ( i = 1; i <= n; i++ ){
    if ( C1[i].suit != C2[i].suit ) return 0;
  }
  return 1;
}
 
int main(){
  Card C1[101], C2[101];
  int n, i;
  char ch;
 
  scanf("%d\n", &n);
  for ( i = 1; i <= n; i++ ){
    scanf("%c%c ", &C1[i].suit, &C1[i].value);
  }
 
  for ( i = 1; i <= n; i++ ) C2[i] = C1[i];
 
  bubble(C1, n);
  selection(C2, n);
 
  print(C1, n);
  printf("Stable\n");
  print(C2, n);
  if ( isStable(C1, C2, n) ){
    printf("Stable\n");
  } else {
    printf("Not stable\n");
  }
 
  return 0;
}


Measured memory_bytes: 2760
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); i++)
#define chmin(x,y) x = min(x,y)
using namespace std;
typedef long long ll;
const long long INF = 1LL << 60;

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


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

using namespace std;
#define dtype long long

int main() {
    ios_base::sync_with_stdio(false),cin.tie(nullptr);
    vector<dtype> divisor(1000001, 1);
    for (int i = 2; i <= 1000000; ++i) {
        for (int j = i; j <= 1000000; j += i) {
            divisor[j]++;
        }
    }
    dtype n,ans=0;
    cin>>n;
    for (int i = n-1; i >=1 ; i--) {
        ans+=divisor[i];
    }
    cout<<ans<<endl;

    return 0;
}

Measured memory_bytes: 11040
#include<iostream>

using namespace std;

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



Measured memory_bytes: 3096
n, m = map(int, input().split())
e = [int(input()) for _ in range(m)]

used = [False] * (n + 1)

for temp in e[::-1]:
    if not used[temp]:
        used[temp] = True
        print(temp)

for i in range(1, n + 1):
    if not used[i]:
        print(i)




Measured memory_bytes: 12208
#define _USE_MATH_DEFINES
#define INF 0x3f3f3f3f
#include <cstdio>
#include <iostream>
#include <sstream>
#include <cmath>
#include <cstdlib>
#include <algorithm>
#include <queue>
#include <stack>
#include <limits>
#include <map>
#include <string>
#include <cstring>
#include <set>
#include <deque>
#include <bitset>
#include <list>
#include <cctype>
#include <utility>

using namespace std;

typedef long long ll;
typedef pair <int,int> P;
typedef pair <int,P> PP;

int tx[] = {0,1,0,-1};
int ty[] = {-1,0,1,0};

static const double EPS = 1e-8;

struct Data{
	int pos;
	int op;
};

int main(){
	Data table[4][4];
	table[0][0].pos = 0;
	table[0][0].op = 1;

	table[0][1].pos = 1;
	table[0][1].op = 1;

	table[0][2].pos = 2;
	table[0][2].op = 1;

	table[0][3].pos = 3;
	table[0][3].op = 1;

	table[1][0].pos = 1;
	table[1][0].op = 1;

	table[1][1].pos = 0;
	table[1][1].op = -1;

	table[1][2].pos = 3;
	table[1][2].op = 1;

	table[1][3].pos = 2;
	table[1][3].op = -1;

	table[2][0].pos = 2;
	table[2][0].op = 1;

	table[2][1].pos = 3;
	table[2][1].op = -1;

	table[2][2].pos = 0;
	table[2][2].op = -1;

	table[2][3].pos = 1;
	table[2][3].op = 1;

	table[3][0].pos = 3;
	table[3][0].op = 1;

	table[3][1].pos = 2;
	table[3][1].op = 1;

	table[3][2].pos = 1;
	table[3][2].op = -1;

	table[3][3].pos = 0;
	table[3][3].op = -1;

	int n;
	while(~scanf("%d",&n)){
		if(n==0) break;
		int co1[4];
		int co2[4];
		
		for(int i=0;i<n;i++){
			for(int j=0;j<4;j++){
				scanf("%d",co1+j);
			}
			for(int j=0;j<4;j++){
				scanf("%d",co2+j);
			}

			int res[4];
			memset(res,0,sizeof(res));

			for(int a=0;a<4;a++){
				for(int b=0;b<4;b++){
					res[table[a][b].pos] += co1[a] * co2[b] * table[a][b].op;
				}
			}

			printf("%d %d %d %d\n",res[0],res[1],res[2],res[3]);
		}
	}
}

Measured memory_bytes: 0
#include<bits/stdc++.h>
#define ll long long
using namespace std;

int main(){
    ll n,a[100009],dp[100009],k;
    cin >> n >> k;
    for(int i=1; i<=n; i++)cin >> a[i];
    dp[n]=0;
    for(int i=n-1; i>=1; i--){
        ll z=1e15;
        for(int j=1; j<=k && i+j<=n; j++){
        	z=min(z,dp[i+j]+abs(a[i]-a[i+j]));
        }
        dp[i]=z;
    }
    cout << dp[2-1] << endl;
}

Measured memory_bytes: 1792
base = input().split()
re = input().split()
rev = []
n = int(base[0])
m = int(base[1])
for i in re:
  rev.append(int(i))
s = sum(rev)
rev.append(0)
rev.sort(reverse=True)
cnt = 0
while rev[0]>=(s/(4*m)):
  cnt += 1
  del rev[0]
if cnt >= m:
  print("Yes")
else:
  print("No")

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

int main(void) {
	int n; scanf("%d", &n);
	vector<int> num(n);
	for(int i = 0; i < n; i++)
		scanf("%d", &num[i]);

	vector<long long> ans(21);
	ans[num[0]] = 1;
	for(int i = 1; i < n - 1; i++) {
		vector<long long> tmp(21);
		for(int j = 0; j <= 20; j++) {
			if(ans[j] != 0) {
				if(j - num[i] >= 0)
					tmp[j - num[i]] += ans[j];
				if(j + num[i] <= 20)
					tmp[j + num[i]] += ans[j];
			}
		}
		ans = tmp;
	}
	printf("%lld\n", ans[num[n - 1]]);

	return 0;
}

Measured memory_bytes: 0
#include <iostream>
#include <cstring>
#include <cstdlib>
#include <sstream>
#include <stack>
#include <queue>
#include <stdio.h>
#include <algorithm>
using namespace std;
int main(int argc, char *argv[]) {
	char s[1000];
	stack<int> ans;
	int a,b,i,j=0,len,count=0;
	memset(s,'\n',sizeof(s));
	scanf("%[^\n]%*c",s);
	len=strlen(s);
	for(i=0;i<len;i++){
		j=0;
		char *s1=(char *)malloc(sizeof(char)*6);
		while(s[i]!=32&&i<len){
			*(s1+j++)=s[i++];
		}
		*(s1+j)='\0';
		string str(s1);
		if(str[0]=='+'){
			b=ans.top();ans.pop();
			a=ans.top();ans.pop();
			ans.push(a+b);
		}else if(str[0]=='-'){
			b=ans.top();ans.pop();
			a=ans.top();ans.pop();
			ans.push(a-b);
		}else if(str[0]=='*'){
			b=ans.top();ans.pop();
			a=ans.top();ans.pop();
			ans.push(a*b);
		}else{
			ans.push(atoi(str.c_str()));
		}
	} 
	cout<<ans.top()<<endl;
	return 0;
}


Measured memory_bytes: 3264
#include<bits/stdc++.h>
#include<iostream>
#include<cstdio>
#include<vector>
#include<string>
#include<algorithm>
#include<map>
using namespace std;
#define rep(i,x) for(ll i = 0; i < (ll)(x); i++)
#define pb push_back
#define eb emplace_back
#define debug(x) cerr << #x << ": " << (x) << "\n";
#define all(x) (x).begin(), (x).end()
typedef long long ll;
typedef long double ld;
typedef pair<int,int> P;
typedef pair<ll,ll> Pll;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
typedef vector<vector<vector<ll>>> vvvl;
const ll INF = numeric_limits<ll>::max()/4;
const ll MOD = 1e9+7;
const int n_max = 1e5+10;

int main(){
    ll n,x; cin >> n >> x;
    vector<ll> a(n);
    rep(i,n) cin >> a[i];
    sort(all(a));
    ll ans = 0;
    rep(i,n){
        if(x < a[i])break;
        x -= a[i];
        ans++;
    }
    if(ans == n && 0 < x)ans--;
    cout << ans << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,n) for(int (i)=0;(i)<(int)(n);++(i))
#define all(x) (x).begin(),(x).end()
#define pb push_back
#define fi first
#define se second
#define dbg(x) cout<<#x" = "<<((x))<<endl
template<class T,class U> ostream& operator<<(ostream& o, const pair<T,U> &p){o<<"("<<p.fi<<","<<p.se<<")";return o;}
template<class T> ostream& operator<<(ostream& o, const vector<T> &v){o<<"[";for(T t:v){o<<t<<",";}o<<"]";return o;}

using pi = pair<int,int>;

// (?????????,??????,??????)
struct edge{ int to,cap,rev; };

const int MAX_V = 111; // TODO:initialize
const int F_INF = 99999999; // TODO:initialize
vector<edge> G[MAX_V],z[MAX_V];
int level[MAX_V]; // s??????????????¢
int iter[MAX_V]; // ???????????§??????????????£??????

void add_edge(int from, int to, int cap){
    G[from].pb({to,cap,(int)G[to].size()});
    G[to].pb({from,cap,(int)G[from].size()-1});
}

void dinic_bfs(int s){
    memset(level,-1,sizeof(level));
    queue<int> que;
    level[s]=0;
    que.push(s);
    while(!que.empty()){
        int v = que.front();
        que.pop();
        rep(i,G[v].size()){
            edge &e = G[v][i];
            if(e.cap>0 && level[e.to]<0){
                level[e.to] = level[v]+1;
                que.push(e.to);
            }
        }
    }
}

// ?¢?????????????dfs??§??¢???
int dinic_dfs(int v, int t, int f){
    if(v==t) return f;
    for(int &i=iter[v]; i<G[v].size(); ++i){
        edge &e=G[v][i];
        if(e.cap>0 && level[v]<level[e.to]){
            int d = dinic_dfs(e.to,t,min(f,e.cap));
            if(d>0){
                e.cap -= d;
                G[e.to][e.rev].cap += d;
                return d;
            }
        }
    }
    return 0;
}

// s??????t???????????§???
int max_flow(int s, int t){
    int flow = 0;
    while(1){
        dinic_bfs(s);
        if(level[t]<0) return flow;
        memset(iter,0,sizeof(iter));
        int f;
        while((f=dinic_dfs(s,t,F_INF))>0) flow+=f;
    }
}

const int INF=5555555;
int ff[MAX_V][2]={};

void solve()
{
    bool direct = false;
    int K,N,M;
    cin >>K >>N >>M;
    vector<int> a(M),b(M),c(M);
    rep(i,M)
    {
        cin >>a[i] >>b[i] >>c[i];
        if(a[i]>b[i]) swap(a[i],b[i]);
        add_edge(a[i],b[i],c[i]);
        direct|=(a[i]==0 && 1<=b[i] && b[i]<=K);
    }

    if(direct)
    {
        cout << "overfuro" << endl;
        return;
    }

    int S=K+N+1,T=0;
    for(int i=1; i<=K; ++i) add_edge(S,i,INF);

    int F = max_flow(S,T);

    rep(i,MAX_V) z[i]=G[i];

    ff[S][0]=INF;
    rep(i,S)
    {
        rep(j,MAX_V) G[j]=z[j];
        ff[i][0] = max_flow(S,i);
    }
    ff[0][1]=INF;
    for(int i=1; i<=S; ++i)
    {
        rep(j,MAX_V) G[j]=z[j];
        ff[i][1] = max_flow(i,T);
    }

    int add = 0;
    rep(i,M)
    {
        int u=a[i], v=b[i];
        add = max(add,min(ff[u][0],ff[v][1]));
        add = max(add,min(ff[v][0],ff[u][1]));
    }

    cout << F+add << endl;
}

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

Measured memory_bytes: 3324
#include <bits/stdc++.h>
using namespace std;
 
int main(){
  int64_t a,b,k;
  cin>>a>>b>>k;
  if(k>=a+b){
a=0;
    b=0;
}
  else if(a-k>=0){
    a-=k;
  }
  else{
   b+=a-k; 
    a=0;
    
  }
  cout<<a<<" "<<b<<endl;
}
    

Measured memory_bytes: 256
#include<algorithm>
#include <bits/stdc++.h>
#include <math.h>
#include <queue>
using namespace std;
int main(void){
	string s;
	cin>>s;
	for(int i=0;i<s.size();i+=2) cout<<s[i];
	cout<<endl;
	return 0;
}

Measured memory_bytes: 512
// J'aime
// Chemise Blanche

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

#define int long long

#define ii pair<int,int>
#define fi first
#define sc second

#define all(x) (x).begin(),(x).end()
#define dbg(x) cerr << __LINE__ << " > " << #x << " = " << (x) << endl

void MAIN() {
  int a, b;
  cin >> a >> b;
  if (a + b == 15) cout << '+' << '\n';
  else if (a * b == 15) cout << '*' << '\n';
  else cout << 'x' << '\n';
}

signed main() {
#ifdef _DEBUG
  // freopen("in" , "r", stdin );
  // freopen("out", "w", stdout);
#endif
  ios::sync_with_stdio(0); cin.tie(0);
  int T = 1;
  // cin >> T;
  while (T--) MAIN();
}


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

int main(){
  int n;
  while(std::cin >> n){
    if(n == 0) break;
    for (int loop = 0; loop < n; loop++) {
      vector<int> a(4), b(4);
      for (int i = 0; i < 4; i++) std::cin >> a[i];
      for (int i = 0; i < 4; i++) std::cin >> b[i];

      vector<int> c(4, 0);
      vector<vector<int> > to = {
                                 {0, 1, 2, 3},
                                 {1, 0, 3, 2},
                                 {2, 3, 0, 1},
                                 {3, 2, 1, 0}
      };
      vector<vector<int> > val = {
                                  {1, 1, 1, 1},
                                  {1, -1, 1, -1},
                                  {1, -1, -1, 1},
                                  {1, 1, -1, -1}
      };
      for (int i = 0; i < 4; i++) {
        for (int j = 0; j < 4; j++) {
          c[to[i][j]] += a[i]*b[j]*val[i][j];
        }
      }
      for (int i = 0; i < 4; i++) {
        std::cout << c[i];
        if(i != 3) std::cout << " ";
        else std::cout << std::endl;
      }
    }
  }
  return 0;
}



Measured memory_bytes: 3156
#include<bits/stdc++.h>
#define fi first
#define se second
using namespace std;
typedef long long ll;
const double PI=acos(-1.0);
const double eps=1e-6;
const int inf=1e9;
const int mod=1e9+7;
const int maxn=5e5+10;
int n;
int a[maxn];
int pre[maxn];
int la[maxn];
int gcd(int a,int b){
    return b==0?a:gcd(b,a%b);
}
int main(){
    ios::sync_with_stdio(false);
    cin>>n;
    int d1=0,d2=0;

    for(int i=1;i<=n;i++){
        cin>>a[i];
        d1=gcd(a[i],d1);
        pre[i]=gcd(pre[i-1],a[i]);
    }
    for(int i=n;i>=1;i--){
        la[i]=gcd(la[i+1],a[i]);
    }
    int ans=d1;
    for(int i=1;i<=n;i++){
        ans=max(ans,gcd(pre[i-1],la[i+1]));
    }
    cout<<ans<<endl;
    return 0;
}
//x+y-a*c1==a*c2;
//x+y=a*2-x;


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

int main() {

    int N, n;
    long K;
    cin >> N >> K;
    int D = 1000000000 + 7;
    vector<int> numbers(N);
    vector<int> A(2001, 0);
    int reverse_counter = 0;
    for(int i=0;i<N;i++){
        cin >> n;
        numbers.at(i) = n;
        A.at(n)++;
        for(int j=numbers.at(i)+1;j<2001;j++){
            reverse_counter += A.at(j);
        }
    }
    int small_number = 0;
    int total_number = 0;
    for(int i=0;i<2001;i++){
        small_number += total_number * A.at(i);
        total_number += A.at(i);
    }
    long answer = (K*reverse_counter) % D;
    long ans = (((K*(K-1)/2) % D) * small_number) % D;
    cout << (answer + ans)%D << endl;
}


Measured memory_bytes: 256
while 1:
	n = input()
	if n == 0:break
	D = range(1,7)
	for i in range(n):
		c = raw_input()[0]
		if   c == "s": S = [1,5,2,3,0,4]
		elif c == "n": S = [4,0,2,3,5,1]
		elif c == "w": S = [3,1,0,5,4,2]
		elif c == "e": S = [2,1,5,0,4,3]
		D = [D[s] for s in S]
	print D[0]

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

int main(){

int d,t,s;
cin >> d >> t >> s;
if(d<=s*t) cout << "Yes"<< endl;
else cout << "No" << endl;
}

Measured memory_bytes: 3628
#include<iostream>
#include<algorithm>
#include<iomanip>
#include"math.h"

#define MAX 1000000

int main(){
    char s[6];
    scanf("%s", s);
    if(s[2]==s[3]&&s[4]==s[5]) printf("Yes\n");
    else printf("No\n");
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <set>
#include <queue>
#include <vector>
#include <algorithm>
#include <math.h>
#include <cmath>
#include <string>
#include <cstring>
#include <climits>
#include <sstream>
#include <iomanip>
#include <map>
#include <stack>
#include <tuple>
#include <numeric>
#include <assert.h>
#include <functional>
#include <unordered_map>

using namespace std;

/*-----------------------------------------------------------------------------
　定義
 -------------------------------------------------------------------------------*/
#define ALL(a)			a.begin(), a.end()
#define REP(i, n)		for (int (i) = 0 ; (i) < (int)(n) ; ++(i))
#define REPN(i, m, n)	for (int (i) = m ; (i) < (int)(n) ; ++(i))
#define INF				2e9
#define MOD				(1000 * 1000 * 1000 + 7)
#define Ceil(x, n)		(((((x))+((n)-1))/n))		/* Nの倍数に切り上げ割り算 */
#define CeilN(x, n)		(((((x))+((n)-1))/n)*n)		/* Nの倍数に切り上げ */
#define FloorN(x, n)	((x)-(x)%(n))				/* Nの倍数に切り下げ */
#define IsOdd(x)		(((x)&0x01UL) == 0x01UL)			
#define IsEven(x)		(!IsOdd((x)))						
#define	MAX_QWORD		((QWORD)0xFFFFFFFFFFFFFFFF)
#define M_PI			3.14159265358979323846
typedef long long		ll;
typedef pair<ll, ll>	P;

/*-----------------------------------------------------------------------------
　処理
 -------------------------------------------------------------------------------*/
int main()
{
	int N;
	cin >> N;
	vector<int> X(N);
	vector<P> P;
	REP(i, N) {
		cin >> X[i];
		P.emplace_back(i, X[i]);
	};
	sort(ALL(X));
	int xf = X[N / 2];
	int xb = X[N / 2 - 1];
	int ct = N / 2;

	REP(i, N) {
		if (P[i].second <= xb) {
			cout << xf << endl;
		} else {
			cout << xb << endl;
		}
	}
	return 0;
}



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

const int N = 1e5 + 10;
typedef long long LL;

int n, a[N], b[N], c[N];
LL sum[N];

int main(){
	scanf("%d", &n);
	for(int i=0; i<n; i++)	scanf("%d", a+i);
	for(int i=0; i<n; i++)	scanf("%d", b+i);
	for(int i=0; i<n; i++)	scanf("%d", c+i);
	sort(a, a+n);
	sort(b, b+n);
	sort(c, c+n);
    int j = 0;
    LL cur = 0;
    for(int i=0; i<n; i++){
        while(j<n && a[j] < b[i]){
			cur++;
			j++;
        }
        sum[i] = cur;
    }
    j = 0;
    cur = 0;
    LL ans = 0;
    for(int i=0; i<n; i++){
		while(j<n && b[j] < c[i]){
			cur+=sum[j];
			j++;
		}
		ans += cur;
    }
    printf("%lld\n", ans);
	return 0;
}


Measured memory_bytes: 2176
use proconio::input;
#[allow(unused_imports)]
use proconio::marker::{Bytes, Chars};
#[allow(unused_imports)]
use std::cmp::{min, max};

fn main() {
	input! {
		a: usize,
		b: usize,
	}

	if (a*b)%2 == 0 {
		println!("Even");
	}
	else {
		println!("Odd");
	}
}



Measured memory_bytes: 2084
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <functional>
#include <queue>
#include <string>
#include <cstring>
#include <numeric>
#include <cstdlib>
#include <cmath>
#include <map>
#include <unordered_map>
#include <set>
#include <boost/multiprecision/cpp_int.hpp>
using namespace std;
using namespace boost::multiprecision;
typedef long long ll;


#define INF 10e17
#define rep(i,n) for(long long i=0; i<n; i++)
#define repr(i,n,m) for(long long i=m; i<n; i++)
#define END cout << endl
#define MOD 1000000007
#define pb push_back
#define sorti(x) sort(x.begin(), x.end())
#define sortd(x) sort(x.begin(), x.end(), std::greater<long long>())
#define debug(x) std::cerr << (x) << std::endl;
#define roll(x) for (auto&& itr : x) { debug(itr); }

template <class T> inline void chmax(T &ans, T t) { if (t > ans) ans = t;}
template <class T> inline void chmin(T &ans, T t) { if (t < ans) ans = t;}

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

int n, k;
  cin >> n >> k;
  vector<cpp_int> a(n);

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

  

  vector<cpp_int> t(n), pre(n);

  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < n; ++j) {
      if (i == j) continue;
      if (a[i] > a[j]) {
        t[i] += 1;
        if (i > j) {
          pre[i] += 1;
        }
      }
    }
  }

  cpp_int ans = 0;
  cpp_int mod = 1000000007;
  for (int i = 0; i < n; ++i) {
	cpp_int tmp = (k * (2 * (t[i] - pre[i]) + (k - 1) * (t[i]))) / 2;
  
    ans += tmp;  
  }

  cout << ans % mod << endl;
}


Measured memory_bytes: 512
#include <bits/stdc++.h>
using namespace std;
     
int main(){
 int A,B,C;
 cin >> A >> B >> C;
 string ans="NO";


 for(int i=0;i<=B;i++)
 {
 if(i*A%B==C)ans = "YES";
 }

 cout << ans << endl;

  return 0;
}

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

if N == 0:
    print(X)
    exit()

p_array = list(map(int, input().split()))

for i in range(100):
    if X - i not in p_array:
        print(X - i)
        exit()
    if X + i not in p_array:
        print(X + i)
        exit()


Measured memory_bytes: 61944
#include <bits/stdc++.h>
#define REP(i,n) for (int i = 0; i <(n); ++i)
#define REP2(i,x,n) for (int i = x; i <(n); ++i)
#define ALL(v) v.begin(), v.end()
#define RALL(v) v.rbegin(), v.rend()
using namespace std;
using ll = long long;
using P = pair<int,int>;
static const double PI = acos(-1);
static const int INF = 1e9+7;



int main(){
  int H, W, k;
  cin >> H >> W >> k;
  vector<string> field(H);
  REP(h,H) cin >> field[h];

  int ans = 0;

  //bit全探索
  REP(h, 1 << H) REP(w, 1 << W){
    int cnt = 0;

    REP(i, H) if( h >> i & 1){
      REP(j, W) if( w >> j &1){
        if(field[i][j] == '#') ++cnt;
      }
    }
    if(cnt == k) ++ans;
  }

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


Measured memory_bytes: 3540
#include<stdio.h>
int main() {
	int i, j, H, W;
	while (1) {
		scanf("%d %d", &H, &W);
		if (H == 0 && W == 0) {
			break;
		}
		for (i = 0;i < H;i++) {
			for (j = 0;j < W;j++) {
				printf("#");
			}
			printf("\n");
		}
		printf("\n");
	}
	return 0;
}

Measured memory_bytes: 572
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  string S;
  cin >> S;
  int maxc = 0;
  for(int i = 0; i < S.size(); i++){
    int count = 0;
    int j = i;
    while(S.at(j) == 'A'||S.at(j) == 'T'||S.at(j) == 'G'||S.at(j) == 'C'){
      count++;
      if(j != S.size() - 1)j++;
      else break;
    }
    maxc = max(count, maxc);
  }
  cout << maxc << endl;
}
      
      

Measured memory_bytes: 3620
#include<cstdio>
typedef long long ll;
ll a[210000];
ll abs(ll x) {return x<0?-x:x;}
int main()
{
	int n;
	ll sum=0,s=0,ans=0x7fffffff;
	scanf("%d",&n);
	for(int i=1;i<=n;i++) scanf("%lld",&a[i]),sum+=a[i];
	for(int i=1;i<n;i++)
	{
		s+=a[i];
		if(abs(sum-2*s)<ans) ans=abs(sum-2*s);
	}
	printf("%lld\n",ans);
	return 0;
}

Measured memory_bytes: 1664
//For higher stack size use g++ -O2 -std=c++11 -Wall -Wl,--stack=268435456 a.cpp -o a.exe in cmd
    #include <bits/stdc++.h>
    #include <cstdio>
    #include <cstring>
    #include <cmath>
    #include <cstring>
    #include <chrono>
    #include <complex>
    #define ll long long
    #define ld long double
    #define vi vector<int>
    #define vll vector<ll>
    #define vvi vector < vi >
    #define pii pair<int,int>
    #define pll pair<long long, long long>
    #define mod 1000000007
    #define inf 1000000000000000001;
    #define all(c) c.begin(),c.end()
    #define mp(x,y) make_pair(x,y)
    #define mem(a,val) memset(a,val,sizeof(a))
    #define eb emplace_back
    #define pb push_back
    #define f first
    #define s second
    
    using namespace std;
    int main()
    {
        std::ios::sync_with_stdio(false);
        int T;
        T=1;
        // cin.ignore(); must be there when using getline(cin, s)
        while(T--)
        {
            int n,i,j,m;
            cin>>n>>m;
            int ar[n+1],ct=0,sum=0;
            for(i=1;i<=n;++i)
            {
                cin>>ar[i];
                sum=sum+ar[i];
            }
            for(i=1;i<=n;++i)
            {
                if(ar[i]*4*m>=sum)
                    ++ct;
            }
            if(ct>=m)
                cout<<"Yes"<<endl;
            else
                cout<<"No"<<endl;
        }
        return 0;
    }


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

bool present[102];
int main(){
    int x,n; cin>>x>>n;
    for(int i=0; i<n; ++i){
        int tmp; cin>>tmp;
        present[tmp]=1;
    }
    int minv = -1;
    int diff = abs(x-minv);
    for(int i=0; i<102; ++i){
        if(!present[i] and abs(i-x)<diff){
            minv = i;
            diff = abs(i-x);
        }
    }
    cout<<minv<<endl;
    return 0;
}


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

#define irep(i,n) for(int i = 0; i < (int)(n); i++)
#define irep2(i,a,n) for(int i = (int)(a); i <= (int)(n); i++)
#define irrep(i,n) for(int i = (int)(n-1); i > -1; i--)
#define irrep2(i,n,a) for(int i = (int)(n); i >= (int)(a); i--)

#define fi first
#define se second

using namespace std;

using ll = long long;
using v_int = vector<int>;
using v2_int = vector<v_int>;
using v_ll = vector<ll>;
using v2_ll = vector<v_ll>;
using v_string = vector<string>;
using v_bool = vector<bool>;
using v2_bool = vector<v_bool>;
using pii = pair<int, int>;
using mii = map<int, int>;

const double PI = 3.1415926535897932;
const int INF = (int)2e9;
const ll LINF = (ll)2e18;
const ll MOD = 1000000007;
const int dc[8] = {1, -1, 0,  0, 1, -1,  1, -1};
const int dr[8] = {0,  0, 1, -1, 1,  1, -1, -1};

template<typename T, typename U> inline
ostream& operator<<(ostream &o, pair<T,U> &p) {
    return o << "{" << p.first << "," << p.second << "}";
}
template<typename T> inline
istream& operator>>(istream &is, vector<T> &vec) {
    for(auto &v : vec) { is >> v; }
    return is;
}
template<typename T> inline
ostream& operator<<(ostream &os, vector<T> &vec) {
    for(auto &v : vec) { os << v << ",";}
    return os;
}
template<typename T> inline
ostream& operator<<(ostream &os, vector<vector<T> > &mat) {
    for(auto &row : mat) { os << row << endl; }
    return os;
}
template<typename T> inline
void chmin(T &a, T b) { a = min(a, b); }
template<typename T> inline
void chmax(T &a, T b) { a = max(a, b); }

int main(void)
{
    int n;
    cin >> n;

    int a[2];

    irep(i, 2) {
        int d = 1;
        a[i] = 0;
        irep(j, 2) {
            a[i] += (n%10)*d;
            n /= 10;    
            d *= 10;
        }
        //cout << a[i] << endl;
    }
    
    if((a[0] == 0 || a[0] >= 13) && (a[1] == 0 || a[1] >= 13)) {
        cout << "NA" << endl;
    } else if(a[0] == 0 || a[0] >= 13) {
        cout << "MMYY" << endl;
    } else if(a[1] == 0 || a[1] >= 13) {
        cout << "YYMM" << endl;
    } else {
        cout << "AMBIGUOUS" << endl;
    }
    return 0;
} /*atcoder*/


Measured memory_bytes: 3588
#include <iostream>
#include <vector>
#include <iomanip>
#include <cmath>
#include <algorithm>

using namespace std;

int N;
vector<double> X;
vector<double> R;

bool in(double y){
    double l = -1e9, r = 1e9;
    for(int i=0; i<N; ++i){
        double dx = sqrt(R[i]*R[i]-y*y);

        l = max(l, X[i]-dx);
        r = min(r, X[i]+dx);
    }
    return (l<r);
}

int main(void){
    cin >> N;
    X.resize(N);
    R.resize(N);

    double down=0, mid, up = 1e9;
    for(int i=0; i<N; ++i){
        cin >> X[i] >> R[i];
        up = min(up, (double)R[i]);
    }

    for(int i=0; i<100; ++i){
        mid = (down+up)/2;
        if(in(mid)){
            down = mid;
        }else{
            up = mid;
        }
    }

    cout << fixed << setprecision(10) << down << std::endl;
}

Measured memory_bytes: 4360