akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define MOD 1000000007
#define fi first
#define se second
#define rep(i,n) for(int i = 0 ; i < n ; i++)
#define repe(i,n) for(int i = 0 ; i <= n ; i++)
#define repb(i,a,b) for(int i = a ; i < b ; i++)
#define repeb(i,a,b) for(int i = a ; i <= b ; i++)
#define rfor(i,n,a) for(int i = n ; i >= a ; i--)
#define pb push_back
#define popb pop_back()
#define endl "\n"
#define pii pair<int,int> 
#define pll pair < long long, long long >
typedef priority_queue<ll, vector<ll>, greater<ll>> minheap;
typedef priority_queue<ll> maxheap;
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL)
#define p0(a) cout << a << " "
#define p1(a) cout << a << endl
#define p2(a,b) cout << a << " " << b << endl
#define p3(a,b,c) cout << a << " " << b << " " << c << endl
#define p4(a,b,c,d) cout << a << " " << b << " " << c << " " << d << endl
#define sortv(v) sort(v.begin(),v.end())
#define rsortv(v) sort(v.begin(),v.end(), greater<>());
#define sortby(v,prop) sort( v.begin( ), v.end( ), [ ]( const auto& lhs, const auto& rhs ){ return lhs.prop < rhs.prop; });
#define rsortby(v,prop) sort( v.begin( ), v.end( ), [ ]( const auto& lhs, const auto& rhs ){ return lhs.prop > rhs.prop; });

ll modPower(ll num,ll r){
	if(r==0) return 1;
	if(r==1) return num%MOD;
	ll ans=modPower(num,r/2)%MOD;
	if(r%2==0) {
		return (ans*ans)%MOD;
	} return (((ans*ans)%MOD)*num)%MOD;
}

ll nCr(ll n, ll r) { 
    ll res = 1; 
    if (r > n - r) {
        r = n - r; 
    }
    rep(i,r) { 
        res *= (n - i); 
        res /= (i + 1); 
    } 
    return res; 
}

bool isPrime(long long n)
{
    if (n <= 1) return false;
    if (n <= 3) return true;
    if (n % 2 == 0 || n % 3 == 0) return false;
 
    for (int i = 5; i * i <= n; i = i + 6)
        if (n % i == 0 || n % (i + 2) == 0)
            return false;
 
    return true;
}


/*-------------------------------------------------*/

void solve() {

	ll n, num, q, sum= 0, a, b;
	cin >> n;

	unordered_map<ll,ll> m;

	rep(i,n) {
		cin >> num;
		m[num]++;
		sum += num;
	}

	cin >> q;

	rep(i,q) {
		cin >> a >> b;
		ll afreq = m[a], bfreq = m[b];
		sum -= afreq*a;
		sum += afreq*b;
		m[a] = 0;
		m[b] += afreq;
		p1(sum);
	}
}


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

Measured memory_bytes: 7100
#include <bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
 
using namespace std;
//using namespace __gnu_pbds;

typedef long long int ll;
 
//typedef tree<pair<ll,ll>, null_type, less<pair<ll,ll>>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
 

 
const ll N = 10005;
const ll mod = 998244353;
const long long int inf = 10e17;
#define pp pair<ll,ll>

typedef long double ld;
typedef vector<pp> vpl;
#define MP make_pair
#define endl "\n"
#define rep(i,n) for(ll i=0;i<n;i++)
#define rep1(i,n) for(ll i=1;i<n;i++)
#define rrep(i,n) for(ll i=n-1;i>=0;i--)
#define repb(i,n) for(ll i=1;i<n-1;i++) 
#define trace(i,a) for(auto i=a.begin();i!=a.end();i++) 
#define mtrace(i,a) for(auto i=a.begin();i!=a.end();i++)  cout<<i->first<<" "<<i->second<<endl;   
 
const ld pi = 3.14159265359;

mt19937_64 rang(chrono::high_resolution_clock::now().time_since_epoch().count());
int rng(int lim) {
	uniform_int_distribution<int> uid(0,lim-1);
	return uid(rang);
}

 
void fastIO(void);
void decimal(int);
ll modmulti(ll, ll);
ll modadd(ll, ll);
ll modpower(ll, ll);
ll gcd(ll, ll );
ll modinv(ll);


int main()
{
	ll n,k;
	cin>>n>>k;
	if(n>k) n = n%k;
	cout<<min(n,k-n)<<endl;

}

	


 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
void fastIO(void)
{  ios_base::sync_with_stdio(false);
   cin.tie(0);
   cout.tie(0);
}
 
void decimal(int n){
   cout<<fixed;
   cout<<setprecision(n);
}
ll modmulti(ll a, ll b){
   return ((a%mod)*1ll*(b%mod))%mod;
}
ll modadd(ll a, ll b){
   ll asdfgh =  ((a%mod)+(b%mod)+mod+mod)%mod;
   asdfgh = (asdfgh+mod)%mod;
   return asdfgh;
}
ll modpower(ll a, ll n){
   if(n==0) return 1;
   if(n==1) return a%mod;
   ll b = modpower(a,n/2);
   b = modmulti(b,b);
   if(n%2==0) return b;
   return modmulti(a,b);
}
ll gcd(ll a, ll b){
   if(b==0)
      return a;
   return gcd(b,a%b);
}
ll modinv(ll a){
   return modpower(a,mod-2);
}

Measured memory_bytes: 256
N , M = map(int, input().split())
AB = [list(map(int,input().split())) for i in range(M)]


def DFS(table):
    visited = [1]
    que = [1]
    
    while que != []:
        now = que[0]
        del que[0]
        
        for index, e in enumerate(table[now]):
            if (e == 1) & (index not in visited):
                visited.append(index)
                que.append(index)
        
    if len(visited) == N:
        return 0
    else:
        return 1

ans = 0
for i in range(M):
    graph = AB.copy()
    del graph[i]
    
    table = [[0]*(N+1) for i in range(N+1)]
    for a,b in graph:
        table[a][b] = 1
        table[b][a] = 1

    ans += DFS(table)

print(ans)
    

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

using namespace std;

#define int long long

main() {
#ifdef HOME
    //freopen("input.txt", "r", stdin);
#endif // HOME
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int l, r, mod = 2019, ans = 2019;
    cin >> l >> r;
    r = min(r, l + 5000);
    for (int i = l; i <= r; ++i) {
        for (int j = i + 1; j <= r; ++j) ans = min(ans, i * j % mod);
    }
    cout << ans;
    return 0;
}



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

using namespace std;

#define INF 1000000007
#define LINF (1LL << 60)
#define PI 3.14159265358979

typedef long long i64;
typedef pair<i64,i64> P;

inline i64 mod(i64 a, i64 m) { return (a % m + m) % m; }

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



int n;
string s;
void solve(){
	cin >> s;
	n = s.size();
	
	int cnt = 0;
	for(int i = 0; i < n; i++){
		if(s[i] == '1') cnt++;
	}
	cout << min(cnt, n-cnt)*2 << endl;
}

int main(){
	std::cin.tie(0);
	std::ios::sync_with_stdio(false);
	int t = 1;
	//cin >> t;
	while(t--){
		solve();
	}
	
	return 0;
}


Measured memory_bytes: 512
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); i ++)
using namespace std;
typedef long long ll;
typedef pair<ll,ll> PL;
typedef pair<int,int> pint;
const int INF = 1e9;
const int MOD = 998244353;
const vector<int> dy = {-1,0,1,0};
const vector<int> dx = {0,1,0,-1};

int main() {
    int T; cin >> T;
    rep(_,T) {
        int N,K; cin >> N >> K;
        vector<int> X(N);
        rep(i,N) cin >> X[i];
        vector<int> diff(N - 1);
        rep(i,N - 1) diff[i] = X[i + 1] - X[i];
        sort(diff.begin(),diff.end());
        int ans = 0;
        if (N > K) {
            rep(i,N - K) ans += diff[i];
        }
        printf("%d\n",ans);
    }
}


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

#define int long long
#define flash ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define pb push_back
#define all(x) begin(x),end(x)

int mod = 1e9+7;
int inf = 4e18;
const int N = 5e5+5;
int help(string s,string &t)
{
	int n = s.size();
	int ct = 0;
	for(int i=0;i<n;++i)
	{
		if(s[i]!=t[i])
		++ct;
	}
	return ct;
}		
signed main()
{
    flash
    int tt = 1;
    //cin>>tt;
    while(tt--)
    {
		string s,t;
		cin>>s>>t;
		int ns = s.size();
		int nt = t.size();
		int minn = inf;
		for(int i=0;i<=ns-nt;++i)
		{
			minn = min(minn,help(s.substr(i,nt),t));
		}
		cout<<minn;
    }
    return 0;
}


Measured memory_bytes: 3668
#include<iostream>
#include<cstring>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<set>
#include<bitset>
#include<map>

#define fo(i,a,b) for(int i=a;i<=b;i++)
#define fd(i,a,b) for(int i=a;i>=b;i--)

using namespace std;

typedef long long LL;
typedef double db;

int get(){
	char ch;
	while(ch=getchar(),(ch<'0'||ch>'9')&&ch!='-');
	if (ch=='-'){
		int s=0;
		while(ch=getchar(),ch>='0'&&ch<='9')s=s*10+ch-'0';
		return -s;
	}
	int s=ch-'0';
	while(ch=getchar(),ch>='0'&&ch<='9')s=s*10+ch-'0';
	return s;
}

const int N = 1e+5+5;

int n;
int a[N*2];
int v[N*2];

bool check(int d){
	fo(i,1,n*2-1)v[i]=(a[i]>=d);
	int l=0,r=n*2;
	fd(i,n,2)if (v[i]==v[i-1]){l=i;break;}
	fo(i,n,n*2-2)if (v[i]==v[i+1]){r=i;break;}
	if (l&&r<n*2){
		if ((r-l)%2==0)return v[l];
		return (n-l<r-n)?v[l]:v[r];
	}
	if (!l&&r==n*2)return v[1];
	if (!l)return v[r];
	if (r==n*2)return v[l];
	return 0;
}

int main(){
	n=get();
	fo(i,1,n*2-1)a[i]=get();
	int l=1,r=n*2-1,ans=0;
	while(l<=r){
		int mid=(l+r)/2;
		if (check(mid))ans=mid,l=mid+1;
		else r=mid-1;
	}
	printf("%d\n",ans);
	return 0;
}

Measured memory_bytes: 1792
#include <stdio.h>
#include <string.h>
int main() {
  int N, i, j, len;
  char S[1000000];
  char A[30] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
  scanf("%d", &N);
  scanf("%s", S);
  len = strlen(S);
  for (i = 0; i < len; ++i) {
    for (j = 0; j < 26; ++j) {
      if (S[i] == A[j]) {
        int a = j;
        a += N;
        if (a > 25) {
          a -= 26;
        }
        S[i] = A[a];
        break;
      }
    }
  }
  printf("%s\n", S);
  return 0;
}

Measured memory_bytes: 128
S = input()
atgc = ["A", "T", "G", "C"]
anset = set()
L = 0
for i in range(len(S)):
    if S[i] in atgc:
        L += 1
    else:
        anset.add(L)
        L = 0
    if i == len(S)-1:
        anset.add(L)

print(max(anset))


Measured memory_bytes: 2940
#include<iostream>
#include<queue>
using namespace std;
const int INF=10000;
typedef pair<int,int> P;
char town[1001][1001];
int h,w,n;
int s;
int d[1001][1001];
int dx[4]={1,0,-1,0},dy[4]={0,1,0,-1};
char num='1';
int sx,sy,gx,gy;
int ans=0;

int bfs(){
queue<P> que;

 for(int i=0;i<h;i++){
   for(int j=0;j<w;j++){
     d[i][j]=INF;
   }
 }
 d[sy][sx]=0;
 que.push(P(sy,sx));

 while(que.size()){
   P p=que.front(); que.pop();
   
   if(town[p.first][p.second]==num){
     sy=p.first;
     sx=p.second;
     return d[p.first][p.second];
     break;
   }
   
   for(int i=0;i<4;i++){
     int ny=p.first + dy[i],nx=p.second+dx[i];
     
     if(0<=nx && nx<w && 0<=ny && ny<h && town[ny][nx]!='X' && d[ny][nx]==INF){
       que.push(P(ny,nx));
       d[ny][nx]=d[p.first][p.second]+1;
     }
   }
 }
}


int main(){
  cin>> h>> w>> n;
  
  for(int i=0;i<h;i++){
    for(int j=0;j<w;j++){
      cin>> town[i][j];
      if(town[i][j]=='S'){
	sy=i;
	sx=j;
      }
    }
  }

for(num='1';num<'1'+n;num++){
  ans+=bfs();
 }
  cout<< ans<< endl;
}

Measured memory_bytes: 6104
#!/usr/bin/env python3


def solve(n):

    s = input()
    sum_a = 0
    sum_n = 0
    sum_np = 0
    min_sum_np = 10 ** 15

    j = s.find('-')
    if j < 0:
        return sum(list(map(int, s.split(' + '))))

    sum_a = sum(list(map(int, s[:j - 1].split(' + '))))
    j += 2
    s += ' '
    len_s = len(s)
    sign = -1
    w = ''
    while j < len_s:
        ch = s[j]
        j += 1
        if ch == ' ':
            if len(w):
                a = int(w)
                sum_a += a
                w = ''
                if sign < 0:
                    sum_n += a
                    sum_np = 0
                else:
                    sum_np += a
        elif ch == '+':
            sign = 1
        elif ch == '-':
            min_sum_np = min(min_sum_np, sum_n + sum_np)
            sign = -1
        else:
            w += ch

    min_sum_np = min(min_sum_np, sum_n + sum_np)
    return sum_a - 2 * min_sum_np


def main():
    n = input()
    n = int(n)

    print(solve(n))


if __name__ == '__main__':
    main()



Measured memory_bytes: 16048
#include "bits/stdc++.h"
using namespace std;
#define ll long long int
#define rep(i,n) for( int i = 0; i < n; i++ )
#define rrep(i,n) for( int i = n; i >= 0; i-- )
#define REP(i,s,t) for( int i = s; i <= t; i++ )
#define RREP(i,s,t) for( int i = s; i >= t; i-- )
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define INF 2000000000
#define mod 1000000007
#define INF2 1000000000000000000


int main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int A, B;
    cin >> A >> B;
    cout << max(0, A - B * 2) << endl;

    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <cstdlib>
#include <time.h>
#include <algorithm>
#include <map>
#include <queue>
#include <stack>
#include <vector>
#include <array>
#include <string>
#include <iomanip>
#include <cstring>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define mp make_pair
#define eb emplace_back
#define F first
#define S second
using namespace std;
using namespace __gnu_pbds;

typedef long long int ll;
typedef tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update> ost;

const ll maxN = 1e7;
const ll INF = 1e17;
const ll MOD = 1e9 + 7;

ll xs[] = {-1, 1, 0, 0, -1, 1, 1, -1};
ll ys[] = {0, 0, -1, 1, -1, 1, -1, 1};

ll segtree[maxN << 2];
ll lazy[maxN << 2];
ll A[maxN];

inline ll left(ll x){
	return x << 1;
}

inline ll right(ll x){
	return (x<<1) + 1;
}

void build(ll node, ll start, ll end){
	if(start == end)
		segtree[node] = A[start];
	else{
		ll mid = (start + end)/2;
		build(left(node), start, mid);
		build(right(node), mid+1, end);
		segtree[node] = segtree[left(node)] + segtree[right(node)];
	}
}

void update(ll node, ll start, ll end, ll l, ll r, ll val){
	if(lazy[node] != 0){
		segtree[node] += (end-start+1)*lazy[node];
		if(start != end){
			lazy[left(node)] += lazy[node];
			lazy[right(node)] += lazy[node];
		}
		lazy[node] = 0;
	}
	if(start > end or l > start or r < end)
		return ;
	else if(start >= l and r >= end){
		segtree[node] += val;
		if(start != end){
			lazy[left(node)] += val;
			lazy[right(node)] += val;
		}
	}
	else{
		ll mid=(start + end)/2;
		update(left(node), start, mid, l, r, val);
		update(right(node), mid+1, end, l, r, val);
		segtree[node] = segtree[left(node)] + segtree[right(node)];
	}
}

ll sums(ll node, ll start, ll end, ll l, ll r){
	if(lazy[node] != 0){
		segtree[node] += (end-start+1)*lazy[node];
		if(start != end){
			lazy[left(node)] += lazy[node];
			lazy[right(node)] += lazy[node];
		}
		lazy[node] = 0;
	}
	if(l > end or r < start or start > end)
		return 0;
	if(l <= start and r >= end)
		return segtree[node];
	ll mid = (start+end)/2;
	return sums(left(node), start, mid, l , r) + sums(right(node), mid + 1, end, l , r);
}

int main(){
	cin.sync_with_stdio(false);
	cin.tie(0);
	ll a, b, c;
	cin >> a >> b >> c;
	if((a*100 + b*10 + c)%4 == 0)
		cout << "YES";
	else
		cout << "NO";
	return 0;
}

Measured memory_bytes: 3536
#include <stdio.h>
using namespace std;


int main() {
	int a = 0, b = 0, c = 0;

	while (1) {
		scanf("%d %d %d", &a, &b, &c);
		if (a == -1 && b == -1 && c == -1) {
		break;
		}
		else if (a == -1 || b == -1) {
			printf("F\n");
		}
		else if (a + b >= 80) {
			printf("A\n");
		}
		else if (a + b >= 65) {
			printf("B\n");
		}
		else if (a + b >= 50) {
			printf("C\n");
		}
		else if (a + b >= 30) {
			if (c >= 50) {
				printf("C\n");
			}
			else {
				printf("D\n");
			}
		}
		else if(a + b < 30){
			printf("F\n");
		}
	}
	return 0;
}


Measured memory_bytes: 2680
#include <iostream>
#include <stdio.h>

#include <vector>
#include <cctype>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <string>

using namespace std;


int main()
{
    int n, m;
    long long k;

    cin >> n >> m >> k;

    vector<long long> a(n);

    vector<long long> b(m);

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

    for (int i = 0; i < m; i++)   cin >> b[i];
    

    //aとbの先頭を比較して、小さいほうを引いていく。
    //Kから引いて行って、残っている最小よりもKが小さくなったらカウント終了
    //上の考え方はよくなかった
    //abの組み合わせを求める問題と読み換えるのが正解
    
    int count = 0;
   
    vector<long long> suma(n + 1);
    vector<long long> sumb(m + 1);
    
    suma[0] = 0;
    sumb[0] = 0;

    for (int i = 1; i <= n; i++) suma[i] = a[i-1]+suma[i - 1];
    for (int i = 1; i <= m; i++) sumb[i] = b[i-1]+sumb[i - 1];
    
    int i = 0;
    int begin = m;
    int count1 = 0;
    while (i <= n) {
        
        for (int j = begin; j >= 0; j--) {
            if (k >= suma[i] + sumb[j]) {
                count1 = i + j;
                begin = j;
                break;
            }
        }

        if (count < count1) count = count1;
        i++;
    }
    
    
    
    /*
    for (int i = 0; i < n + 1; i++) {

        int count1 = 0;

        for (int j = m; j >= 0;j--) {
            if (k>=suma[i]+sumb[j]) {
                count1 = i + j;
                break;
            }
        }
        if (count<count1) count = count1;

    }
    */

    std::cout << count << endl;   

    return 0;
}

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

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

    long long ans = 1;
    for (int i = 0; i < N; i++) {
        long long T;
        cin >> T;
        ans = ans / __gcd(ans, T) * T;
    }
    cout << ans << endl;
}

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

int main() {
  string s;
  int k;
  cin >> s;
  cin >> k;
  set<string> t;
  for (int i = 1; i <= k; i++) {
    for (int j = 0; j < s.size() - i + 1; j++) {
      string tmp = s.substr(j, i);
      t.insert(tmp);
    }
  }
  string ans;
  int cnt = 0;
  for (auto i = t.begin(); i != t.end(); i++) {
    cnt++;
    if (cnt == k) {
      ans = *i;
    }
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 1664
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define fi first
#define se second
#define pb push_back
#define eb emplace_back
#define sz(x) (int)(x).size()
using namespace std;
using ll = long long;
using P = pair<int, int>;
using vi = vector<int>;
using vc = vector<char>;
using vb = vector<bool>;
using vs = vector<string>;
using vll = vector<long long>;
using vp = vector<pair<int, int>>;
using vvi = vector<vector<int>>;
using vvc = vector<vector<char>>;
using vvll = vector<vector<long long>>;
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 (b<a) {a=b; return 1;} return 0;}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    
    int a, b, c, d;
    cin >> a >> b >> c >> d;
    int t_death = (a + d - 1) / d;
    int a_death = (c + b - 1) / b;
    if (t_death >= a_death) cout << "Yes" << endl;
    else cout << "No" << endl;
}

Measured memory_bytes: 3648
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<(n) ;i++)
#define pb push_back
#define all(v) (v).begin(),(v).end()
#define fi first
#define se second
#define sz(x) ((int)(x).size())
using ll=long long;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
#define MOD  1000000007
const ll INF=1e18;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b){ a = b; return 1; } return 0; }



int main(int argc, char const *argv[]) {
  int a[3][3],n;
  rep(i,3)rep(j,3) cin >> a[i][j];
  cin >> n;

  rep(i,n){
    int x; cin >> x;
    rep(i,3)rep(j,3) if(a[i][j]==x)a[i][j]=-1;
  }

  rep(i,3){
    if(a[i][0]==-1 && a[i][1]==-1 && a[i][2]==-1){
      cout << "Yes" << endl;
      return 0;
    }
  }
  rep(i,3){
    if(a[0][i]==-1 && a[1][i]==-1 && a[2][i]==-1){
      cout << "Yes" << endl;
      return 0;
    }
  }

  if(a[0][0]==-1 && a[1][1]==-1 && a[2][2]==-1 ){
    cout << "Yes" << endl;
    return 0;
  }
  if(a[0][2]==-1 && a[1][1]==-1 && a[2][0]==-1 ){
    cout << "Yes" << endl;
    return 0;
  }

  cout << "No" << endl;
  return 0;
}


Measured memory_bytes: 3636
#include <bits/stdc++.h>
#define GET_MACRO(_1,_2,_3,_4,_5,_6,_7,_8,NAME,...) NAME
#define pr(...) cerr<< GET_MACRO(__VA_ARGS__,pr8,pr7,pr6,pr5,pr4,pr3,pr2,pr1)(__VA_ARGS__) <<endl
#define pr1(a) (#a)<<"="<<(a)<<" "
#define pr2(a,b) pr1(a)<<pr1(b)
#define pr3(a,b,c) pr1(a)<<pr2(b,c)
#define pr4(a,b,c,d) pr1(a)<<pr3(b,c,d)
#define pr5(a,b,c,d,e) pr1(a)<<pr4(b,c,d,e)
#define pr6(a,b,c,d,e,f) pr1(a)<<pr5(b,c,d,e,f)
#define pr7(a,b,c,d,e,f,g) pr1(a)<<pr6(b,c,d,e,f,g)
#define pr8(a,b,c,d,e,f,g,h) pr1(a)<<pr7(b,c,d,e,f,g,h)
#define prArr(a) {cerr<<(#a)<<"={";int i=0;for(auto t:(a))cerr<<(i++?", ":"")<<t;cerr<<"}"<<endl;}
using namespace std;
using Int = long long;
using _int = int;
using ll = long long;
using Double = long double;
const Int INF = (1LL<<60)+1e9; // ~ 1.15 * 1e18
const Int mod = (1e9)+7;
const Double EPS = 1e-8;
const Double PI = 6.0 * asin((Double)0.5);
using P = pair<Int,Int>;
template<class T> T Max(T &a,T b){return a=max(a,b);}
template<class T> T Min(T &a,T b){return a=min(a,b);}
template<class T1, class T2> ostream& operator<<(ostream& o,pair<T1,T2> p){return o<<"("<<p.first<<","<<p.second<<")";}
template<class T1, class T2, class T3> ostream& operator<<(ostream& o,tuple<T1,T2,T3> t){
  return o<<"("<<get<0>(t)<<","<<get<1>(t)<<","<<get<2>(t)<<")";}
template<class T1, class T2> istream& operator>>(istream& i,pair<T1,T2> &p){return i>>p.first>>p.second;}
template<class T> ostream& operator<<(ostream& o,vector<T> a){Int i=0;for(T t:a)o<<(i++?" ":"")<<t;return o;}
template<class T> istream& operator>>(istream& i,vector<T> &a){for(T &t:a)i>>t;return i;}
//INSERT ABOVE HERE


signed main(){
  srand((unsigned)time(NULL));
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  cout << fixed << setprecision(12);

  int A, B;
  cin>>A>>B;
  int ans = max(0, A - 2 * B);
  cout<<ans<<endl;

  return 0;
}


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

int main(){
    int a,b,n;
    cin>>a>>b;
    int ans;
    for(n=1;n<1000;n++){
        if((n*(n+1)-2*a)==((n+1)*(n+2)-2*b)){cout<<n*(n+1)/2-a<<endl; break;}
    }
    return 0;
}


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

using namespace std;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  string s;
  cin >> s;
  if (s == "AAA" || s == "BBB")
    cout << "No" << '\n';
  else
    cout << "Yes" << '\n';
  return 0;
}

Measured memory_bytes: 3632
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  char c;
  cin >> c;
  
  string A="abcdefghijklmnopqrstuvwxyz";
  
  for(int i=0;i<25;i++){
     if(A.at(i)==c)cout << A.at(i+1);   
  }
} 

Measured memory_bytes: 256
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

var sc = bufio.NewScanner(os.Stdin)

func nextInt() int {
	var i int
	if sc.Scan() {
		if num, err := strconv.Atoi(sc.Text()); err == nil {
			i = num
		}
	}
	return i
}

func main() {
	sc.Split(bufio.ScanWords)
	// [y][x]
	var card = map[int]map[int]int{
		1: map[int]int{},
		2: map[int]int{},
		3: map[int]int{},
	}
	var result = map[int]map[int]bool{
		1: map[int]bool{},
		2: map[int]bool{},
		3: map[int]bool{},
	}
	for i := 0; i < 3; i++ {
		card[1][i+1] = nextInt()
	}
	for i := 0; i < 3; i++ {
		card[2][i+1] = nextInt()
	}
	for i := 0; i < 3; i++ {
		card[3][i+1] = nextInt()
	}

	nums := nextInt()
	for i := 0; i < nums; i++ {
		num := nextInt()
		for y := 0; y < 3; y++ {
			for x := 0; x < 3; x++ {
				if card[x+1][y+1] == num {
					result[x+1][y+1] = true
				}
			}
		}
	}

	for y := 0; y < 3; y++ {
		var ok int
		for x := 0; x < 3; x++ {
			if result[x+1][y+1] == true {
				ok++
			}
		}
		if ok == 3 {
			fmt.Println("Yes")
			return
		}
	}
	for x := 0; x < 3; x++ {
		var ok int
		for y := 0; y < 3; y++ {
			if result[x+1][y+1] == true {
				ok++
			}
		}
		if ok == 3 {
			fmt.Println("Yes")
			return
		}
	}

	if result[1][1] == true && result[2][2] == true && result[3][3] {
		fmt.Println("Yes")
		return
	}
	if result[1][3] == true && result[2][2] == true && result[3][1] {
		fmt.Println("Yes")
		return
	}
	fmt.Println("No")
}


Measured memory_bytes: 1776
#include<bits/stdc++.h>
using namespace std;
typedef pair<int, int> pii;
typedef pair<pii, pii> piiii;
const int N = 1 << 18 | 10;
int n, s;
piiii f[N];
inline piiii& operator+=(piiii &u, pii v) {
	if (v == u.first) return u;
	if (v.first > u.first.first) u.second = u.first, u.first = v;
	else if (v.first > u.second.first) u.second = v;
	return u;
}
inline piiii& operator+=(piiii &u, piiii v) {
	return (u += v.first) += v.second;
}
int main() {
	scanf("%d", &n); s = 1 << n;
	for (int i = 0; i < s; ++i) scanf("%d", &f[i].first.first), f[i].first.second = i;
	for (int i = 1, ans = 0; i < s; ++i) {
		for (int j = 0; j < n; ++j) if (i >> j & 1) f[i] += f[i ^ (1 << j)];
		printf("%d\n", ans = max(ans, f[i].first.first + f[i].second.first));
	}
	return 0;
}

Measured memory_bytes: 7168
#include <iostream>
#include <vector>
#include <algorithm>
#include <utility>
#include <string>
#include <queue>
#include <stack>

using namespace std;

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

const ll mod = 1000000007;

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

  string s;
  cin >> s;

  if (s[2] == s[3] && s[4] == s[5]) {
    cout << "Yes" << endl;
  }
  else {
    cout << "No" << endl;
  }

  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main(){
  int n,a,i,t,kotae=0;
  cin>>n;
  for(i=0;i<n;i++){
    cin>>a;
    for(t=0;t==0;){
      if(a%2==0){
        kotae++;
        a/=2;
      }else{
        t++;
      }
    }
  }
  cout<<kotae;
}
        
      

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimization_level 3
using ll = long long;
constexpr ll INF = 1'010'000'000'000'000'017LL;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(v) v.begin(), v.end()

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

    // if (sqrt(a)+sqrt(b)<sqrt(c))
    // {
    // 	cout<<"Yes";
    // } else
    // {
    // 	cout<<"No";
    // }
    ll left = 4 * a * b;
    ll right = c * c + a * a + b * b - (2 * a * c) - (2 * b * c) + (2 * a * b);
    // cout << right;
    // cout << left << endl;
    // cout << right << endl;

    if(left < right && a + b < c) {
        cout << "Yes";
    } else {
        cout << "No";
    }
}


Measured memory_bytes: 256
#!/usr/bin/env ruby
# -*- coding: utf-8 -*-
    
if __FILE__ == $0
  while line = STDIN.gets
    tokens = line.chomp!.split.map!(&:to_i)
    a, b, c = tokens[0], tokens[1], tokens[2]
  
    while a > b || b > c do
      if a > b
        a, b = b, a
      end
      if b > c
        b, c = c, b
      end
    end
    puts "#{a} #{b} #{c}"
  end
end

Measured memory_bytes: 8572
#include <bits/stdc++.h>
typedef long long int ll;
typedef unsigned long long ull;
typedef long double ld;
#define F first
#define S second
#define pb push_back
#define mp make_pair
#define pll pair<ll,ll>
#define pii pair<int,int>
#define len(s) s.length()
#define all(v) v.begin(),v.end()
const ll INF = INT_MAX;
const int N = 2e5 + 5;
const ll mod = 1000000007 ;
using namespace std;

int main() {


	ios_base::sync_with_stdio(false);
	cin.tie(NULL), cout.tie(NULL);


	ll tc = 1;
	// cin >> tc;
	while (tc--) {

		ll n, m, l, r;
		ll i, j;
		ll x, y;
		ll k;

		cin >> n;

		string ans;

		while (n > 0) {

			ans = char('a' + (n % 26 - 1 + 26) % 26) + ans;

			if (n % 26 == 0) n /= 26, n--;
			else
				n /= 26;
		}


		cout << ans << endl;

	}
}


// 010000

Measured memory_bytes: 3640
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
typedef unsigned long long ull;
const ull MOD = 1000000007;
const int MAX_N = 100000;
ull fact[MAX_N + 1];
int main(){
	vector<ull> ans;
	fact[0] = 0;
	fact[1] = 1;
	for (int i = 2; i < MAX_N + 1; i++){
		fact[i] = (fact[i - 1] * i) % MOD;
	}
	while (1){
		int N, R;
		ull num = 0;
		cin >> N;
		if (N == 0) break;
		ans.push_back(0);
		vector<int> word(N);
		for (int i = 0; i < N; i++) word[i] = i;
		word.push_back(0);
		cin >> R;
		vector<int> s(2*R+1, 0);
		for (int i = 0; i < R; i++){
			cin >> s[i] >> s[i+R];
			s[i]--; s[i+R]--;
			word[s[i]] ^= word[s[i+R]];
			word[s[i+R]] ^= word[s[i]];
			word[s[i]] ^= word[s[i+R]];
		}
		sort(s.begin(), s.end());
		s.erase(unique(s.begin(), s.end()), s.end());
		s.push_back(N);
		for (int i = 0, R = s.size() - 1; i < R; i++){
			ull tmp = fact[N - s[i] - 1], tmp2 = 0;
			tmp *= word[s[i]];
			tmp = tmp % MOD;
			for (int j = i; j < R; j++){
				word[s[j]] -= (word[s[j]] > word[s[i]] ? 1 : 0);
				if (s[j] + 1 != s[j + 1]){
					word[s[j] + 1] -= (word[s[j] + 1] > word[s[i]] ? 1 : 0);
				}
			}
			for (int j = s[i] + 1; j < s[i + 1]; j++){
				tmp2 += fact[N - j - 1];
				tmp2 = tmp2 % MOD;
			}
			for (int j = i + 1; j < R; j++){
				word[s[j]] -= (word[s[j]] > word[s[i] + 1] ? s[i+1] - s[i] - 1 : 0);
				if (s[j] + 1 != s[j + 1]){
					word[s[j] + 1] -= (word[s[j] + 1] > word[s[i] + 1] ? s[i+1] - s[i] - 1 : 0);
				}
			}
			tmp2 *= word[s[i] + 1] % MOD;
			tmp += tmp2;
			tmp += *(ans.end() - 1);
			*(ans.end() - 1) = tmp % MOD;
		}
	}
	for (int i = 0, l = ans.size(); i < l; i++){
		cout << ans[i] << endl;
	}
	return 0;
}

Measured memory_bytes: 2780
#include<stdio.h>
#include<math.h>
 
int main(void) {
    unsigned long long int a, b;
    scanf("%lld %lld", &a, &b);

    /* F(A, B) = F(0, A-1) XOR F(0, B)の
       F(0, A-1)を出す */
    a--;

    /* ％4は、実験してみると4つづつで周期的になっている
       0から順にXORしていったときの結果
       0000
       0001
       0011
       0000
       0100
       0001
       0111
       0000
       1000
       0001
       1011
       0000
       1100
       0001
       1111
       0000
    */

  /* XORは1が偶数のときに0になる
     数をひとつずつ増やしていくと最下位ビットは
     0, 1, 0, 1...と交互になる
     4つ増やしたところで1が偶数(2つ)になるので
     XORすると0になり、周期が4となる */
     
  /* 0~aまで各ビットの1の個数を数えると
　   最下位ビット以外は偶数個、最下位ビットのみ1が奇数個
　   なので1になる */
    if (a % 4 == 1) a = 1;

  /* 上で+1したものをXORするので1 XOR a
     これは1 OR aや1 + aと等価 */
    else if (a % 4 == 2) a = a + 1;
  
  /* 最下位ビット以外の1の個数は偶数個、
     最下位ビットも1が偶数個になるので、0になる */
    else if (a % 4 == 3) a = 0;
  
  // bも同様にする
    if (b % 4 == 1) b = 1;
    else if (b % 4 == 2) b = b + 1;
    else if (b % 4 == 3) b = 0;
  
  /* F(0, a-1)とF(0, b)が求まったので、
     F(0, A-1) XOR F(0, B)をして答え */
    printf("%lld\n", a^b);
    return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
#include <boost/range/irange.hpp>
#include <boost/range/adaptors.hpp>

using namespace std;
using boost::adaptors::reversed;
using boost::irange;
using uint = unsigned int;
using ll = long long int;
using ull = unsigned long long int;


inline bool _check(ll h, ll w, vector<vector<bool>> & map, ll H, ll W){
    return h >= 0 && h < H && w >= 0 && w < W && map.at(h).at(w);
}


inline bool check_adjacent(ll h, ll w, vector<vector<bool>> & map, ll H, ll W){
    return !map.at(h).at(w) || _check(h-1, w, map, H, W) || _check(h+1, w, map, H, W) || _check(h, w-1, map, H, W) || _check(h, w+1, map, H, W);
}


int main() {
    ll H, W;
    cin >> H >> W;
    vector<vector<bool>> map(H, vector<bool>(W));
    for (auto &&h: irange(0LL, H)){
        for (auto &&w: irange(0LL, W)){
            char c;
            cin >> c;
            // true means black
            map.at(h).at(w) = (c=='#');
        }
    }
    bool ret = true;
    for (auto &&h: irange(0LL, H)){
        for (auto &&w: irange(0LL, W)){
            ret &= check_adjacent(h, w, map, H, W);
        }
    }
    cout << (ret ? "Yes" : "No") << endl;

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
struct proccess
{
  string name;
  int time;
  //int excutetime;
  int id;
};

bool cmp(proccess a, proccess b)
{
  return a.id < b.id;
}

// void excute(vector<proccess> &prs, int t)
// {
//   for (proccess &p : prs)
//   {
//     p.excutetime += t;
//   }
// }

int main()
{
  int n, q;
  cin >> n >> q;
  vector<proccess> prs(n);
  // sort(prs.begin(), prs.end(), cmp);
  for (proccess &pp : prs)
  {
    static int i = 0;
    cin >> pp.name >> pp.time;
    //pp.excutetime = 0;
    pp.id = i;
    i++;
  }
  queue<proccess> qu;

  for (proccess p : prs)
  {
    qu.push(p);
  }

  //stringstream result;

  while (not qu.empty())
  {
    static int elaps = 0;
    proccess p = qu.front();
    qu.pop();

    if (p.time > q)
    {
      p.time -= q;

      elaps += q;
      //excute(prs, q);

      //lout << "DEBUG " << p.name << "," << p.time << "," << p.excutetime << endl;
      qu.push(p);
    }
    else
    {
      elaps += p.time;
      //p.excutetime += p.time;
      //excute(prs, p.time);
      // for (proccess p_ : prs)
      // {
      //   if (p_.name == p.name)
      //   {
      //     ext = p_.excutetime;
      //     break;
      //   }
      // }

      ///int ext = prs[lower_bound(prs.begin(), prs.end(), p, cmp)->id].excutetime;
      cout << p.name << " " << elaps << endl;
      //printf("%s %d/n", p.name.c_str(), elaps);
    }
  }
    return 0;
}



Measured memory_bytes: 6772
fun main(args: Array<String>) {
    var (a, b, k) = readLongList()

    a -= k
    if (a < 0) {
        b += a
        a = 0
    }
    if (b < 0) b = 0
    println("$a $b")
}


// Tools
fun readString() = readLine()!!
fun readInt() = readLine()!!.toInt()
fun readLong() = readLine()!!.toLong()
fun readStringList() = readLine()!!.split(" ")
fun readIntList() = readLine()!!.split(" ").map(String::toInt)
fun readLongList() = readLine()!!.split(" ").map(String::toLong)

Measured memory_bytes: 38032
// #pragma GCC optimize("O3")
#include<bits/stdc++.h>
using namespace std;
 
#define ll long long
#define pb push_back
#define N 1000000007
#define N2 998244353
#define Nmax 100001
#define INF (ll)1e18
#define pll pair<ll,ll>
#define pii pair<ll,ll>
#define mp make_pair
#define fi first
#define se second
#define rep(i,n) rep2(i,0,n)
#define rep2(i,m,n) for(ll i=m;i<(n);i++)
#define get(n) ll (n); scanf("%lld",&(n));
#define get2(n,k) ll (n),(k); scanf("%lld%lld",&(n),&(k));
#define get3(n,m,k) ll (n),(m),(k); scanf("%lld%lld%lld",&(n),&(m),&(k));
#define gets(s) string (s); cin >> (s);
#define ALL(c) (c).begin(),(c).end()
#define fill_nums(A,n) vector<ll> A((n)); for(ll i=0;i<n;i++) scanf("%lld",&A[i]);
#define fill_edges(adj,m) for(ll i=0;i<m;i++) {ll a, b; scanf("%lld %lld",&a,&b); adj[a-1].pb(b-1); adj[b-1].pb(a-1);}
#define fill_direct(adj,m) for(ll i=0;i<m;i++) {ll a, b; scanf("%lld %lld",&a,&b); adj[a-1].pb(b-1);}
#define pi 3.1415926535897

ll extended_gcd(ll a, ll b, ll &x, ll &y) {
    if(a==0) {
        x = 0;
        y = 1;
        return b;
    }

    ll x1, y1;
    ll g = extended_gcd(b%a, a, x1, y1);

    x = y1-(b/a)*x1;
    y = x1;
    return g;
}

int main() {

    vector<ll> facts(1000001,1), invfacts(1000001,1);
    rep2(i,1,1000001) {
        facts[i] = (facts[i-1]*i)%N;
        ll x,y;
        extended_gcd(facts[i],N,x,y);
        invfacts[i] = x;
    }
    
    get2(x,y);
    if((x+y)%3) {
        printf("0\n");
        return 0;
    }

    ll a = 1+(x+y)/3;
    if(x>y) swap(x,y);

    ll c = x-a+1;
    if(c<0 || c>a) {
        printf("0\n");
        return 0;
    }

    
    ll res = (((facts[a-1]*invfacts[c])%N)*invfacts[a-1-c])%N;
    printf("%lld\n", (N+res)%N);

    return 0;  
}

Measured memory_bytes: 15872
// C.

#include <iostream>
#include <sstream>
#include <algorithm>
#include <vector>
#include <deque>

using namespace std;

typedef long long LL;

LL solve(int n, vector<LL> &a) {
	int m = (n / 4) * 2 + (n % 2);
	vector<LL> x(a.begin(), a.begin() + m);
	vector<LL> y(a.begin() + m, a.end());
	deque<LL> d;
	int xi = 0, yi = y.size() - 1;
	while (xi < (int)x.size() || yi >= 0) {
		if (xi < (int)x.size()) {
			d.push_back(x[xi++]);
		}
		if (yi >= 0) {
			d.push_front(y[yi--]);
		}
		if (yi >= 0) {
			d.push_back(y[yi--]);
		}
		if (xi < (int)x.size()) {
			d.push_front(x[xi++]);
		}
	}
	vector<LL> b;
	for (LL z : d) {
		b.push_back(z);
	}
	LL ans = 0;
	for (int i = 1; i < n; ++i) {
		ans += abs(b[i] - b[i - 1]);
	}
	return ans;
}

int main(int argc, char *argv[]) {
	int n;
	cin >> n;
	vector<LL> a(n);
	for (int i = 0; i < n; ++i) {
		cin >> a[i];
	}
	sort(a.begin(), a.end());
	LL ans = solve(n, a);
	sort(a.rbegin(), a.rend());
	ans = max(ans, solve(n, a));
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 4440
package main

import (
	"fmt"
)

func COM(n, k int64) int64 {
	r := int64(1)
	for i := int64(0); i < k; i++ {
		r = ModMul(r, n-i)
		r = ModDiv(r, i+1)
	}

	return r
}

const (
	MOD = 1000000000 + 7
)

func ModAdd(a, b int64) int64 {
	return (a + b) % MOD
}

func ModMul(a, b int64) int64 {
	return a * b % MOD
}

func ModSub(a, b int64) int64 {
	r := (a%MOD - b%MOD) % MOD
	if r < 0 {
		r += MOD
	}
	return r
}

func ModDiv(a, b int64) int64 {
	return a % MOD * ModInv(b) % MOD
}

func ModPow(a, n int64) int64 {
	var r int64 = 1
	for n > 0 {
		if n&1 == 1 {
			r = r * a % MOD
		}
		a = a * a % MOD
		n >>= 1
	}
	return r
}

func ModInv(a int64) int64 {
	var b, u, v int64 = MOD, 1, 0
	for b > 0 {
		t := a / b
		a -= t * b
		a, b = b, a
		u -= t * v
		u, v = v, u
	}
	u %= MOD
	if u < 0 {
		u += MOD
	}
	return u
}

type Q struct {
	value int
	index int
	A, B  int
}

type QS []*Q

func (p QS) Len() int           { return len(p) }
func (p QS) Less(i, j int) bool { return p[i].value > p[j].value }
func (pq QS) Swap(i, j int) {
	pq[i], pq[j] = pq[j], pq[i]
	pq[i].index = i
	pq[j].index = j
}

func (pq *QS) Push(x interface{}) {
	n := len(*pq)
	item := x.(*Q)
	item.index = n
	*pq = append(*pq, item)
}

func (pq *QS) Pop() interface{} {
	old := *pq
	n := len(old)
	item := old[n-1]
	old[n-1] = nil  // avoid memory leak
	item.index = -1 // for safety
	*pq = old[0 : n-1]
	return item
}

func FactoredPrimeNumber(num int) map[int]int {
	m := map[int]int{}
	return factor(m, num, 2)
}

func factor(result map[int]int, num, pnum int) map[int]int {
	if pnum*pnum > num {
		if num != 1 {
			result[num] += 1
		}
		return result
	}

	if num%pnum == 0 {
		num /= pnum
		result[pnum]++
	} else {
		pnum++
	}
	return factor(result, num, pnum)
}

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

func LCM(a, b int64) int64 {
	return a * b / GCD(a, b)
}

type P struct {
	X, T, Cond int
}

type PS []*P

func (p PS) Len() int           { return len(p) }
func (p PS) Less(i, j int) bool { return p[i].T < p[j].T }
func (pq PS) Swap(i, j int) {
	pq[i], pq[j] = pq[j], pq[i]
}

func main() {
	var A, B int
	fmt.Scanf("%d %d\n", &A, &B)

	if A <= 5 {
		fmt.Println(0)
	} else if A >= 13 {
		fmt.Println(B)
	} else {
		fmt.Println(B / 2)
	}

}

type IntHeap []int

func (h IntHeap) Len() int           { return len(h) }
func (h IntHeap) Less(i, j int) bool { return h[i] < h[j] }
func (h IntHeap) Swap(i, j int)      { h[i], h[j] = h[j], h[i] }

func (h *IntHeap) Push(x interface{}) {
	// Push and Pop use pointer receivers because they modify the slice's length,
	// not just its contents.
	*h = append(*h, x.(int))
}

func (h *IntHeap) Pop() interface{} {
	old := *h
	n := len(old)
	x := old[n-1]
	*h = old[0 : n-1]
	return x
}


Measured memory_bytes: 512
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
    ll x;
    scanf("%lld",&x);
    for (int i = -1000; i < 1000; i++){
        for (int j = -1000; j < 1000; j++){
            ll ans = (ll)i*i*i*i*i - (ll)j*j*j*j*j;
            if (ans == x){
                printf("%d %d\n",i,j);
                return 0;
            }
        }
    }


}


Measured memory_bytes: 3828
#include <bits/stdc++.h>
using namespace std;
//long long int i,j,k,n,m,a,b,c,d,p,q,r,l,t=1;
//long long int sum,counted,ans;
void fast()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
}
void sample()
{
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
}
long long int* read(long long int n)
{
    long long int* arr=new long long int[n];

    for(int i=0;i<n;i++)
        cin>>arr[i];

    return arr;
}

void solve()
{
    long long int n,i,j,k,ans,m,o;

    //cin>>n;

    //long long int ar[n+1];

    //long long int* ar=read(n);

    string s;
    cin>>s;

    n=s.length();

    if(s[n-1]!='s')
    {
        cout<<s<<"s"<<endl;
        return;
    }

    cout<<s<<"es"<<endl;
    



    return;
}





int main()
{
    fast();
    sample();
    long long int i, j, k, n, m, a, b, c, d, p, q, r, l, t = 1;
    long long int sum, count = 0, ans = 0;

    //cin >> t;
    while (t--)
    {
        solve();

    }

    return 0;
}


Measured memory_bytes: 3584
#include<bits/stdc++.h>
using namespace std;
using lli = long long;
#define rep(i,n) for(int i=0;i<n;i++)
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; }

const lli mod = 1e9+7;
template< int mod >
struct ModInt {
  int x;

  ModInt() : x(0) {}

  ModInt(int64_t y) : x(y >= 0 ? y % mod : (mod - (-y) % mod) % mod) {}

  ModInt &operator+=(const ModInt &p) {
    if((x += p.x) >= mod) x -= mod;
    return *this;
  }

  ModInt &operator-=(const ModInt &p) {
    if((x += mod - p.x) >= mod) x -= mod;
    return *this;
  }

  ModInt &operator*=(const ModInt &p) {
    x = (int) (1LL * x * p.x % mod);
    return *this;
  }

  ModInt &operator/=(const ModInt &p) {
    *this *= p.inverse();
    return *this;
  }

  ModInt operator-() const { return ModInt(-x); }

  ModInt operator+(const ModInt &p) const { return ModInt(*this) += p; }

  ModInt operator-(const ModInt &p) const { return ModInt(*this) -= p; }

  ModInt operator*(const ModInt &p) const { return ModInt(*this) *= p; }

  ModInt operator/(const ModInt &p) const { return ModInt(*this) /= p; }

  bool operator==(const ModInt &p) const { return x == p.x; }

  bool operator!=(const ModInt &p) const { return x != p.x; }

  ModInt inverse() const {
    int a = x, b = mod, u = 1, v = 0, t;
    while(b > 0) {
      t = a / b;
      swap(a -= t * b, b);
      swap(u -= t * v, v);
    }
    return ModInt(u);
  }

  ModInt pow(int64_t n) const {
    ModInt ret(1), mul(x);
    while(n > 0) {
      if(n & 1) ret *= mul;
      mul *= mul;
      n >>= 1;
    }
    return ret;
  }

  friend ostream &operator<<(ostream &os, const ModInt &p) {
    return os << p.x;
  }

  friend istream &operator>>(istream &is, ModInt &a) {
    int64_t t;
    is >> t;
    a = ModInt< mod >(t);
    return (is);
  }

  static int get_mod() { return mod; }
};

using modint = ModInt< mod >;

lli n;
string s, t;

int main(void){
    cin >> n >> s >> t;
    vector<modint> x(n);
    for(int i = 0; i < n; i++){
        if(i == 0){
            if(s[i] == t[i]) x[i] =3LL;
            else x[i] = 6LL;
            if(s[i] != t[i]){
                i++;
                x[i] = x[i-1];
            }
        }else{
            if(s[i-1] == t[i-1]){
                x[i] = modint(2LL)*x[i-1];
                if(s[i] != t[i]){
                    i++;
                    x[i] = x[i-1];
                }
            }else{
                if(s[i] == t[i]){
                    x[i] = x[i-1];
                }else{
                    x[i] = modint(3LL)*x[i-1];
                    i++;
                    x[i] = x[i-1];
                }
            }
        }
    }
    cout << x[n-1] << endl;
    return 0;
}


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

int main() {
    int n, d;
    cin >> n >>  d;
    vector<vector<int>> x(n, vector<int>(d));
    rep(i, n) {
        for (int j = 0; j < d; j++)
            cin >> x.at(i).at(j);
    }

    int ans = 0;
    for (int i = 0; i < n-1; i++) {
        for (int j = i+1; j < n; j++) {
            double sum = 0.0;
            for (int k = 0; k < d; k++) {
                double d = 0.0;
                d = abs(x.at(i).at(k) - x.at(j).at(k));
                d *= d;
                sum += d;
            }
            sum = sqrt(sum);
            int sum_i = (int)sum;
            if ((double)sum_i == sum)
                ans++;
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#!/usr/bin/env python3


class FenwickTree(object):

    def __init__(self, num_elems):
        self.num_elems = num_elems
        self.data = [0 for _ in range(num_elems)]

    def sum_to(self, end):
        s = 0
        i = end - 1
        while i >= 0:
            s += self.data[i]
            i = (i & (i + 1)) - 1
        return s

    def sum_range(self, start, end):
        return self.sum_to(end) - self.sum_to(start)

    def add(self, idx, x):
        while idx < self.num_elems:
            self.data[idx] += x
            idx |= idx + 1


def main():
    n, q = map(int, input().split())
    ft = FenwickTree(n)
    for _ in range(q):
        c, x, y = map(int, input().split())
        if c == 0:
            ft.add(x - 1, y)
        elif c == 1:
            print(ft.sum_range(x - 1, y))


if __name__ == '__main__':
    main()

Measured memory_bytes: 9960
using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using System.Linq;

namespace contest_Csharp
{
    class Program
    {


        static void Main(string[] args)
        {
            var sw = new System.IO.StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
            Console.SetOut(sw);

            var vals = Console.ReadLine().Split(' ').
                Select(x => int.Parse(x)).ToList();
            var N = vals[0];
            var K = vals[1];
            var A = Console.ReadLine().Split(' ').
                Select(x => long.Parse(x)).ToList();
            A.Sort();
            var Po = A.Where(x => x > 0).Reverse().ToList();
            var Ne = A.Where(x => x <= 0).ToList();

            var mod = (long)1e9 + 7;
            long ans = 1;

            if (A[N - 1] <= 0 && K % 2 == 1 || K==N)
            {
                for (int s = 0; s < K; s++)
                {
                    ans = (ans * A[N - 1 - s]) % mod;
                }
                ans = (mod + ans) % mod;
            }
            else
            {
                int i = -1, p = 0, m = 0;
                while (i < K)
                {
                    i++;
                    if (i >= K)
                        break;

                    

                    if (Ne.Count() > m + 1 && i + 1 < K &&
                        (Po.Count() <= p+1|| Ne[m] * Ne[m + 1] >= Po[p] * Po[p + 1]))
                    {

                        ans = (-ans * Ne[m]) % mod;
                        ans = (-ans * Ne[m + 1]) % mod;
                        i++;
                        if (i >= K)
                            break;
                        m += 2;
                    }
                    else
                    {

                        ans = (ans * Po[p]) % mod;
                        p++;

                    }



                }
            }





            Console.WriteLine(ans);
            Console.Out.Flush();
        }





    }
}




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

using namespace std;

int a[100001];
int b[100001]; 
map <int, int> u;

int main () {
	int n;
	cin >> n;
	for (int i = 1;i <= n;i ++) {
		cin >> a[i];
		b[i] = a[i];
	}
	sort (b + 1, b + n + 1);                                 
	for (int i = 1;i <= n;i ++) u[b[i]] = i % 2;
	int ans = 0;
	for (int i = 1;i <= n;i ++) ans += abs (i % 2 - u[a[i]]);
	cout << ans / 2;
	return 0;
}

Measured memory_bytes: 5760
N, M, C = map(int, input().split())
B = list(map(int, input().split()))

ans = 0

for i in range(N):
    A = list(map(int, input().split()))
    sum = C
    for a, b in zip(A, B):
        sum += a * b
    if sum > 0:
        ans += 1

print(ans)

Measured memory_bytes: 3060
using static System.Math;
using System;

public class Hello
{
    public static void Main()
    {
        string[] line = Console.ReadLine().Trim().Split(' ');
        var a = long.Parse(line[0]);
        var b = long.Parse(line[1]);
        var k = long.Parse(line[2]);
        getAns(a, b, k);
    }
    static void getAns(long a, long b, long k)
    {
        long taka, aoki;
        if (a >= k) { taka = a - k; aoki = b; }
        else { taka = 0; aoki = Max(0, a + b - k); }
        Console.WriteLine("{0} {1}", taka, aoki);
    }
}


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

int main() {
  vector<string>  S = {"Sunny", "Cloudy", "Rainy"};

  string s; cin >> s;
  if(s==S[0]) cout << S[1] << endl;
  if(s==S[1]) cout << S[2] << endl;
  if(s==S[2]) cout << S[0] << endl;
}

Measured memory_bytes: 3472
N, T = map(int, input().split())
c = []
t = []
for i in range(N):
    tmp = [0, 0]
    tmp[0], tmp[1] = map(int, input().split())
    c.append(tmp[0])
    t.append(tmp[1])
index = -1
cost = 1000
for i in range (N):
    if t[i] <= T and c[i] <= cost:
        index = i
        cost = c[i]
if index == -1:
    print('TLE')
else:
    print(cost)

Measured memory_bytes: 3064