akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <array>
#include <algorithm>
#include <vector>
#include <bitset>
#include <set>
#include <unordered_set>
#include <cmath>
#include <complex>
#include <deque>
#include <iterator>
#include <numeric>
#include <map>
#include <unordered_map>
#include <queue>
#include <stack>
#include <string>
#include <tuple>
#include <utility>
#include <limits>
#include <iomanip>
#include <functional>
#include <cassert>
using namespace std;

using ll=long long;
template<class T> using V = vector<T>;
template<class T, class U> using P = pair<T, U>;
using vll = V<ll>;
using vvll = V<vll>;
#define rep(i, k, n) for (ll i=k; i<(ll)n; ++i)
#define REP(i, n) rep(i, 0, n)
#define ALL(v) v.begin(),v.end()
template < class T > inline bool chmax(T& a, T b) {if (a < b) { a=b; return true; } return false; }
template < class T > inline bool chmin(T& a, T b) {if (a > b) { a=b; return true; } return false; }
#define DEBUG_VLL(vec) REP(sz, vec.size()) std::cerr<<vec[sz]<<(sz==vec.size()-1?'\n':' ');

const long long MOD = 1000000007;
const long long HIGHINF = (long long)1e18;
const int INF = (int)1e9;

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n; cin >> n;
    V< P<ll, ll> > xy(n);
    for (int i = 0; i < n; i++) cin >> xy[i].first >> xy[i].second;

    ll mod2 = -1;
    for (int i = 0; i < n; i++) {
        if (mod2 == -1) mod2 = abs(xy[i].first + xy[i].second) % 2;
        else {
            if (mod2 != abs(xy[i].first + xy[i].second) % 2) {
                cout << -1 << '\n';
                return 0;
            }
        }
    }

    int m = (mod2 == 0 ? 32 : 31);
    cout << m << '\n';
    if (mod2 == 0) cout << "1 ";
    for (int i = 0; i < 31; i++) cout << (1 << i) << (i == 30 ? '\n' : ' ');

    ll const minusd = (1LL << 31) - 1;
    for (int i = 0; i < n; i++) {
        string ans;
        if (mod2 == 0) {
            ans.push_back('D');
            xy[i].second++;
        }
        ll u = (xy[i].first + xy[i].second + minusd) >> 1;
        ll v = (xy[i].first - xy[i].second + minusd) >> 1;
        set<int> uset, vset;
        for (int i = 0; i < 31; i++) if ((u >> i) & 1) uset.insert(i);
        for (int i = 0; i < 31; i++) if ((v >> i) & 1) vset.insert(i);
        for (int i = 0; i < 31; i++) {
            if (uset.find(i) != uset.end()) {
                if (vset.find(i) != vset.end()) {
                    ans.push_back('R');
                } else {
                    ans.push_back('U');
                }
            } else {
                if (vset.find(i) != vset.end()) {
                    ans.push_back('D');
                } else {
                    ans.push_back('L');
                }
            }
        }
        cout << ans << '\n';
    }
    return 0;
}


Measured memory_bytes: 384
a = int(input())
b = int(input())
c = int(input())
x = int(input())
res = 0
for i in range(a+1):
  for j in range(b+1):
    for k in range(c+1):
      total = i*500 + j*100 + k*50
      if total == x:
        res += 1
print(res)


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

typedef long long ll;
#define pa pair<int, int> 
#define pal pair<long long, long long>
#define pad pair<double, double>
#define pb push_back
#define mp make_pair
#define VIN(v) for(int64_t i=0;i<(v).size();i++){cin >> (v).at(i);}

typedef vector<bool> bvec;
typedef vector<int> ivec;
typedef vector<long long> lvec;
typedef vector<double> dvec;
typedef vector<pa> pvec;

typedef vector< vector<bool> > bmat;
typedef vector< vector<int> > imat;
typedef vector<string> svec;
typedef vector< vector<string> > smat;

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll n;
    cin >> n;
    lvec a(n);
    for (size_t i = 0; i < n; i++) cin >> a[i];
    sort(a.begin(), a.end());
    string ans="YES";
    for (size_t i = 1; i < n; i++)
    {
        if(a[i]==a[i-1]) {
            ans = "NO";
            break;
        }
   }
   cout << ans << endl;

}

Measured memory_bytes: 1920
#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cmath>

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

using namespace std;
typedef long long ll;
const ll N=12e4;

int a[4];
ll n;

int main()
{
//	freopen("a.in","r",stdin);
//	freopen("a.out","w",stdout);
	scanf("%lld",&n);
	ll op=(int)sqrt(n);
	ll ans=0;
	fo(i,1,op)if(n%i==0){
		ll lef=n/i;
		if(i!=1)if((n/(i-1))*i==n)ans=ans+i-1;
		if(i!=lef)if((n/(lef-1))*lef==n)ans=ans+lef-1;
	}
	cout<<ans;
}

Measured memory_bytes: 256
n, q = map(int, input().split())
s = list(input())
tmp = [0] * n
ans = []
for i in range(1, n):
    if s[i - 1] == "A" and s[i] == "C":
        tmp[i] += tmp[i - 1] + 1
    else:
        tmp[i] = tmp[i - 1]
for i in range(q):
    l, r = map(int, input().split())
    ans.append(tmp[r - 1] - tmp[l - 1])

for i in range(len(ans)):
    print(ans[i])


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

using namespace std;

const int maxd = 110;
const int maxn = 1e4+10;
const int mod = 1e9+7;

string s;
int d;
long long int dp[maxn][maxd];

long long int absm(long long int x, long long int m){
	return ((x % m) + m) % m;
}

int main(){
	cin >> s;
	cin >> d;
	s.insert(s.begin(), '0');
	long long int sum = 0;
	dp[0][0] = 1;
	for (int i = 1; i < s.length(); i++){
		for (int j = 0; j < d; j++){
			for (int k = 0; k < 10; k++){
				dp[i][j] = (dp[i][j] + dp[i-1][absm(j-k, d)]) % mod;
			}
		}
		
		for (int j = s[i]-'0' + 1; j < 10; j++){
			dp[i][(sum+j)%d] = absm(dp[i][(sum+j)%d]-1, mod);
		}
		sum += s[i]-'0';
	}

	cout << absm(dp[s.length()-1][0]-1, mod) << endl;
	return 0;
}


Measured memory_bytes: 8832
n, k = gets.chomp.split
ds = gets.chomp.split.map(&:to_i)
memo = [true] * 10
for d in ds
  memo[d] = false
end

n = n.to_i
while true
  s = n.to_s
  ok = true
  s.chars.each{|c|
    idx = c.to_i
    if not memo[idx]
      ok = false
    end
  }
  if ok
    puts s
    break
  end
  n += 1
end


Measured memory_bytes: 1788
#include "bits/stdc++.h"
using namespace std;

int main() {
	
	int a, b;
	cin >> a >> b;
	string grid[a];
	for (int i=0; i<a; i++) cin >> grid[i];
	string sub[b];
	for (int i=0; i<b; i++) cin >> sub[i];
	
	int topl = a - b + 1;
	for (int i=0; i<topl; i++) {
		for (int j=0; j<topl; j++) {
			bool can = true;
			for (int x=0; x<b; x++) {
				for (int y=0; y<b; y++) {
					if (sub[x][y] != grid[i+x][j+y]) can = false;
				}
			}
			if (can) {
				cout << "Yes" << endl;
				exit(0);
			}
		}
	}
	cout << "No" << endl;
	
}


Measured memory_bytes: 256
/**
*    created: 01.07.2020 22:40:20
**/
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
// #include <boost/multiprecision/cpp_int.hpp>
// using bint = boost::multiprecision::cpp_int;
using namespace std;
#define int long long
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define pcnt(bit) __builtin_popcountll(bit)
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 int MOD = 1000000007;
// const int MOD = 998244353;
const long double pi = acos(-1.0);
const int INF = 1LL << 60;

signed main() {

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

    int x, a, b;
    cin >> x >> a >> b;
    cout << (x-a)%b << endl;
    return 0;
}

Measured memory_bytes: 3572
while 1:
    N,M=map(int,input().split())
    if not N and not M:break
    s=0
    t=[]
    for _ in range(N):
        a,b=map(int,input().split())
        s+=a*b
        t.extend([(b,a)])
    for i in sorted(t)[::-1]:
        if i[1]<=M:
            s-=i[0]*i[1]
            M-=i[1]
        elif 0<M<i[1]:
            s-=M*i[0]
            M=0
            break
    print(s)



Measured memory_bytes: 6756
#include<cstdio>
#include<iostream>
#include<string>
#include<algorithm>
#include<stdio.h>
#include<locale.h>
#include<set>
#include<stack>
#include<queue>
#include<math.h>
using namespace std;

int main()
{
 int N,a[100002]={-1,};
 scanf("%d",&N);
 for(int i=1;i<=N;i++)
 {
	scanf("%d",&a[i]);
 }
 sort(a,a+N+1,greater<>());
 int ans=0,nw=1;
 for(int i=0;i<N;i++)
 {
	if(a[i]==a[i+1]){nw++;}
	else{if(nw%2!=0){ans++;} nw=1;}
 }
 printf("%d\n",ans);
} 



Measured memory_bytes: 4208
# coding: UTF-8
import sys
#sys.setrecursionlimit(n)
import heapq
import re
import bisect
import random
import math
import itertools
from collections import defaultdict, deque
from copy import deepcopy
from decimal import *


readl= lambda: list(map(int, sys.stdin.readline().split()))
readt= lambda: tuple(map(int, sys.stdin.readline().split()))
read = lambda: sys.stdin.readline().rstrip()
readi = lambda: int(read())
readmi = lambda: map(int, sys.stdin.readline().split())
readms = lambda: map(str, sys.stdin.readline().split())

n = readi()
p = readl()
pp = []
for i in range(n):
    pp.append((p[i], i))
t = n // 2
pp.sort()
q = defaultdict(int)
for i in range(n):
    if t > i:
        q[pp[i][1]] = pp[t][0]
    else:
        q[pp[i][1]] = pp[t - 1][0]
for i in range(n):
    print(q[i])

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

int main() {
    int n, tmp, node;
    cin >> n;
    int ver[n+1][n+1] = {};
    for (int i=1; i<=n; i++) {
        cin >> tmp;
        cin >> tmp;
        for (int j=0; j<tmp; j++) {
            cin >> node;
            ver[i][node] = 1;
        }
    }
    for (int i=1; i<=n; i++) {
        for (int j=1; j<n; j++) {
            cout << ver[i][j] << " ";
        }
        cout << ver[i][n] << endl;
    }
}


Measured memory_bytes: 3120
#include<stdio.h>
int main(){
	int n,x,b=0,sum=0;
	scanf("%d",&n);
	for(int i=0;i<n;i++){
		scanf("%d",&x);
		if(b<x) b=x;
		sum+=x;
	}
	if(2*b<sum) printf("Yes");
	else printf("No");
	return 0;
}

Measured memory_bytes: 1700
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define F first
#define S second
#define pii pair<int, int>
#define pli pair<ll, int>
#define pil pair<int, ll>
#define pll pair<ll, ll>
#define eb emplace_back
#define all(v) v.begin(), v.end()
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rep3(i, l, n) for (int i = l; i < (n); ++i)
#define sz(v) (int)v.size()
#define endl '\n'
const int inf = 1000000007;
const ll INF = 1e18;
// int mod = 998244353;
int mod = 1000000007;
#define abs(x) (x >= 0 ? x : -(x))
#define lb(v, x) (int)(lower_bound(all(v), x) - v.begin())
#define ub(v, x) (int)(upper_bound(all(v), x) - v.begin())
template<typename T1, typename T2> inline bool chmin(T1 &a, T2 b) { if (a > b) { a = b; return 1; } return 0; }
template<typename T1, typename T2> inline bool chmax(T1 &a, T2 b) { if (a < b) { a = b; return 1; } return 0; }
ll gcd(ll a, ll b) { if (b == 0) return a; return gcd(b, a % b); }
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
template<typename T, typename U> T pow_(T a, U b) { return b ? pow_(a * a, b / 2) * (b % 2 ? a : 1) : 1; }
ll modpow(ll a, ll b, ll _mod) { return b ? modpow(a * a % _mod, b / 2, _mod) * (b % 2 ? a : 1) % _mod : 1; }
template<class T, class U> ostream& operator << (ostream& os, const pair<T, U>& p) { os << p.F << " " << p.S; return os; }
template<class T> ostream& operator << (ostream& os, const vector<T>& vec) { rep(i, sz(vec)) { if (i) os << " "; os << vec[i]; } return os; }
template<typename T> inline istream& operator >> (istream& is, vector<T>& v) { rep(j, sz(v)) is >> v[j]; return is; }
template<class T, class T2> inline void add(T &a, T2 b) { a += b; if (a >= mod) a -= mod; }


void solve();

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cout << fixed << setprecision(11);
  int T;
  T = 1;
  while (T--) solve();
}

void solve() {
  vector<string> s(3);
  cin >> s;
  int now = 0;
  while (1) {
    if (sz(s[now]) == 0) {
      cout << (char)('A' + now) << endl;
      return;
    }
    int nxt = s[now][0] - 'a';
    s[now] = s[now].substr(1, sz(s[now]) - 1);
    now = nxt;
  }
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
using namespace std;
typedef long long ll;
int N, K;
ll mod = 1e9+7;
vector<ll> fct(2001, 1);
vector<ll> invfct(2001, 1);

ll mod_pow(ll n, ll p) {
    if(p==0) return 1;
    ll res = mod_pow(n*n % mod, p / 2);
    if(p%2==1) res = res * n % mod;
    return res;
}

ll comb(ll a, ll b){
    if(a==0 && b==0) return 1;
    if(a<b || a < 0) return 0;
    ll tmp = invfct[a-b] * invfct[b] % mod;
    return tmp * fct[a] % mod;
}

int main(void){
    // Your code here!
    cin >> N >> K;
    
    
    fct[0] = 1;
    invfct[0] = 1;
    for(ll i = 0; i < 2000; i++){
        fct[i+1] = (fct[i] * (i+1)) % mod;
        invfct[i+1] = (invfct[i] * mod_pow(i+1, mod-2)) % mod;
    }
    

    ll ans = 0;
    for(int i = 1; i <= K; i++){
        ans = comb(K-1, i-1) * comb(N-K+1, i) % mod;
        cout << ans << endl;
    }
}


Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main()
{
  int n,t,tt,ts,te,i,res=0;
  cin >> n >> t;
  cin >> ts;
  te=ts+t;
  for(i=1;i<n;i++){
    cin >> tt;
    if(tt>te){
      res+=te-ts;
      ts=tt;
    }
    te=tt+t;
  }
  res+=te-ts;
  cout << res << endl;
  return 0;
}

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

const int maxn = 200010;
int n, s1[maxn], s2[maxn];

int main() {
    cin >> n;
    for (int i = 1, l, r; i <= n; i++) {
        cin >> l >> r;
        l += 100001, r += 100001;
        s1[r]++, s2[l]++;
    }
    s1[100001]++, s2[100001]++;
    for (int i = 1; i <= 200005; i++) {
        s1[i] += s1[i - 1];
    }
    for (int i = 200005; i; i--) {
        s2[i] += s2[i + 1];
    }
    long long ans = 0;
    for (int i = 1; i <= 200005; i++) {
        ans += min(s1[i], s2[i + 1]);
    }
    cout << ans * 2 << endl;
    return 0;
}

Measured memory_bytes: 1920
#include<stdio.h>
int main()
{
int a,b,d;
  d=0;
  scanf("%d %d",&a,&b);
int c[a];
for(int j=0;j<a;++j)
  {scanf("%d ",&c[j]);
   if(c[j]>=b) d=d+1;
  }
printf("%d",d);
return 0;
}

Measured memory_bytes: 512
#include <bits/stdc++.h>
#define INF (1<<30)
#define MOD 1000000007
#define l_ength size
using ll = long long;
using namespace std;

int main(){
	string s;
	cin >> s;
	int topping = 0;
	for( char c : s ){
		if( c == 'o' ){
			++topping;
		}
	}
	cout << 700 + topping*100 << endl;
	return 0;
}

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

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

    int x = floor(n / 1.08);
    // if(x*1.08==n) cout<<x<<endl;
    // else cout<<":("<<endl; 

    bool flg = false;
    int tmp;
    for(int i=-2;i<=2;i++){
        tmp = floor((x+i)*1.08);
        if(tmp==n){
            // cout<<"ans:"<<x+i<<","<<tmp<<endl;
            cout<<x+i<<endl;
            flg = true;
            break;
        }
        // cout<<i<<":"<<x+i<<","<<tmp<<endl;
    }

    if(flg==false){
        cout<<":("<<endl;
    }


}

Measured memory_bytes: 256
#include<iostream>
#include<math.h>
#include<vector>
#include<algorithm>
#include<numeric>
#include<map>
using namespace std;

int main(){
    int N,A[100010];
    cin>>N;
    for(int i=0;i<N;++i)cin>>A[i];

    long long dp[100010][2];

    dp[2][0]=max(A[0]+A[1],-A[0]-A[1]);
    dp[2][1]=max(A[0]-A[1],-A[0]+A[1]);

    for(int n=3;n<=N;++n){
        dp[n][0]=max(dp[n-1][0]+A[n-1],dp[n-1][1]-A[n-1]);
        dp[n][1]=max(dp[n-1][0]-A[n-1],dp[n-1][1]+A[n-1]);
    }
    cout<<dp[N][0]<<endl;
    return 0;
}

Measured memory_bytes: 2176
#include<bits/stdc++.h>
#define mo 1000000007
#define pi 3.1415926535898 
using namespace std;
long long read(){
    long long xx=0,flagg=1;
    char ch=getchar();
    while((ch<'0'||ch>'9')&&ch!='-')
        ch=getchar();
    if(ch=='-'){
        flagg=-1;
        ch=getchar();
    }
    while(ch>='0'&&ch<='9'){
        xx=xx*10+ch-'0';
        ch=getchar();
    }
    return xx*flagg;
}
void pus(long long xx,long long flagg){
    if(xx<0){
        putchar('-');
        xx=-xx;
    }
    if(xx>=10)
        pus(xx/10,0);
    putchar(xx%10+'0');
    if(flagg==1)
        putchar(' ');
    if(flagg==2)
        putchar('\n');
    return;
}
long long ksm(long long u,long long v){
	long long o=1;
	while(v){
		if(v&1)
			o=o*u%mo;
		u=u*u%mo;
		v>>=1;
	}
	return o;
}
int n,i,j,f[200005],x,y;
int top,nex[400005],to[400005],fir[200005];
void lj(int u,int v){
	top++;
	nex[top]=fir[u];
	fir[u]=top;
	to[top]=v;
}
void ss(int u,int v){
	for(int top1=fir[v];top1;top1=nex[top1])
		if(to[top1]!=u){
			ss(v,to[top1]);
			f[v]^=(f[to[top1]]+1);
		}
}
int main(){
    //freopen(".in","r",stdin);
    //freopen(".out","w",stdout);
   	n=read();
   	for(i=1;i<n;i++){
   		x=read();y=read();
   		lj(x,y);
   		lj(y,x);
   	}
   	ss(1,1);
   	if(f[1]!=0)
   		printf("Alice\n");
	else
		printf("Bob\n");
    return 0;
}

Measured memory_bytes: 8320
#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; 
#define mp make_pair
#define endl '\n'
typedef long long ll;
 
const int INF=1e9+5;
const ll lim=(ll)3e16;
const int N=80+5;
const int mod=1e9+7;	
const ll oo=1e18+5;

//~ typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> ordered_set;

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

int main(){
	ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(0);
	ll n,m;
	cin>>n>>m;
	vector<ll> a(n);
	ll Lcm=1;
	for(ll& x:a) cin>>x;
	set<int> s;
	for(int i=0;i<n;++i){
		int cnt=0;
		ll num=a[i];
		while(num%2==0){
			num/=2;
			++cnt;
		}
		s.insert(cnt);
	}
	if((int)s.size()>1) return cout<<0,0;
	for(ll& x:a){
		x/=2;
		Lcm=lcm(Lcm,x);
	}
	ll ans=(m/Lcm);
	if(ans%2) cout<<ans/2+1;
	else cout<<ans/2;
	return 0;	
}


Measured memory_bytes: 1024
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<math.h>
#include<iomanip>
#include<set>
#include<numeric>
#include<cstring>
#include<cstdio>
#include<functional>
#include<bitset>
#include<limits.h>
#include<iterator>
#include<complex>
#include<stack>
using namespace std;
string s;

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

	vector<double> vDiv;
	for (int i = 0; i != n; i++) {
		double tmp = 0;
		cin >> tmp;
		if (tmp != 0) {
			double tmp2 = 1 / tmp;
			vDiv.push_back(tmp2);
		}
	}

	if (vDiv.size() != n) {
		return -1;
	}

	double bunbo = 0;

	for (int i = 0; i != n; i++) {
		bunbo += vDiv[i];
	}

	double ans = 1.0 / bunbo;

	cout << setprecision(10) << ans << endl;

	return 0;
}

Measured memory_bytes: 256
n = int(input()[-1])

if n == 2:   print("hon")
elif n == 4: print("hon")
elif n == 5: print("hon")
elif n == 7: print("hon")
elif n == 9: print("hon")
elif n == 0: print("pon")
elif n == 1: print("pon")
elif n == 6: print("pon")
elif n == 8: print("pon")
else:        print("bon")


Measured memory_bytes: 9128
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
#define RI(a) scanf("%d",&a)
#define RII(a,b) scanf("%d%d",&a,&b)
#define RIII(a,b,c) scanf("%d%d%d",&a,&b,&c)
#define IOS ios_base::sync_with_stdio(0); cin.tie(0)
#define ALL(a) a.begin(),a.end()
#define F first
#define S second
#define REP(i,n) for(int i=0;i<(n);i++)
#define pb push_back
#ifdef leowang
#define debug(...) do{\
	fprintf(stderr,"%s - %d : (%s) = ",__PRETTY_FUNCTION__,__LINE__,#__VA_ARGS__);\
	_DO(__VA_ARGS__);\
}while(0)
template<typename I> void _DO(I&&x){cerr<<x<<endl;}
template<typename I,typename...T> void _DO(I&&x,T&&...tail){cerr<<x<<", ";_DO(tail...);}
#else
#define debug(...)
#endif
//}}}
const ll maxn=100005;
const ll maxlg=__lg(maxn)+2;
const ll INF64=8000000000000000000LL;
const int INF=2000000000;

ll n,x,y;
ll a[maxn];
bool check(int t){
	if(abs(a[n-2]-a[n-1])>=t) return 1;
	if(abs(a[n-1]-y)>=t) return 1;
	return 0;
}
int main()
{
	cin>>n>>x>>y;
	
	REP(i,n) cin>>a[i];
	if(n==1){
		cout<<abs(a[0]-y);
		return 0;
	}
	
	ll l=0,r=1000000005;
	
	while(l!=r-1){
		int mid=(l+r)/2;
		if(check(mid)) l=mid;
		else r=mid;
	}
	cout<<l;
	return 0;
}












Measured memory_bytes: 256
#include <iostream>
#include <vector>
using namespace std;
int fib(int x, vector<int>& f)
{
if (f[x-1] == -1) f[x-1] = fib(x-1, f);
if (f[x-2] == -1) f[x-2] = fib(x-2, f);
return f[x-1] + f[x-2];
}

int main()
{
int x; cin >> x;
vector<int> f(x+1, -1); f[0] = f[1] = 1;
cout << fib(x, f) << endl;
return 0;
}


Measured memory_bytes: 3096
// header {{{
// #define NDEBUG
#include <bits/stdc++.h>
using namespace std;

// {U}{INT,LONG,LLONG}_{MAX,MIN}
#define ALPHABET    (26)
#define INF         INT_MAX
#define MOD         (1000000007LL)
#define EPS         (1e-10)
#define EQ(a, b)        (abs((a)-(b)) < EPS)
#define CILING(a, b)    (((a)+(b)-1LL)/(b))

template<class T>
using PIT = pair<int, T>;
template<class T>
using PTI = pair<T, int>;
using PII = pair<int, int>;
using PDI = pair<double, int>;
using LL  = long long;
using ULL = unsigned long long;
// }}}

int main() {
    LL k;cin >> k;
    cout << 50 << endl;
    if(k < 50LL){
        for(LL i=0;i<50LL;i++){
            cout << (i < k ? 50 : 0) << " ";
        }
        return 0;
    }
    for(LL i=0;i<50LL;i++){
        if(i < k%50LL){
            cout << (50LL+k/50LL) << " ";
        }else{
            cout << (50LL+k/50LL-1LL-i) << " ";
        }
    }
    return 0;
}


Measured memory_bytes: 256
num,k,q = map(int,input().split())

arr = [0]*num


for i in range(q):
    a = int(input())
    arr[a-1] +=1

arr = [i-(q-k) for i in arr]

for i in range(len(arr)):
    if arr[i] > 0:
        print("Yes")
    else:
        print("No")
    

Measured memory_bytes: 52568
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.IO;
using System.Text;
using System.Globalization;
using System.Diagnostics;



class Myon
{
    public Myon() { }
    public static int Main()
    {
        new Myon().calc();
        return 0;
    }


    Scanner cin;

    void calc()
    {
        cin = new Scanner();
        int N = cin.nextInt();
        int[] A = cin.ArrayInt(N);
        if(A[0] != 0)
        {
            Console.WriteLine(-1); return;
        }
        for (int i = 1; i < N; i++)
        {
            if(A[i] > A[i - 1] + 1)
            {

                Console.WriteLine(-1); return;
            }
        }

        long ans = 0;
        for (int i = 0; i < N; i++)
        {
            if (i != N - 1 && A[i + 1] == A[i] + 1) continue;
            ans += A[i];
        }
        Console.WriteLine(ans);
    }
}






class Scanner
{
    string[] s;
    int i;

    char[] cs = new char[] { ' ' };

    public Scanner()
    {
        s = new string[0];
        i = 0;
    }

    public string next()
    {
        if (i < s.Length) return s[i++];
        string st = Console.ReadLine();
        while (st == "") st = Console.ReadLine();
        s = st.Split(cs, StringSplitOptions.RemoveEmptyEntries);
        if (s.Length == 0) return next();
        i = 0;
        return s[i++];
    }

    public int nextInt()
    {
        return int.Parse(next());
    }
    public int[] ArrayInt(int N, int add = 0)
    {
        int[] Array = new int[N];
        for (int i = 0; i < N; i++)
        {
            Array[i] = nextInt() + add;
        }
        return Array;
    }

    public long nextLong()
    {
        return long.Parse(next());
    }

    public long[] ArrayLong(int N, long add = 0)
    {
        long[] Array = new long[N];
        for (int i = 0; i < N; i++)
        {
            Array[i] = nextLong() + add;
        }
        return Array;
    }

    public double nextDouble()
    {
        return double.Parse(next());
    }


    public double[] ArrayDouble(int N, double add = 0)
    {
        double[] Array = new double[N];
        for (int i = 0; i < N; i++)
        {
            Array[i] = nextDouble() + add;
        }
        return Array;
    }
}


Measured memory_bytes: 17864
def up(n)
  (10 ** (n+1) - 10 ** n) * (n+1) + count_fiz(n, n, 0, 1, 10)
end
def count_fiz(k, n, tmp, s, t)
  top = 10 ** k * t + tmp - 1
  btm = 10 ** k * s + tmp - 1 
  a =top/3  - btm/3 
  b =top/5  - btm/5
  c =top/15 - btm/15
  (a+b-c) * (3-n) + c * 4
end
def down(n, mod)
  ret = 10**n
  k = n
  while k >= 0
    9.times do
      t = 10 ** k * (n+1) + count_fiz(k, n, ret, 0, 1)
      if mod < t
        k -= 1
        break
      end
      ret += 10 ** k
      mod -= t
    end
  end
  [ret, mod]
end
num = gets.to_i - 1
n = 0
while (t = up(n)) < num
  n += 1
  num -= t
end
p, q = down(n, num)
puts (p..p+20).map{ |x| a = [[:Fizz][x%3], [:Buzz][x%5]] * ''; a == '' ? x : a }.join[q, 20]

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

struct Task {
	int a, b, c;
};

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
 	int n;
 	cin >> n;
 	vector<Task> t(n);
 	for (Task& tt : t) {
 		cin >> tt.a >> tt.b >> tt.c;
 	}
 	int dp[n + 1][3];
 	for (int i = 0; i < 3; i++) {
 		dp[0][i] = 0;
 	}
 	for (int i = 1; i <= n; i++) {
 		for (int j = 0; j < 3; j++) {
 			dp[i][j] = 0;
 			if (j != 0) {
 				dp[i][j] = max(dp[i][j], t[i - 1].a + dp[i - 1][0]);
 			} 
 			if (j != 1) {
 				dp[i][j] = max(dp[i][j], t[i - 1].b + dp[i - 1][1]);
 			}
 			if (j != 2) {
 				dp[i][j] = max(dp[i][j], t[i - 1].c + dp[i - 1][2]);
 			}
 		}
 	}
 	cout << max(dp[n][0], max(dp[n][1], dp[n][2]));
	return 0;
}

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

using namespace std;

int main(){
 
  while(1){
	vector<int> time(24*60*60,0);
    int n;
	cin >> n;

	if(n == 0)
	  break;
	
	for(int i = 0;i<n;i++){
	  int h,m,s;
	  
	  scanf("%d:%d:%d",&h,&m,&s);
	  time[h * (60*60) + m * 60 + s]++;
	  
	  scanf("%d:%d:%d",&h,&m,&s);
	  time[h * (60*60) + m * 60 + s]--;	  
	}

	int train = 0;
	int train_max = 0;
	
	for(int i = 0;i < 24*60*60;++i){
	  train += time[i];
	  train_max = max(train,train_max);
	  
	}

	cout << train_max << endl;
	
  }
  
  return 0;

}




Measured memory_bytes: 3488
# ['表面', '南面', '東面', '西面', '北面', '裏面']
dice = input().split()
com = [c for c in input()]

rolling = {
    'E': [3, 1, 0, 5, 4, 2],
    'W': [2, 1, 5, 0, 4, 3],
    'S': [4, 0, 2, 3, 5, 1],
    'N': [1, 5, 2, 3, 0, 4]
}

for c in com:
    dice = [dice[i] for i in rolling[c]]

print(dice[0])


Measured memory_bytes: 5568
#include<iostream>
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;
int main(){
	int n,mn,c[10000];
	while(cin>>n,n){
		mn=1<<30;
		rep(i,n)cin>>c[i];
		rep(i,n)rep(j,3){
			int clr=0,use=c[i];
			c[i]=j+1;
			for(int p=i,q=i,s=1;p>0||q<n-1;){
				while(p>0&&c[p]==c[p-1])p--,s++;
				while(q<n-1&&c[q]==c[q+1])q++,s++;
				if(s>3){
					clr+=s;
					if(c[--p]!=c[++q])break;
					s=2; continue;
				}
				break;
			}
			if(mn>n-clr)mn=n-clr; c[i]=use;
		}
		cout<<mn<<endl;
	}
	return 0;
}

Measured memory_bytes: 0
use std::io::Read;
use std::cmp::Ordering;

#[derive(Eq,PartialEq)]
struct Magic {
    atk: usize,
    mp: usize,
}

impl Ord for Magic {
    fn cmp(&self, other: &Self) -> Ordering {
        self.partial_cmp(other).unwrap()
    }
}

impl PartialOrd for Magic {
    fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
        match (self.atk as f64 / self.mp as f64).partial_cmp(&(other.atk as f64 / other.mp as f64)) {
            Some(Ordering::Greater) => Some(Ordering::Less),
            Some(Ordering::Less) => Some(Ordering::Greater),
            _ => Some(self.atk.cmp(&other.atk)),
        }
    }
}

fn main() {
    let mut buf = String::new();
    let stdin = std::io::stdin();
    stdin.lock().read_to_string(&mut buf).unwrap();
    let mut iter = buf.split_whitespace();
    let hp = iter.next().unwrap().parse::<usize>().unwrap();
    let n = iter.next().unwrap().parse::<usize>().unwrap();

    let mut magics: Vec<Magic> = Vec::with_capacity(n);
    for _ in 0..n {
        let a = iter.next().unwrap().parse::<usize>().unwrap();
        let b = iter.next().unwrap().parse::<usize>().unwrap();
        magics.push( Magic { atk: a, mp: b } );
    }

    magics.sort();

    // dp[hp] min_mp
    let mut dp: Vec<usize> = vec![0; hp+1];
    for i in 1..hp+1 {
        let mut min_mp = std::usize::MAX;
        for m in &magics {
            let consume_mp = if i > m.atk { dp[i-m.atk] + m.mp } else { m.mp };
            min_mp = std::cmp::min(consume_mp, min_mp);
        }
        dp[i] = min_mp;
    }

    println!("{}", dp[hp]);
}


Measured memory_bytes: 4352
import java.io.*;

class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader br =
			new BufferedReader(new InputStreamReader(System.in));

			String[] line = br.readLine().split(" ");
			int a = Integer.parseInt(line[0]);
			int b = Integer.parseInt(line[1]);

			int area = a * b;
			int areaLength = ( a + b ) * 2;

			System.out.println(area + " " + areaLength);
	}
}

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

#define for_(i,a,b) for(int i=a;i<b;++i)
#define ALL(a) a.begin(),a.end()
#define INIT(a,b) memset(a,b,sizeof(a))
using lint = long long int;

int H, W, K;
string c[10];
string d[10];

int count() {
    int ret = 0;
    for_(i,0,H) for_(j,0,W) if (d[i][j] == '#') ++ret;
    return ret;
}

int main() {
    cin >> H >> W >> K;
    for_(i,0,H) cin >> c[i];

    int ans = 0;
    for_(A,0,1<<H) for_(B,0,1<<W) {
        for_(i,0,H) d[i] = c[i];

        for_(i,0,H) {
            if (A >> i & 1) {
                for_(j,0,W) d[i][j] = '$';
            }
        }

        for_(j,0,W) {
            if (B >> j & 1) {
                for_(i,0,H) d[i][j] = '$';
            }
        }

        if (count() == K) ++ans;
    }

    cout << ans << endl;
}

Measured memory_bytes: 3596
#include <bits/stdc++.h>
#define LIM 1<<17
/// TONI BO$$ was here
/// #MLC

using namespace std;
char BUF[LIM];
int poz;

inline char getChar(){
    poz++;
    if(poz>=LIM){
    	fread(BUF,LIM,1,stdin);
    	poz=0;
    }
    return BUF[poz];
}

inline int getNr(){
    int r=0, semn=1;
    char ch=getChar();
    while(isdigit(ch)==0 && ch!='-') ch=getChar();
    if(ch=='-'){
        semn=-1;
        ch=getChar();
    }
    while(isdigit(ch)!=0){
        r=r*10+semn*(ch-'0');
        ch=getChar();
    }
    return r;
}

int main()
{
    int n;
    long long x,sum;
    //freopen(".in","r",stdin);
    //freopen(".out","w",stdout);
    scanf("%d",&n);
    while(n--)
    {
        scanf("%lld",&x);
        if(x%2==1)
        {
            printf("first");
            exit(0);
        }
    }
    printf("second");

    return 0;
}


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



int main() {

	int n,x,y; cin>>n>>x>>y;
	if(x>y){
		swap(x,y);
	}
	x--;y--;
	vector<int>ans(n,0);
	
	for(int i = 0 ; i< n ; i++){
		for(int j= i+1 ; j<n ; j++){
			int dis = min(j-i ,abs(j-y)+1+abs(i-x));
			
			ans[dis]++;
		}
	
	}

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

	int l ; cin>>l;
	
}

Measured memory_bytes: 256
#include<iostream>
#include<iomanip>
#include<math.h>
#include<algorithm>
#include<string>
#include<vector>
#include<queue>
#include<set>
#include<map>
#include<tuple>
#include<complex>
#define REP(i, N) for(ll i = 0; i < N; ++i)
#define FOR(i, a, b) for(ll i = a; i < b; ++i)
#define ALL(a) (a).begin(),(a).end()
#define pb push_back
#define INF (long long)1000000000
#define MOD 1000000007
#define EPS (long double) 1e-8
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> P;
int dh[4] = {1, 0, -1, 0};
int dw[4] = {0, 1, 0, -1};

using namespace std;

int main() {
	while(1) {
		int n, m;
		cin>>n>>m;
		if(n == 0 && m == 0) break;
		vector<int> d(n);
		vector<P> p(n);
		REP(i, n) cin>>d[i]>>p[i].first;
		REP(i, n) p[i].second = i;
		sort(ALL(p), greater<P>());
		int res = 0;
		REP(i, n) {
			if(d[p[i].second] <= m) {
				m -= d[p[i].second];
			} else {
				res += (d[p[i].second] - m) * p[i].first;
				m = 0;
			}
		}
		cout<<res<<endl;
	}
}

Measured memory_bytes: 3216
#include<stdio.h>
main(){
  int n=10,i,j,a[10000],temp;
  for(i=0;i<n;i++){
    scanf("%d",&a[i]);
  }

  for(i=n-1;i>0;i--){
    for(j=0;j<i;j++){
      if(a[j]<a[j+1]){
	temp=a[j];
	a[j]=a[j+1];
	a[j+1]=temp;
      }
    }
  }

  for(i=0;i<3;i++){
    printf("%d\n",a[i]);
  }

  return(0);
}

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

#define rep2(x,fr,to) for(int (x)=(fr);(x)<(to);(x)++)
#define rep(x,to) for(int (x)=0;(x)<(to);(x)++)
#define repr(x,fr,to) for(int (x)=(fr);(x)>=(to);(x)--)
#define all(c) (c).begin(),(c).end()
#define sz(v) (int)(v).size()

using namespace std;
typedef long long ll; typedef vector<int> VI; typedef pair<int, int> pii;
const int mod = (int)1e9 +7;

int main()
{
	
	//cin.tie(0); ios_base::sync_with_stdio(false);
	int n;
	cin >>n;
	VI a(n);
	rep(i,n) cin >>a[i];
	
	VI sm(2,0);
	rep(i,n) sm[a[i]%2]++;
	if(sm[1]%2==0) puts("YES");
	else puts("NO");
	return 0;

}


Measured memory_bytes: 640
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
	int n;cin>>n;
	int a[210];
	int ans=0;
	int mi=1000000;
	for(int i=0;i<n;i++){
		cin>>a[i];
		int c=0;
		while(a[i]%2==0){
			a[i]/=2;
			c++;
		}
		mi=min(c,mi);
	}
	cout<<mi<<endl;
	return 0;
}


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

int main(){
    string s;
    cin >> s;
    
    int n = s.size();
    int length_of_longest_ACGT = 0;
    
    //先頭
    for (int i = 0; i < n; i++){
        //i番目以降
        int temp = 0;
        for (int j = i; j < n; j++){
            if (s[j] == 'A' || s[j] == 'C' || s[j] == 'G' || s[j] == 'T') temp++;
            else break;
        }
        
        length_of_longest_ACGT = max(length_of_longest_ACGT, temp);
    }
    cout << length_of_longest_ACGT << endl;
}

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

using namespace std;

typedef long long ll;
typedef vector<ll> vl;
typedef long double ld;
typedef vector<ld> vd;
typedef bool bl;
typedef vector<bl> vb;
typedef unordered_map<ll,unordered_map<ll,ll>> graph;

const ll e5 = 1 << 20;
const ll mod = 1000000007;
const ll e3 = 1 << 13;
const ll INF = 1ll << 60;

ll n,x;
ll p[e5];
ll ans;

ll gcd(ll a,ll b){
  while(a != 0){
    b %= a;
    swap(a,b);
  }
  return b;
}

int main(){
  cin >> n >> x;
  for(ll i = 0;i < n;i++) cin >> p[i];
  for(ll i = 0;i < n;i++) p[i] = abs(p[i]-x);
  ans = p[0];
  for(ll i = 0;i < n;i++) ans = gcd(ans,p[i]);
  cout << ans << endl;

}


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

typedef long long ll;
typedef unsigned long long ull;
const double pi = acos(-1);
const int maxn = 2e6 + 10;
const double eps = 1e-8;
const ll mod = 1e9 + 7;
const ull base = 131;
const ull mod1 = 1e9 + 9;
const ull mod2 = 1610612741;

queue<char> a[4];
char s[110];

int main()
{
    for (int i = 1; i <= 3; ++i)
    {
        scanf("%s", s+1);
        for (int j = 1; s[j]; ++j)
            a[i].push(s[j]);
    }
    char ch = a[1].front();
    a[1].pop();
    while (1)
    {
        if (ch == 'a')
        {
            if (a[1].empty())
            {
                printf("A\n");
                return 0;
            }
            ch = a[1].front(), a[1].pop();
        }
        else if (ch == 'b') 
        {
            if (a[2].empty())
            {
                printf("B\n");
                return 0;
            }
            ch = a[2].front(), a[2].pop();
        }
        else
        {
            if (a[3].empty())
            {
                printf("C\n");
                return 0;
            }
            ch = a[3].front(), a[3].pop();
        } 
    }
	return 0;
}


Measured memory_bytes: 256
N, M = map(int, input().split())
L_lis = []
R_lis = []
for i in range(M):
  L, R = map(int, input().split())
  L_lis.append(L)
  R_lis.append(R)
new_L, new_R = max(L_lis), min(R_lis)
if new_L <= new_R:
  print(new_R - new_L + 1)
else:
  print(0)

Measured memory_bytes: 16804
n,k = map(int, input().split())
a = list(map(int, input().split()))

nums = [0]*n
nums[k-1] = sum(a[:k])
for i in range(k,n):
  nums[i] = nums[i-1] + a[i] - a[i-k]

for i in range(k,n):
  if nums[i-1] < nums[i]: print("Yes")
  else: print("No")

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

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

  int len = N.size();
  int E = len - 7;

  for (int i = 0; i < len; i++) {
    string Ni = N;
    Ni.erase(i, E);
    if (Ni == "keyence") {
      cout << "YES" << endl;
      return 0;
    }
  }

  cout << "NO" << endl;
}

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

#define dump(n) cout<<"# "<<#n<<'='<<(n)<<endl
#define repi(i,a,b) for(int i=int(a);i<int(b);i++)
#define peri(i,a,b) for(int i=int(b);i-->int(a);)
#define rep(i,n) repi(i,0,n)
#define per(i,n) peri(i,0,n)
#define all(c) begin(c),end(c)
#define mp make_pair
#define mt make_tuple

typedef unsigned int uint;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef vector<string> vs;

const int INF=1e9;
const int MOD=1e9+7;
const double EPS=1e-9;

template<typename T1,typename T2>
ostream& operator<<(ostream& os,const pair<T1,T2>& p){
	return os<<'('<<p.first<<','<<p.second<<')';
}
template<typename T>
ostream& operator<<(ostream& os,const vector<T>& a){
	os<<'[';
	rep(i,a.size()) os<<(i?" ":"")<<a[i];
	return os<<']';
}

bool ok(int w,const vi& xs,int sp)
{
	int n=xs.size();
	vi sum(n+1);
	rep(i,n) sum[i+1]=sum[i]+xs[i];
	
	vi dp(n+1); dp[0]=1;
	int l=0,r=0,cnt=0;
	rep(i,n){
		for(;l<i;cnt-=!!dp[l++]) if(sum[i+1]-sum[l]+(i-l)<=w) break;
		for(;r<i;cnt+=!!dp[r++]) if(sum[i+1]-sum[r]+(i-r)*sp<w) break;
		dp[i+1]=!!cnt;
	}
	
	int res=dp[n];
	for(int i=n;i--;){
		if(sum[n]-sum[i]+(n-i-1)>w) break;
		res|=dp[i];
	}
	return res;
}

int main()
{
	for(int w,n;cin>>w>>n && w|n;){
		vi xs(n);
		rep(i,n) cin>>xs[i];
		
		int lo=1,hi=w;
		while(lo<hi){
			int mi=(lo+hi)/2;
			if(ok(w,xs,mi))
				hi=mi;
			else
				lo=mi+1;
		}
		cout<<lo<<endl;
	}
}

Measured memory_bytes: 1772
import java.util.*;

class Main {
	public static void main (String[] args) {
		Scanner scanner = new Scanner(System.in);
		int K = scanner.nextInt();
		
		if (K%2 == 0) {
			int pair = K/2 * K/2;
			System.out.println(pair);
		} else {
			int pair = (K+1)/2 * (K-1)/2;
			System.out.println(pair);
		}
	}
}

Measured memory_bytes: 23636
#import <Foundation/Foundation.h>
typedef long long Int;
int main() {
	int n;
	Int A,B = LLONG_MAX;
	scanf("%d",&n);
	for(int i=0;i<n;i++){
		Int a,b;
		scanf("%lld %lld",&a,&b);
		if(b<B){
			B=b;
			A=a;
		}
	}
	printf("%lld\n",A+B);
}

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

using namespace std;

#define FOR(i, j, k) for(int i = j; i < k; ++i)
#define rep(i, j) FOR(i, 0, j)
#define repr(i, j) for(int i = j; i >= 0; --i)
#define INF (1 << 30)
#define MOD 1e9 + 7

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

int main() {
	int total = 0;
	int point;
	rep(i, 5) {
		scanf("%d", &point);
		total += (point >= 40) ? point : 40;
	}
	printf("%d\n", total / 5);
	return 0;
}

Measured memory_bytes: 3160
using System;
using System.Collections.Generic;
using System.Linq;
using static Constans;

public static class Constans
{
    public const long Mod = 998244353;
}

public struct ModInt
{
    public long Num;

    public ModInt(long num)
    {
        Num = num;
    }

    // x^n
    public static long Power(long x, long n)
    {
        long pow = 1;
        while (n > 0)
        {
            if (n % 2 == 0)
            {
                x *= x;
                x %= Mod;
                n /= 2;
            }
            else
            {
                pow *= x;
                pow %= Mod;
                n--;
            }
        }

        return pow;
    }

    public static ModInt GetInv(long f)
    {
        // フェルマーの小定理 a^(-1) = a^(mod-2)
        return new ModInt(Power(f, Mod - 2));
    }

    public ModInt GetInv()
    {
        return GetInv(Num);
    }

    public override string ToString()
    {
        return Num.ToString();
    }

    public static ModInt operator +(ModInt l, ModInt r)
    {
        l.Num += r.Num;
        if (l.Num >= Mod)
        {
            l.Num -= Mod;
        }
        return l;
    }

    public static ModInt operator -(ModInt l, ModInt r)
    {
        l.Num -= r.Num;
        if (l.Num < 0)
        {
            l.Num += Mod;
        }
        return l;
    }

    public static ModInt operator *(ModInt l, ModInt r)
    {
        return new ModInt(l.Num * r.Num % Mod);
    }

    public static implicit operator ModInt(long n)
    {
        n %= Mod;
        if (n < 0)
        {
            n += Mod;
        }
        return new ModInt(n);
    }
}

public class Solution
{
    public static void Main()
    {
        var N = int.Parse(Console.ReadLine());
        var D = Console.ReadLine().Split(' ').Select(long.Parse).ToArray();
        if (D[0] != 0)
        {
            Console.WriteLine(0);
            return;
        }

        var pattern = new ModInt(1);
        var count = new Dictionary<long, int>();
        foreach (var d in D)
        {
            if (!count.ContainsKey(d))
            {
                count[d] = 0;
            }
            count[d]++;
        }
        foreach (var d in D.Skip(1))
        {
            if (!count.ContainsKey(d - 1))
            {
                Console.WriteLine(0);
                return;
            }

            pattern *= count[d - 1];
        }

        Console.WriteLine(pattern);
    }
}

Measured memory_bytes: 29152
#include  <iostream>
#include  <algorithm>
#include  <climits>
#include  <string>

using namespace std;

#define rep(i, n) for(int i = 0; i < n; i++)
#define lrep(i, n, m) for(int i = n; i < m; i++)

typedef long long ll;
const int MAX = INT_MAX;

int main()
{	
	double r;
	cin >> r;
	cout << 2 * r * 3.14159 << endl;
}

Measured memory_bytes: 3780
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0; i < n; i++)
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N, M;
    cin >> N >> M;
    int ans = 0;
    vector<bool> B(N, false);
    vector<P> ab(M);
    REP(i, M){
        int a, b;
        cin >> a >> b;
        ab[i] = P(b, a);
    }
    sort(ab.begin(), ab.end());
    for (int i = 0; i < M; ++i) {
        bool ok = false;
        int a = ab[i].second;
        int b = ab[i].first;
        for (int j = a; j < b; ++j) {
            if(B[j]){
                ok = true;
                break;
            }
        }
        if(ok){
            continue;
        }else {
            B[b - 1] = true;
            ans++;
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 1792
function main(input) {
  input=input.trim();
  const a = parseInt(input.split(" ")[0], 10);
  const op = input.split(" ")[1];
  const b = parseInt(input.split(" ")[2], 10);
  if(op=="+"){
    console.log(a+b);
  }else{
    console.log(a-b);
  }


}



main(require('fs').readFileSync('/dev/stdin', 'utf8'));

Measured memory_bytes: 7372
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<iostream>
#include<string>
#include<stack>
#include<queue>
#include<vector>
#include<map>
#include<set>
#include<algorithm>
#include<numeric>

#define rep(n) for(int i=0;i<n;i++)
#define repp(j, n) for(int j=0;j<n;j++)
#define reppp(i, m, n) for(int i=m;i<=n;i++)
#define all(c) c.begin(), c.end()
#define rall(c) c.rbegin(), c.rend()
#define pb(x) push_back(x)
#define eb(x,y) emplace_back(x,y)
#define MOD 1000000007
#define MAX 1000000001
#define INF 1410065408
#define EPS 1e-9
#define DEBUG 0
#define ll long long
#define Pll pair<ll, ll>
#define Pii pair<int, int>
 
using namespace std;
struct edge{int from, to; ll cost;};

signed main(){
    ios::sync_with_stdio(0); cin.tie(0);
    ll n;
    cin >> n;
    vector<ll> a(n);
    rep(n) cin >> a[i];
    
    ll ans = pow(3LL, n);
    ll ret = 1;
    rep(n){
        if(a[i] % 2 == 0){
            ret *= 2;
        }
    }
    cout << (ans - ret);
}


Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<n+1;i++)
#define sort(A) sort(A.begin(),A.end())
#define reverse(A) reverse(A.begin(),A.end())
typedef long long ll;
typedef pair<int,int> P;

int main(){
  int N;
  cin >>N;
  vector<vector<int>> to(N),cost(N);
  rep(i,N-1){
    int a,b,w;
    cin >>a>>b>>w;
    a--;
    b--;
    to[a].push_back(b);
    cost[a].push_back(w);
    to[b].push_back(a);
    cost[b].push_back(w);
  }
  vector<int> ans(N,-1);
  queue<int> q;
  ans[0] = 0;
  q.push(0);
  while(!q.empty()){
    int v = q.front();
    q.pop();
    rep(i,to[v].size()){
      int u = to[v][i];
      int w = cost[v][i];
      if(ans[u] != -1) continue;
      ans[u] = (ans[v]+w)%2;
      q.push(u);
    }
  }
  rep(i,N) cout << ans[i] << endl;
}

Measured memory_bytes: 11904
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
using ll = long long;
using ld = long double;
const int INF = (1<<30)-1;
const long long LINF = (1LL<<62)-1;
const long double PI = acos(-1.0L);
const int dx[] = {-1, 0, 1, 0};
const int dy[] = {0, 1, 0, -1};
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }

signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int a, b;
  cin >> a >> b;
  if (a <= 8 && b <= 8)
    cout << "Yay!" << endl;
  else
    cout << ":(" << endl;
  return 0;
}

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

int main() {
    //
    int x, y, z;
    int cnt = 0;

    cin >> x >> y >> z;

    x -= z;
    while (x >= y + z) {
        x -= y + z;
        cnt++;
    }

    cout << cnt;
}


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

#define rep(i,n) for(i = 0;i < n;++i)
#define all(v) v.begin(), v.end()
using ll = long long;

int main()
{
    ll i,j;
    string s,t;
    cin >> s >> t;
    ll n = s.size();
    for(i = 0;i < n;++i){
        if(s.at(i) != t.at(i)){
            cout << "No" << endl;
            return 0;
        }
    }
    cout << "Yes" << endl;

    return 0;
}

Measured memory_bytes: 3628
#include <iostream>
#include<vector>
#include<algorithm>
#include<cstdio>
#include<cstdlib>
#include<string>
#include<sstream>
#include<cmath>
#include<numeric>
#include<map>
#include<stack>
#include<queue>
using namespace std;

int main() {

  int a, b, c, d;
  cin >> a >> b >> c >> d;
  vector<int> x(101, 0);
  for(int i=a; i<=b; i++){
    x[i] = 1;
  }
  int cnt = 0;
  for(int i=c; i<=d; i++){
    if( x[i] == 1 ) cnt++;
  }
  if( cnt != 0 ) cnt--;
  cout << cnt << endl;

  return 0;
}


Measured memory_bytes: 256
//g++ -std=c++14 test.cpp -o test.out

#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <cassert>
#include <algorithm>
#include <functional>
#include <iostream>
#include <iomanip>
#include <vector>
#include <queue>
#include <stack>
#include <map> 
#include <unordered_map> 
#include <utility>
#include <limits.h>
#include <bitset>
#include <set>
using namespace std;
 
#define LL long long int
const LL INF = (1LL<<60);
const int INF_INT = 2147483647-1e6-1;
const LL mod = 1000000007ll;
const int mod_int = 1000000007;

LL N;

string ans = "Yes";

void solve(){
  if(N<30) ans = "No";
}

int main(){
    cin >> N;

    solve();

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

Measured memory_bytes: 3096
using System;

namespace ALDS1_1_A
{
    class Program
    {
        static void Main(string[] args)
        {
            // B
            string[] data = System.Console.ReadLine().Split(' ');
            var A = System.Int32.Parse(data[0]);
            var B = System.Int32.Parse(data[1]);
            var res = gcd(A, B);
            System.Console.WriteLine(res);
        }

        static int gcd(int x, int y) {
            if (y==0) return x;
            else {
                if (x >= y) return gcd(y, x % y);
                else return gcd(x, y % x);
            }
        }
    }
}

Measured memory_bytes: 9180
#include<stdio.h>
int main(void)
{
	int Money=100000,risi,n,i;
	scanf("%d",&n);
	for(i=1;i<=n;i++){
		Money *= 1.05;
		if(Money%1000>1){
			Money /=1000;
			Money *=1000;
			Money +=1000;
		}
	}
	printf("%d\n",Money);
	return 0;
}

Measured memory_bytes: 592