akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#include <algorithm>
using namespace std;

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

  int h[n];
  int d[n];
  for (int i = 0; i < n; i++) {
    cin >> h[i];
  }

  long long int ans = 0;
  long long int tmp = 0;
  for (int i = 1; i < n; i++) {
    if (h[i-1] - h[i] >= 0) {
      tmp++;
    } else {
      ans = max(tmp, ans);
      tmp = 0;
    }
  }
  ans = max(tmp, ans);

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

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

col = [0] * 8
opt = 0

for i in range(n):
    if 1 <= a[i] < 400:
        col[0] = 1
    elif 400 <= a[i] < 800:
        col[1] = 1
    elif 800 <= a[i] < 1200:
        col[2] = 1
    elif 1200 <= a[i] < 1600:
        col[3] = 1
    elif 1600 <= a[i] < 2000:
        col[4] = 1
    elif 2000 <= a[i] < 2400:
        col[5] = 1
    elif 2400 <= a[i] < 2800:
        col[6] = 1
    elif 2800 <= a[i] < 3200:
        col[7] = 1
    elif 3200 <= a[i]:
        opt += 1
if sum(col) == 0:
    print(1, opt)
else:
    print(sum(col), sum(col)+opt)

Measured memory_bytes: 9088
n,h = gets.split.map &:to_i
a,b = n.times.map{gets.split.map &:to_i}.transpose
amax = a.max
b = b.sort.select{|t| t>=amax}.reverse

ans = 0
b.each{|t|
  h -= t
  ans += 1
  if h<=0
    p ans
    exit
  end
}

ans += (h+amax-1) / amax
p ans

Measured memory_bytes: 13448
#include<iostream>
#include<algorithm>
using namespace std;
int t[100000],sum,n,m,ans;
int main(){
  while(cin>>n>>m&&n&&m){
    sum=0;
    for(int i=0;i<n;i++){
      cin>>t[i];
      if(i<m)sum+=t[i];
    }
    ans=sum;
    for(int i=m;i<n;i++){
      sum+=t[i];
      sum-=t[i-m];
      ans=max(ans,sum);
    }
    cout<<ans<<endl;
  }
  return 0;
}

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

#define ll long long int
#define rep(i,x,y) for(int i=x;i<y;i++)
#define rel(i,x,y) for(int i=x-1;i>=y;i--)
#define all(x) x.begin(),x.end()
using namespace std;
#define INF 100000000
int dp[100005];

int main(){
	cin.tie(nullptr);
	ios::sync_with_stdio(false);
	int n;
	vector<int> once;
	cin >> n;
	rep(i,0,n+1) dp[i] = i;
	int cnt = 0;
	//once.push_back(0);
	rep(i,1,7){
		int tmp6 = pow(6,i);
		int tmp9 = pow(9,i);
		if(tmp6 <= n) once.push_back(tmp6);
		if(tmp9 <= n) once.push_back(tmp9);
	}
	sort(all(once));

	rep(i,1,n+1){
		rep(j,0,once.size()){
			if(i-once[j]>=0) dp[i] = min(dp[i],1+dp[i-once[j]]);
		}
	}
	cout << dp[n] << endl;
}


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

int main() {
  stringstream ss;
  string s;
  string p;
  cin>>s>>p;
  ss<<s<<s;
  string moto=ss.str();
  for(int i=0;i<moto.size()-p.size();i++){
  int result = moto.compare(i, p.size(), p);
    if(result==0){
      cout<<"Yes"<<endl;
      return 0;
    }
  }
  cout<<"No"<<endl;
  return 0;
}


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

using namespace std;

typedef unsigned long long ull;
typedef long long ll;
typedef long double ld;
//#define int ll
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector< vi > vvi;
typedef vector< vvi > vvvi;
typedef vector<short> vs;
typedef vector<vs> vvs;
typedef vector<vvs> vvvs;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<vvl> vvvl;
typedef vector<ld> vld;
typedef vector<vld> vvld;
typedef vector<vvld> vvvld;
typedef vector<string> vst;
typedef vector<vst> vvst;
typedef pair<ld, ld> pld;
typedef complex<double> base;

#define inmin(a, b) a = min(a, (b))
#define inmax(a, b) a = max(a, (b))
#define ALL(a) a.begin(),a.end()
#define RALL(a) a.rbegin(),a.rend()
#define sqr(x) ((x) * (x))
#define fori(i, n) for(int i = 0; i < int(n); ++i)
#define SZ(a) ((int)((a).size()))
#define triple(T) tuple<T, T, T>
#define quad(T) tuple<T, T, T, T>
#define watch(x) cout << (#x) << " = " << (x) << endl;

#ifdef MAX_HOME
#define cerr cout
#else
#define cerr if (false) cerr
#endif

const double PI = 2 * acos(0.0);
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
mt19937_64 rng_64(chrono::steady_clock::now().time_since_epoch().count());

const string DIGITS = "0123456789";
const string ALPH = "abcdefghijklmnopqrstuvwxyz";

template <class T0, class T1>
inline ostream & operator << (ostream &out, pair<T0, T1> &a) {
    return out << "{" << a.first << ", " << a.second << "}";
}

template <class T0, class T1, class T2>
inline ostream & operator << (ostream &out, tuple<T0, T1, T2> &a) {
    return out << "{" << get<0>(a) << ", " << get<1>(a) << ", " << get<2>(a) << "}";
}

template <class T0, class T1, class T2, class T3>
inline ostream & operator << (ostream &out, tuple<T0, T1, T2, T3> &a) {
    return out << "{" << get<0>(a) << ", " << get<1>(a) << ", " << get<2>(a) << ", " <<  get<3>(a) << "}";
}

template<class T>
inline ostream & operator << (ostream &out, vector<T> &a) {
    out << "[";
    fori (i, a.size())
        out << a[i] << vector<string>{", ", "]  "}[i + 1 == a.size()];
    return out;
}



void smain();

signed main() {
    ios::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);

#ifdef MAX_HOME
    freopen("input.txt", "r", stdin);
    clock_t start = clock();
#endif
    cout << setprecision(12) << fixed;
    smain();
#ifdef MAX_HOME
    cout << "\n\n\n\nTOTAL EXECUTION TIME: " << float( clock () - start ) /  CLOCKS_PER_SEC << endl;
#endif
}

void test() {
    cout << "TEST: " << endl;


    exit(0);
}

void smain() {
//    test();
    int n, k;
    cin >> n >> k;
    n = max(n >> 1, n - (n >> 1));
    if (n >= k) cout << "YES";
    else cout << "NO";

}


Measured memory_bytes: 256
#include<stdio.h>
#include<stdlib.h>
int main()
{
     int a,b,c,d,i,p,k;
     scanf("%d %d",&a,&b);
     if(a>b)
          p=a;
     else
          p=b;
     for(i=0;i<p;i++){
          c=abs(a-i);
          d=abs(b-i);
          if(c==d){
              k=i;
            break;
          }
     }
     if(c==d)
     printf("%d\n",k);
     else
       printf("IMPOSSIBLE\n");

}


Measured memory_bytes: 1688
use std::io::*;
use std::str::*;

fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let s = stdin.bytes().map(|c| c.unwrap() as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect::<String>();
    s.parse::<T>().unwrap_or_else(|_| panic!("Faild to parse {}", s))
}

fn main(){
    println!("ABC{}", read::<String>());
}


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

#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")

using namespace std;
#define ll long long
#define pb push_back
#define mp make_pair
#define ull unsigned long long
#define rep(n) for(ll i = 0 ; i<n ; i++) 
#define rep2(n) for(ll j=0 ; j<n ; ++j )
#define repd(n) for(ll i = n-1 ; i>=0 ; i--)
#define MOD 1000000007
#define pii pair<ll,ll>
#define vll vector<ll>
#define ff first
#define ss second
#define fast ios::sync_with_stdio(0) , cin.tie(0) , cout.tie(0); 
#define nl "\n"
#define INF 0x3f3f3f3f
#define sz(a) a.size() 
#define all(a) a.begin(),a.end()
#define M 998244353
#define limit 100000000

void solve() {
	ll a,b,c; cin >> a >>b>>c;
  cout << c << " " << a << " " << b ;
}

int main() {

    fast;
	ll t=1;
	// cin>>t;
	rep(t) {
		solve() ;
	}
	return 0;
}


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

int main() {
    int h, n;
    cin >> h >> n;
    int a[n], b[n];
    rep(i, n) cin >> a[i] >> b[i];

    vector<int> dp(h + 5, INF);
    for (int i = 1; i <= h; i++) {
        rep(j, n) {
            int hp = i - a[j];
            if (hp <= 0)
                dp[i] = min(dp[i], b[j]);
            else
                dp[i] = min(dp[i], dp[hp] + b[j]);
        }
    }

    cout << dp[h] << endl;
    return 0;
}


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

#define int          long long
#define ld          long double
#define pb          push_back
#define pii         pair<int,int> 
#define vi          vector<int>
#define vii         vector<pii>
#define mi          map<int,int>
#define mii         map<pii,int>
#define all(a)      (a).begin(),(a).end()
#define F         first
#define S           second
#define sz(x)       (int)x.size()
#define endl        '\n'
#define hell        1000000007
#define mem(x)      memset(x,0,sizeof(x));
#define what_is(x)  cerr << #x << " is " << x << endl;
#define rep(i,a,b)  for(int i=a;i<b;i++)

using namespace std;

void solve(){
    string s,t;
    cin>>s>>t;
    int ans=0;

    for(int i=0;i<3;i++)if(s[i]==t[i])ans++;

    cout<<ans;
}



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

    int t=1,i=1;
   // cin>>t;
    

    while(t--){
      //  cout<<"Case #"<<i++<<": ";
        solve();
    
    }

    return 0;
}

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

using namespace std;

const int N = 2e5 + 3;

int n, k, c;
int pf[N], sf[N];
string s;

int main() {
    cin >> n >> k >> c;
    cin >> s;
    s = ' ' + s;

    for (int i = n; i >= 1; i--) {
        if (s[i] == 'o') {
            sf[i] = 1;
            if (i + c + 1 <= n)
                sf[i] += sf[i + c + 1];
        }
        sf[i] = max(sf[i], sf[i + 1]);
    }

    for (int i = 1; i <= n; i++) {
        if (s[i] == 'o') {
            pf[i] = 1;
            if (i - c - 1 >= 1)
                pf[i] += pf[i - c - 1];
        }
        pf[i] = max(pf[i - 1], pf[i]);
    }

    for (int i = 1; i <= n; i++) {
        int ret = sf[i + 1] + pf[i - 1];
        if (ret < k && s[i] == 'o') {
            cout << i << endl;
        }
    }
}


Measured memory_bytes: 3392
#include<stdio.h>
#include<string.h>
typedef struct p{
	int x,y;
}P;
P q[500],sq[500],s,g,n;
int qn,sqn;
int map[105][105];
int dx[]={1,0,-1,0};
int dy[]={0,1,0,-1};
int main(){
	int i,j,w,h,m,c,d,x,y,a,b;
	while(1){
		scanf("%d%d",&w,&h);
		if(w==0)break;
		scanf("%d%d",&s.x,&s.y);
		scanf("%d%d",&g.x,&g.y);
		scanf("%d",&m);
		memset(map,0,sizeof(map));
		while(m--){
			scanf("%d%d%d%d",&c,&d,&x,&y);
			if(d==0)a=4,b=2;
			else a=2,b=4;
			for(i=y;i<y+b;i++){
				for(j=x;j<x+a;j++){
					map[i][j]=c;
				}
			}
		}
		
		//for(i=0;i<=10;i++)for(j=0;j<=10;j++)printf("%d%s",map[i][j],(j==10)?"\n":"");
		
		q[0]=s;qn=1;
		c=map[s.y][s.x];
		map[s.y][s.x]=0;
		if(c==0){
			qn=0;
			goto nex;
		}
		while(qn!=0){
			sqn=0;
			for(i=0;i<qn;i++){
				//printf("%d %d\n",q[i].x,q[i].y);
				if(q[i].x==g.x && q[i].y==g.y)goto nex;
				for(j=0;j<4;j++){
					n=(P){q[i].x+dx[j],q[i].y+dy[j]};
					if(map[n.y][n.x]==c){
						sq[sqn++]=n;
						map[n.y][n.x]=0;
					}
				}
			}
			memcpy(q,sq,sizeof(P)*sqn);
			qn=sqn;
		}
		nex:
		printf("%s\n",(qn==0)?"NG":"OK");
	}
	return 0;
}

Measured memory_bytes: 0
#include<iostream>
#include<string.h>
using namespace std;
int N,count=0;

void getNum(long long num,int flag){
	int baiwei = flag/100;
	int shiwei = flag/10%10;
	int gewei = flag%10;
	if(num<=N){
		if(baiwei&&shiwei&&gewei){
			count++;
		}
		int temp1=flag,temp2=flag,temp3=flag;
		if(baiwei==0){
			temp1+=100;
		}
		getNum(num*10+3,temp1);
		if(shiwei==0){
			temp2+=10;
		}
		getNum(num*10+5,temp2);
		if(gewei==0){
			temp3+=1;
		}
		getNum(num*10+7,temp3);
	}
}

int main(){
	scanf("%d",&N);
	getNum(0,0);
	printf("%d\n",count);
}

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

#define         eps         10e-9
#define         pi          2*acos(0)
#define         P1          1e9+7
#define         P2          1e9+9
#define         lli         long long int

using namespace std;

///ISNNJB

/**int fx[]={+1,-1,+0,+0};
int fy[]={+0,+0,+1,-1};
int fx[]={+0,+0,+1,-1,-1,+1,-1,+1};
int fy[]={-1,+1,+0,+0,+1,+1,-1,-1};*/

int main()
{
    /***freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);*/

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

    int i,j,k,len,ctn=0;
    string s;
    cin>>s;
    len = s.length();
    k=len/2;
    if(len%2==0)
    {
        for (i=k-1,j=k; i>=0; i--,j++)
        {
            if(s[i]!=s[j])
                ctn++;
        }
    }
    else
    {
        for (i=k-1,j=k+1; i>=0; i--,j++)
        {
            if(s[i]!=s[j])
                ctn++;
        }
    }
    cout<<ctn<<endl;
    ctn=0;

    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <algorithm>
using namespace std;
int main()
{
    int a,b,x[3];
    while(scanf("%d%d",&a,&b)==2)
    {
        x[0]=a+b;
        x[1]=a-b;
        x[2]=a*b;
        sort(x,x+3);
        printf("%d\n",x[2]);
    }
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
 
#define ll          long long
#define ld          long double
#define pb          push_back
#define pf          push_front
#define mp          make_pair
#define pll         pair<ll,ll>
#define vl          vector<ll>
#define sl          set<ll> 
#define vll         vector<pll>
#define ml          map<ll,ll>
#define mll         map<pll,ll>
#define all(a)      a.begin(),a.end()
#define x           first
#define y           second
#define sz(x)       (ll)x.size()
#define endl        '\n'
#define mod         (ll)1000000007
#define lp(i,a,b)   for(ll i=a;i<b;++i)
#define lpr(i,a,b)  for(ll i=a;i>=b;i--)
#define lpd(i,x)    for(auto i:x)
#define ios         ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
ll inf = (ll)1e18;
ld pi = 3.141592653589;
using namespace std;

ll bpow(ll x, ll v) {	
	if (v == 0)
		return 1 % mod;
	if (v % 2 == 1)
		return (x * bpow(x, v - 1)) % mod;
	ll r = bpow(x, v / 2);
	return (r * r) % mod;	
}

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

ll solve(){ 
	ll a,b,k; cin>>a>>b>>k;
	ll d = min(k,a);
	a-=d;
	k-=d;
	b-=min(k,b);
	cout<<a<<" "<<b;
}
int main(){
    ios
    ll t=1; 
    //cin>>t;
    while(t--){
    	solve();
    }
}

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


int main(int argc, char const *argv[])
{
	int n, m; cin >> n >> m;
	vector<int> a(m), b(m);
	rep(i, m) cin >> a[i] >> b[i];

	vector<pair<int, int> > v(m);
	rep(i, m) v[i] = make_pair(b[i], a[i]);
	sort(v.begin(), v.end());

	int idx = -1;
	int ans = 0;
	rep(i, v.size()) {
		int a = v[i].second, b = v[i].first;
		// printf("a %d b %d\n", a, b);
		if (idx >= a) continue;

		ans++;
		idx = b - 1;
		// printf("ans %d idx %d\n", ans, idx);
	}

	printf("%d\n", ans);
	return 0;
}

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

constexpr int M = 1000000000 + 7;

void add(int & a, int b) {
    a += b;
    if(a >= M) a -= M;
}
void dec(int & a, int b) {
    a -= b;
    if(a < 0) a += M;
}

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

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

    vector<int> dp(k + 10, 0);
    dp[k] = 1;
    for(int i = 0; i < n; ++i) {
        vector<int> new_dp(k + 10, 0);
        for(int x = 0; x <= k; ++x) {
            add(new_dp[max(0, x - a[i])], dp[x]);
            dec(new_dp[x + 1], dp[x]);
        }
        int val = 0;
        for(int x = 0; x <= k; ++x) {
            add(val, new_dp[x]);
            new_dp[x] = val;
        }
        swap(new_dp, dp);
    }
    cout << dp[0] << '\n';
}


Measured memory_bytes: 1024
#include <iostream>
#include <string.h>
#include <string>
#include <algorithm>
#include <math.h>
using namespace std;

void b_an_odd_problem(void) {
	int n;
	int a[110];
	cin >> n;
	for (int i = 1; i <= n; i++)cin >> a[i];

	int cnt = 0;
	for (int i = 1; i <= n; i++) {
		if ((i & 0x1) == 0x1) {
			if ((a[i] & 0x1) == 0x1) {
				cnt++;
			}
		}
	}

	cout << cnt << endl;
}


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

Measured memory_bytes: 3620
import java.io.InputStream;
import java.io.PrintStream;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.PriorityQueue;
import java.util.Queue;
import java.util.Scanner;
import java.util.Set;

public class Main {
    public static void main(String[] args) throws Exception {
        solve(System.in, System.out);
    }

    static void solve(InputStream is, PrintStream os) {
        // Your code here!
        Scanner sc = new Scanner(is);
        int N = sc.nextInt();
        int M = sc.nextInt();
        ArrayList<Integer>[] tree = new ArrayList[N];
        for(int i = 0; i < N; i++)
            tree[i] = new ArrayList();

        for(int i = 0; i < M; i++){
            int A = sc.nextInt()-1;
            int B = sc.nextInt()-1;
            tree[A].add(B);
            tree[B].add(A);
        }

        HashSet<Integer> set = new HashSet();
        set.add(0);
        HashSet<Integer> visited = new HashSet<>();
        int ans[] = new int[N];

        while(!set.isEmpty()){
            HashSet<Integer> set2 = new HashSet();
            for(Integer num : set) {
                visited.add(num);
                for(Integer dest : tree[num]) {
                    if(!visited.contains(dest) && !set.contains(dest)) {
                        ans[dest] = num;
                        set2.add(dest);
                    }
                }
            }
            set = set2;
        }

        if(visited.size() != N){
            os.println("No");
            return;
        }

        os.println("Yes");
        for(int i = 1; i < N; i++) {
            os.println(ans[i]+1);
        }

    }
}

Measured memory_bytes: 72712
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <cmath>
#include <map>
#include <set>
using namespace std;
#define ll long long
#define rep(i, s, n) for(int i = s; i < n; i++) 

int main() {
    int n, k;
    cin >> n >> k;
    ll ans = 0;
    for(int i = 1; i <= n; i++) {
        ans += (n/i)*max(0, i-k);
        //ans += max(0, n%i-k+1);
        if(k == 0) ans += n%i;
        else ans += max(0, n%i-k+1);
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
// ================
// Himanshu Lal
// MNIT Jaipur
// ================
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define TEZ ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define f(i,a,b) for(ll i=a;i<b;i++)
#define rf(i,a,b) for(ll i=a;i>=b;i--)
#define pb push_back
#define INF 1e18
#define vi vector<pair<ll,ll>>
#define ff first
#define ss second
#define mp map<ll,ll>
#define test ll tp; cin>>tp; while(tp--)
#define srt(v) sort(v.begin(),v.end())
double pi=acos(-1);
void OJ(){
	#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    #endif
}
int main(){
    TEZ;
    ll n;
    cin>>n;
    ll A[n];
    f(i,0,n)
        cin>>A[i];
    ll XOR = 0; 
    f(i,0,n) 
        XOR ^= A[i]; 
    f(i,0,n) 
        A[i] = XOR ^ A[i];
    f(i,0,n)
        cout<<A[i]<<" ";
}

Measured memory_bytes: 5168
import sys
def main():
    input = sys.stdin.readline
    n = int(input())
    v = [[0]+[]*(n+1) for i in range(n+1)]
    for i in range(n-1):
        a,b,c = map(int,input().split())
        v[a].append([b,c])
        v[b].append([a,c])

    q,k = map(int,input().split())
    l = [k]
    while l:
        now = l.pop()
        for i in v[now][1:]:
            if v[i[0]][0] == 0:
                v[i[0]][0] = i[1]+v[now][0]
                l.append(i[0])

    for i in range(q):
        x,y = map(int,input().split())
        print(v[x][0]+v[y][0])

if __name__ == '__main__':
    main()

Measured memory_bytes: 48916
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int A = sc.nextInt();
        int B = sc.nextInt();
        int C = sc.nextInt();
        int D = sc.nextInt();
        int counter = 0;
        while (A > 0 && C > 0) {
            if (counter % 2 == 0) {
                C -= B;
            } else {
                A -= D;
            }
            counter++;
        }
        if (A > 0) {
            System.out.println("Yes");
        } else {
            System.out.println("No");
        }
        sc.close();
    }
}

Measured memory_bytes: 35828
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define pb push_back
#define inf 1e9
#define mod 1000000007
#define ff first
#define ss second

void solve()
{
	int n;
	cin >> n;
	int arr[n];
	for (int i = 0; i < n; i++)
		cin >> arr[i];
	sort(arr, arr + n, greater<int>());

	int cnt = n - 2;
	int ans = arr[0];

	for (int i = 1; i < n; i++)
	{
		if (cnt >= 2)
		{
			ans += 2 * arr[i];
			cnt -= 2;
		}
		else if (cnt == 1)
		{
			ans += arr[i];
			cnt -= 1;
		}
		else break;
	}
	cout << ans;
}

signed main()
{
	ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
	solve();
	return 0;
}


Measured memory_bytes: 5212
def main():
    N = int(input())
    S = []
    C = [0] * 4

    for _ in range(N):
        S.append(input())

    C[0] = S.count("AC")
    C[1] = S.count("WA")
    C[2] = S.count("TLE")
    C[3] = S.count("RE")

    print(f"AC x {C[0]}")
    print(f"WA x {C[1]}")
    print(f"TLE x {C[2]}")
    print(f"RE x {C[3]}")


if __name__ == "__main__":
    main()


Measured memory_bytes: 16256
#include<stdio.h>

int main(void)
{
  int n,t[100],m,p,x,i,ans[100],sum=0;
  scanf("%d",&n);
  for(i=0;i<n;i++)
    {
      scanf("%d",&t[i]);
      sum += t[i];
    }
  scanf("%d",&m);
  for(i=0;i<m;i++)
    {
      scanf("%d %d",&p,&x);
      ans[i] = sum - (t[p-1]-x);
    }
  for(i=0;i<m;i++)
    {
      printf("%d\n",ans[i]);
    }
  return 0;
}


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

bool solve() {
    ll A, B, C;
    cin >> A >> B >> C;

    if ( A == B ) {
        if ( A == C ) return false;
        else return true;
    } else if ( A == C ) {
        return true;
    } else if ( B == C ) {
        return true;
    } else {
        return false;
    }
}

int main() {
    string ans = solve() ? "Yes" : "No";
    cout << ans << "\n";
    return 0;
}

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

cnt = 0
for i in range(N+1):
  for j in range(N+1-i):
    k=N-i-j
    if 0 <= k and 10000*i+5000*j+1000*k == Y:
      print(i, j, k)
      cnt += 1
      break
  else:
    continue
  break
if cnt == 0:
  print(-1, -1, -1)

Measured memory_bytes: 9120
#include<iostream>
#include<vector>
#include<string>

int main(){
    int l, r, d;
    std::cin >> l >> r >> d;
    int cnt = 0;
    for(int x = l; x <= r; x++){
        if(x % d == 0) cnt++;
    }
    std::cout << cnt << std::endl;
    return 0;
}


Measured memory_bytes: 3620
#include<stdio.h>
int main()
{
    int A,B;
    scanf("%d %d",&A,&B);
    if(A==1 && B==2)
        printf("3\n");
    else if(A==2 && B==1)
        printf("3\n");
    else if(A==1 && B==3)
        printf("2\n");
    else if(A==3 && B==1)
        printf("2\n");
    else if(A==2 && B==3)
        printf("1\n");
    else if(A==3 && B==2)
        printf("1\n");

}

Measured memory_bytes: 128
#include <cstdio>
#include <functional>
#include <algorithm>
#include <vector>
#include <limits>
#include <numeric>
#include <type_traits>
#include <iostream>
#include <queue>
#include <bits/stdc++.h>

#define INF (1ll<<60)
#define MOD 1000000007
#define BOUND 27182818284

typedef long long ll;
typedef long long int lli;

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

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

using namespace std;

// gcd
int gcd(int a, int b){
    if(a==0)
        return b;
    return gcd(b%a,a);
}
// gcd array
int findGCD(int arr[], int n){
    int result = arr[0];
    for (int i=1; i < n; i++)
        result = gcd(arr[i], result);

    return result;
}

// sort big to small
// sort(A,A+N, greater<int>());

// v.front() = -BOUND;
// v.back() = BOUND;

// Iterator
// v.begin
// v.end

int main() {
    string S,T;
    string ans="UNRESTORABLE";

    cin >> S >> T;

    if(S.length()<T.length()){
        cout << ans << endl;
        return 0;
    }

    int mem=-1;
    for(int i=0; i<S.length()-T.length()+1; i++){
        bool flag=true;
        string substr=S.substr((unsigned)i,T.length());
        for(int j=0; j<T.length(); j++){
            if(substr[j] != '?' && substr[j] != T[j]){
                flag = false;
            }
        }
        if(flag) mem=i;
    }

    if(mem == -1){
        cout << ans << endl;
        return 0;
    }
    for(int i=mem; i<mem+T.length(); i++){
        S[i] = T[i-mem];
    }

    for(int i=0; i<S.length(); i++){
        if(S[i]=='?'){
            cout << "a";
        }else{
            cout << S[i];
        }
    }


    cout << endl;
    return 0;
}



Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>

using namespace std;
int main(){
    int A,B,C;
    cin>>A>>B>>C;
    int count=0;
    bool poi=false;
    while(!(poi && B==0 && A==0) && !(C==0 && B==0)){
        if(C>0 && !poi){
            C--;
            poi=true;
            count++;
        }
        if(B>0){
            B--;
            poi=false;
            count++;
        }
        if(poi && A>0){
            A--;
            poi=false;
        }
    }
    cout<<count<<endl;
    

}

Measured memory_bytes: 256
#![allow(unused_parens)]
#![allow(unused_imports)]
#![allow(non_upper_case_globals)]
#![allow(non_snake_case)]
#![allow(unused_mut)]
#![allow(unused_variables)]
#![allow(dead_code)]

use itertools::Itertools;
use proconio::input;
use proconio::marker::{Chars, Usize1};

#[allow(unused_macros)]
#[cfg(debug_assertions)]
macro_rules! mydbg {
    //($arg:expr) => (dbg!($arg))
    //($arg:expr) => (println!("{:?}",$arg));
      ($($a:expr),*) => {
          eprintln!(concat!($(stringify!($a), " = {:?}, "),*), $($a),*);
      }
}
#[cfg(not(debug_assertions))]
macro_rules! mydbg {
    ($($arg:expr),*) => {};
}

macro_rules! echo {
    ($($a:expr),*) => {
          $(println!("{}",$a))*
      }
}

use std::cmp::*;
use std::collections::*;
use std::ops::{Add, Div, Mul, Sub};

#[allow(dead_code)]
static INF_I64: i64 = 92233720368547758;
#[allow(dead_code)]
static INF_I32: i32 = 21474836;
#[allow(dead_code)]
static INF_USIZE: usize = 18446744073709551;
#[allow(dead_code)]
static M_O_D: usize = 1000000007;
#[allow(dead_code)]
static PAI: f64 = 3.1415926535897932;

trait IteratorExt: Iterator {
    fn toVec(self) -> Vec<Self::Item>;
}

impl<T: Iterator> IteratorExt for T {
    fn toVec(self) -> Vec<Self::Item> {
        self.collect()
    }
}

trait CharExt {
    fn toNum(&self) -> usize;
    fn toAlphabetIndex(&self) -> usize;
    fn toNumIndex(&self) -> usize;
}
impl CharExt for char {
    fn toNum(&self) -> usize {
        return *self as usize;
    }
    fn toAlphabetIndex(&self) -> usize {
        return self.toNum() - 'a' as usize;
    }
    fn toNumIndex(&self) -> usize {
        return self.toNum() - '0' as usize;
    }
}

trait VectorExt {
    fn joinToString(&self, s: &str) -> String;
}
impl<T: ToString> VectorExt for Vec<T> {
    fn joinToString(&self, s: &str) -> String {
        return self
            .iter()
            .map(|x| x.to_string())
            .collect::<Vec<_>>()
            .join(s);
    }
}

trait StringExt {
    fn get_reverse(&self) -> String;
}
impl StringExt for String {
    fn get_reverse(&self) -> String {
        self.chars().rev().collect::<String>()
    }
}

trait UsizeExt {
    fn pow(&self, n: usize) -> usize;
}
impl UsizeExt for usize {
    fn pow(&self, n: usize) -> usize {
        return ((*self as u64).pow(n as u32)) as usize;
    }
}

//use num_bigint::BigInt;

use num;

fn main() {
    input! {
       N: usize,
       a:[usize;N],
    }

    let mut ans: usize = 1;
    let mut f = true;
    for i in 0..N {
        ans = ans.saturating_mul(a[i]);
        if ans > 1000000000000000000 {
            f = false;
            break;
        }
    }
    if !f {
        for i in 0..N {
            if a[i] == 0 {
                echo!(0);
                return;
            }
        }
        echo!(-1);
        return;
    }

    echo!(ans);
}


Measured memory_bytes: 4444
import sys
input = sys.stdin.readline


def main():
    S = input().strip()
    N = len(S)
    dp = [[0]*13 for _ in range(N+1)]
    dp[0][0] = 1
    m = 1
    for n in range(N):
        c = S[N-n-1]
        if c == "?":
            for i in range(10):
                for j in range(13):
                    dp[n+1][(j + i*m)%13] += dp[n][j]
        else:
            k = int(c)
            for j in range(13):
                dp[n+1][(j + k*m)%13] += dp[n][j]
        for i in range(13):
            dp[n+1][i] %= 10**9+7
        m = m * 10 % 13
    print(dp[N][5])


if __name__ == '__main__':
    main()


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

int main()
{
	int x, y;
	
	while(1)
	{
		cin >> x >> y;
		if(x == 0 && y == 0) break;
		cout << min(x, y) << " " << max(x, y) << endl;
	}
	return 0;
}

Measured memory_bytes: 1160
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define PI  3.14159265358979323846
#define M 1000000007
ll gcd(ll a,ll b)
{
    if(a==0)
        return b;
    else
        return gcd(b%a,a);
}
ll fast(ll n,ll a,ll m)
{
    if(n==0)
        return 1;
    else if(n==1)
        return a;
    else
    {
        ll res=fast(n/2,a,m)%m;
        if(n%2==0)
            return (((res%m)*(res%m))%m);
        else
            return (((((res%m)*a)%m)*res)%m);
    }
}
ll lcm(ll a,ll b)
{
    ll p=a*b;
    p/=gcd(a,b);
    return p;
}
const ll N=1e6;
ll b[N+1]={0};
int main()
{
    ll i,n,j;
    cin>>n;
    ll A[n],t=1;
    for(i=0;i<n;i++)
    {
        cin>>A[i];
        ll res=A[i];
        ll d=0;
        while(res%2==0)
        {
            d++;
            res/=2;
        }
        b[2]=max(b[2],d);
        for(ll j=3;j*j<=res;j+=2)
        {
            d=0;
            while(res%j==0)
            {
                res/=j;
                d++;
            }
            b[j]=max(b[j],d);
        }
        if(res>1)
        {
            b[res]=max(b[res],t);
        }

    }
     ll lcm=1;
     for(i=2;i<=1e6;i++)
     {
         if(b[i]!=0)
         {
             lcm=((lcm%M)*(fast(b[i],i,1e9+7)%M))%M;
         }
     }
     ll ans=0;
     for(i=0;i<n;i++)
     {
         ll inv=fast(1e9+5,A[i],1e9+7);
         inv=((inv%M)*(lcm%M))%M;
         ans=(ans%M+inv%M)%M;
     }
     cout<<ans;
}


Measured memory_bytes: 6656
#include <iostream>
#include <stdio.h>
#include <vector>
using namespace std;

const int MAX_N = 1e5 +6;

vector<int> edg[MAX_N];
bool visit[MAX_N];
int depth[MAX_N];
int p[MAX_N];
int sz[MAX_N];

void dfs(int id,int pp,int cur_depth) {
    visit[id]=1;
    sz[id]=1;
    p[id] = pp;
    depth[id] = cur_depth;
    for (int i:edg[id]) {
        if (!visit[i]) {
            dfs(i,id,cur_depth+1);
            sz[id] += sz[i];
        }
    }
}

int main () {
    int n;
    scanf("%d",&n);
    for (int i=1;n>i;i++) {
        int a,b;
        scanf("%d %d",&a,&b);
        edg[a].push_back(b);
        edg[b].push_back(a);
    }
    dfs(1,1,1);
    int delta=depth[n] - depth[1];
    int cnt=(delta-1)/2;
    int tmp=n;
    while (cnt--) tmp=p[tmp];
    int cntb=sz[tmp],cnta=n-sz[tmp];
    if (cnta > cntb) puts("Fennec");
    else puts("Snuke");
}



Measured memory_bytes: 13184
#include <stdio.h>
int main(void){
  int a, b, c, tmp;

  scanf("%d %d %d\n",&a, &b, &c);

  if(1<=a && a<=10000 && 1<=b && b<=10000 && 1<=c && c<= 10000){
    
    if(a > c) {
      tmp = a;
      a = c;
      c = tmp;
    }

    if(b > c) {
      tmp = b;
      b = c;
      c = tmp;
    }

    if(a > b) {
      tmp = a;
      a = b;
      b = tmp;
    }

  printf("%d %d %d\n", a, b, c);

  }

  return 0;
}

Measured memory_bytes: 600
import Control.Applicative
import Control.Monad
import Control.Monad.ST
import Data.Functor
import Data.Function
import Data.Monoid
import Data.Maybe
import Data.List
import Data.Foldable (foldMap)
import Data.List.Split
import Data.Bits
import Data.Char
import Data.Ix
import Data.Ratio
import Data.Ord
import Data.Tuple
import Data.Array
import Data.Array.IO
import Data.Array.ST
import Data.IORef
import Data.STRef
 
readInt = read :: String -> Int
readDouble = read :: String -> Double
getInt = readLn :: IO Int
getInts = map readInt . words <$> getLine
sjoin :: (Show a) => [a] -> String
sjoin = unwords . map show
cond :: a -> a -> Bool -> a
cond t f c = if c then t else f
apply2 :: (a -> a -> b) -> [a] -> b
apply2 f [x,y] = f x y
apply3 :: (a -> a -> a -> b) -> [a] -> b
apply3 f [x,y,z] = f x y z
fnBin :: (b -> c -> d) -> (a -> b) -> (a -> c) -> a -> d
fnBin op f g x = op (f x) $ g x
fnTuple :: (a -> b, a -> c) -> a -> (b, c)
fnTuple (f,g) a = (f a, g a)
replace :: (Eq a) => a -> a -> [a] -> [a]
replace x y = map (\z -> if z==x then y else z)
modifyArray :: (Ix i, MArray a e m) => a i e -> i -> (e -> e) -> m ()
modifyArray arr ix f = readArray arr ix >>= writeArray arr ix . f
-- end of templete

bound = ((1,1),(6,5)) 
table = listArray bound "abcdefghijklmnopqrstuvwxyz.?! "

f :: String -> Maybe String
f [] = Just ""
f (x:y:s)
  | inRange bound p = ((table ! p):) <$> f s
  | otherwise = Nothing
  where
    p = (digitToInt x, digitToInt y)
f _ = Nothing

main = lines <$> getContents >>= mapM_ (putStrLn . fromMaybe "NA" . f)

Measured memory_bytes: 3968
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>
#define FOR(n) for(int i=0;i<n;i++)
#define FORJ(n) for(int j=0;j<n;j++)
#define PRN(n) printf("%d\n",n)
#define PRF(n) printf("%lf\n",n)
#define PRL(n) printf("%lld\n",n)
#define PRS(s) printf("%s\n",s)
#define PRC(c) printf("%c",c)
#define INI(n) scanf("%d",&n)
#define INL(n) scanf("%lld",&n)
#define INS(s) scanf("%s",s)
#define INF 10000000000
#define mod 1000000007
#define X 1000000
typedef long long int ll;
ll finv[X];
ll fac[X];
ll inv[X];
ll usort(const void *a, const void *b){return *(ll*)a-*(ll*)b;}
ll dsort(const void *a, const void *b){return *(ll*)b-*(ll*)a;}
ll ssort(const void *a, const void *b){return strcmp((char*)a,(char*)b);}
ll min(ll a,ll b){
  if(a>b)return b;
  return a;
}
ll max(ll a,ll b){
  if(a>b)return a;
  return b;
}
ll z(ll a){return max(a,-a);}
ll gcd(ll a,ll b){if(!b){return a;}else{return gcd(b,a%b);}}
ll lcm(ll a,ll b){return a*b/gcd(a,b);}
ll kt(ll a){
  ll sum=0;
  while(a){
    a/=10;
    sum++;
  }
  return sum;
}
ll ks(ll a){
  ll sum=0;
  while(a){
    sum+=a%10;
    a/=10;
  }
  return sum;
}
void nCrReady(){
  fac[0]=fac[1]=1;
  finv[0]=finv[1]=1;
  inv[1]=1;
  for (int i=2;i<X;i++){
    fac[i]=fac[i-1]*i%mod;
    inv[i]=mod-inv[mod%i]*(mod/i)%mod;
    finv[i]=finv[i-1]*inv[i]%mod;
  }
}
ll nCr(ll n,ll k){return fac[n]*(finv[k]*finv[n-k]%mod)%mod;}
ll modpow(ll a,ll b) {
  ll ret=1;
  for(;b>0;b>>=1,a=(ll)a*a%mod)if(b%2==1)ret=ret*a%mod;
  return ret;
}

int main(void){
  int n,ans;
  INI(n);
  
  PRN((n+1)/2);
  return 0;
}


Measured memory_bytes: 128
import sys

sys.setrecursionlimit(10 ** 5 + 10)


def input(): return sys.stdin.readline().strip()


def resolve():
    K, A, B = map(int, input().split())
    cnt = 0
    if B - A >= 3:
        times = (K - (A - 1)) // 2
        if times >= 1:
            cnt += A
            cnt+=(B-A)*times
            if (K - (A - 1)) // 2 == (K - (A - 1)) / 2:
                pass
            else:
                cnt += 1
        else:
            cnt = 1 + K
    else:
        cnt = 1 + K

    print(cnt)


resolve()

Measured memory_bytes: 38640
<?php
//$N = (int)trim(fgets(STDIN));
$S = trim(fgets(STDIN));
$T = trim(fgets(STDIN));
//list($D,$T,$S) = array_map('intval',explode(" ",trim(fgets(STDIN))));
//$A = array_map('intval',explode(" ",trim(fgets(STDIN))));

$slen = strlen($S);
$tlen = strlen($T);

$rep=99999;
for($i=0;$i<$slen-$tlen+1;$i++) {
  $diff=0;
  for($j=0;$j<$tlen;$j++) {
    if ($S[$i+$j]!=$T[$j]) {
      $diff++;
    }
  }
  $rep = min($rep,$diff);
}
printf("%d\n",$rep);


Measured memory_bytes: 16208
#include<stdio.h>
int main(void)
{
	long long int x, min=1000001, max=-1000001, sum=0;
	int n, i;
	scanf("%d", &n);
	for(i=0; i<n; i++){
		scanf("%lld",&x);
		if(x<min){
			min=x;
		}
		if(x>max){
			max=x;
		}
		sum+=x;
	}
	
	printf("%lld %lld %lld\n", min, max, sum);
	
	return 0;
}

Measured memory_bytes: 600
B=int(input())
A=list(map(int,input().split()))

flag=True

for i in A:
    if i%2==0:
        
        if i%3==0 or i%5==0:
            count=0
        else:
            flag=False

if flag:
    print("APPROVED")
else:
    print("DENIED")


Measured memory_bytes: 2940
#include <bits/stdc++.h>
#define ll uint64_t
#define vi vector <int>
#define vl vector <ll>
#define dl pair <ll, ll>
#define ii pair <double, double>
#define vii vector <ii>
#define graph vector <set <int> >
#define REP(a, b, step) for (int i = a; i < b; i += step)
#define inf 100000000

using namespace std;
 
int main() {
    ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
 
    int n, k;
    cin >> n >> k;
    bool arr[10] = {1,1,1,1,1,1,1,1,1,1};
    int in;
    REP(0, k, 1) {
    	cin >> in;
    	arr[in] = 0;
    }
    REP(n, 10000000, 1) {
    	int div = 1;
    	while (div <= i) {
    		if (!arr[(i / div) % 10]) break;
    		div *= 10;
    	}
    	if (div > i) {
    		cout << i << "\n";
    		break;
    	}
    }
    return 0;
}

Measured memory_bytes: 3656
#include<stdio.h>
#include<stdlib.h>
int N,A[100],i,j,k;
void d(){int x;for(x=0;x<N;x++)printf("%d%s",A[x],x==N-1?"\n":" ");}
int main()
{
	scanf("%d",&N);
	for(i=0;i<N;i++)
		scanf("%d",&A[i]);
	for(i=1;i<N;A[j+1]=k,i++)
		for(k=A[i],j=i-1,d();A[j]>k;j--)
			A[j+1]=A[j];
	d();
	return 0;
}

Measured memory_bytes: 600
/*
                   _ooOoo_
                  o8888888o
                  88" . "88
                  (| -_- |)
                  O\  =  /O
               ____/`---'\____
             .'  \\|     |//  `.
            /  \\|||  :  |||//  \
           /  _||||| -:- |||||-  \
           |   | \\\  -  /// |   |
           | \_|  ''\---/''  |   |
           \  .-\__  `-`  ___/-. /
         ___`. .'  /--.--\  `. . __
      ."" '<  `.___\_<|>_/___.'  >'"".
     | | :  `- \`.;`\ _ /`;.`/ - ` : | |
     \  \ `-.   \_ __\ /__ _/   .-` /  /
======`-.____`-.___\_____/___.-`____.-'======
                   `=---='
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
         fozubaoyou    pass System Test!
*/


//include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>

using namespace std;

//conversion
//------------------------------------------
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

//math
//-------------------------------------------
template<class T> inline T sqr(T x) {return x*x;}

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n)  FOR(i,0,n)

//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI  = acos(-1.0);

//clear memory
#define CLR(a) memset((a), 0 ,sizeof(a))

//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

int main(){
    int a,b;
    cin >> a >> b;
    FOR(i,1,100000){
        if((i*8/100 == a) && (i*10/100 == b)){
            cout << i << endl;
            return 0;
        }
    }
    cout << -1 << endl;
    
}


Measured memory_bytes: 256
// ABC160A - Coffee

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

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

	bool answer = true;

	if (S.size() != 6) {
		answer = false;
	} else if (S[2] != S[3]) {
		answer = false;
	} else if (S[4] != S[5]) {
		answer = false;
	}

	if (answer) {
		cout << "Yes" << endl;
	} else {
		cout << "No" << endl;
	}

	return 0;
}


Measured memory_bytes: 256
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using db = double;
using ld = long double;
template<typename T> using V = vector<T>;
template<typename T> using VV = vector<vector<T>>;
#define fs first
#define sc second
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define eb emplace_back
#define lb lower_bound
#define ub upper_bound
#define all(v) (v).begin(),(v).end()
#define siz(v) (ll)(v).size()
#define rep(i,a,n) for(ll i=a;i<(ll)(n);++i)
#define repr(i,a,n) for(ll i=n-1;(ll)a<=i;--i)
#define ENDL '\n'
typedef pair<int,int> Pi;
typedef pair<ll,ll> PL;
constexpr ll mod = 1000000007;
constexpr ll INF = 1000000099;
constexpr ll LINF = (ll)(1e18 +99);
const vector<ll> dx={-1,1,0,0},dy={0,0,-1,1};
template<typename T,typename U> inline bool chmin(T& t, const U& u){if(t>u){t=u;return 1;}return 0;}
template<typename T,typename U> inline bool chmax(T& t, const U& u){if(t<u){t=u;return 1;}return 0;}
template<typename T> inline T gcd(T a,T b){return b?gcd(b,a%b):a;}
template<typename T,typename Y> inline T mpow(T a, Y n) {
  T res = 1;
  for(;n;n>>=1) {
    if (n & 1) res = res * a;
    a = a * a;
  }
  return res;
}

ll dp[12][10]={};

signed main(){
  cin.tie(0);ios::sync_with_stdio(false);
  cout<<fixed<<setprecision(20);
  ll k;cin>>k;
  queue<ll> q;
  rep(i,1,10)q.push(i);

  ll now=0;
  rep(i,0,k){
    now=q.front();q.pop();
    if(now%10>0)q.push(10*now+(now%10)-1);
    q.push(10*now+(now%10));
    if(now%10<9)q.push(10*now+(now%10)+1);
  }
  cout<<now<<ENDL;
}
//! ( . _ . ) ! 
//CHECK overflow,vector_size,what to output?

Measured memory_bytes: 1792
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
int main(){
   int x , y  ;
   scanf("%d%d",&x , &y);

   if((x ==1 || x==3 || x==5 || x==7 || x==8 || x==10 || x==12) && (y ==1 || y==3 || y==5 || y==7 || y==8 || y==10 || y==12)){
    printf("Yes");
   }else if((x==4 || x==6 || x==9 || x==11)&& (y==4 || y==6 || y==9 || y==11)){
    printf("Yes");
   }else if(x==2 && y ==2){
    printf("Yes");
   }else{
    printf("No");
   }
}


Measured memory_bytes: 128
#include<bits/stdc++.h>
#define ll long long 
#define rep(i,N) for(int i=0;i<N;i++)

using namespace std;

const int INF = 1001001001;

signed main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
  
    int n,k;
    cin >> n >> k;
  
    vector<int> h(n);
    rep(i,n) cin >> h[i];
  
    vector<int> dp(n,INF);
    dp[0] = 0;
    rep(i,n){
      if(i==0) continue;
      rep(j,k+1) if(i-j>=0) dp[i] = min(dp[i],dp[i-j]+abs(h[i]-h[i-j]));
    }
	cout << dp[n-1] << endl;
    return 0;
}

Measured memory_bytes: 1024
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
#include<functional>
#include<assert.h>
#include<numeric>
using namespace std;
typedef pair<int,int> P;
typedef long long ll;
typedef long double ld;
const int inf=1e9+7;
const ll longinf=1LL<<60;
#define REP(i,m,n) for(ll i=(int)(m) ; i < (int) (n) ; ++i )
#define rep(i,n) REP(i,0,n)
#define F first
#define S second
constexpr char ln = '\n';

const int mx=100010;
const ll mod=1e9+7;

int main(){
  int n;
  cin >> n;
  vector<int> a(n);
  ld ave = 0;
  rep(i,n){
    cin >> a[i];
    ave += a[i];
  }
  ave /= n;
  int ans = -1;
  ld dis = inf;
  rep(i,n){
    if(abs(ld(a[i])-ave) < dis){
      dis = abs(ld(a[i])-ave);
      ans = i;
    }
  }
  cout << ans << ln;

  return 0;
}

Measured memory_bytes: 3620
#include<bits/stdc++.h>
using namespace std;
int n,l;
string a[105];
int main()
{
    cin>>n>>l;
    for(int i=1;i<=n;i++)
    	cin>>a[i];
    sort(a+1,a+1+n);
	for(int i=1;i<=n;i++)
		cout<<a[i];
	cout<<endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>

using namespace std;

int main(void)
{
    int x, y, z;
    cin >> x >> y >> z;

    int tmp;

    tmp = x;
    x   = y;
    y   = tmp;

    tmp = x;
    x   = z;
    z = tmp;

    cout << x << " " << y << " " << z;

    return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int x = sc.nextInt();

        for(int a = 0; true; a++){
            for(int b = -1; cal(a, b) <= x; b--){
                if(x==cal(a, b)) {
                    System.out.println(a + " " + b);
                    sc.close();
                    return;
                } 
            }
            for(int b = 0; cal(a, b) >= x; b++){
                if(x==cal(a, b)){
                    System.out.println(a + " " + b);
                    sc.close();
                    return;
                }
            }
        }

        
    }

    private static long cal(long a, long b){
        return a * a * a * a * a - b * b * b * b * b;
    }
}

Measured memory_bytes: 38796
#include <stdio.h>
int main(void){
  int  a, i;
  long long ans=0;
  scanf("%d\n", &a);
  for(i=1;i<=a;i++){
    if(i%3!=0 && i%5!=0){
      ans=ans+i;
    }
  }
  printf("%lld", ans);
  
  return 0;
}

Measured memory_bytes: 1720
#include<iostream>
#include<algorithm>
using namespace std;
static const int MAX = 200000;

int main(){
    int R[MAX], n; //R[MAX]:要素数MAXのリストRを定義

	cin >> n; // 入力する数nを入力する
	for ( int i = 0; i < n; i++ ) cin >> R[i]; //nのかずだけ入力

	int maxv = -2000000000; // 十分小さい値を初期値に設定
	int minv = R[0];

	for ( int i = 1; i < n; i++) { // ここで毎回 R[i]を読み込めば、配列は不要
		maxv = max(maxv, R[i] - minv); // 最大値を更新
		minv = min(minv, R[i]); // ここまでの最小値を保持しておく
	}

	cout << maxv << endl;

	return 0;
}


Measured memory_bytes: 3884
#include<map>
#include<cmath>
#include<stack>
#include<cstdio>
#include<queue>
#include<vector>
#include<cstring>
#include<iostream>
#include<algorithm>
using namespace std;
typedef long long ll;
int a,b;
char c;
int main(){
	scanf("%d %c %d",&a,&c,&b);
	if(c=='+')printf("%d\n",a+b);
	else printf("%d\n",a-b);
	return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
#include<math.h>
int main(){
  int N,D;
  scanf("%d %d",&N,&D);
  int i;
  int j=0;
  int X,Y;
  for(i=0;i<N;i++){
    scanf("%d %d",&X,&Y);
    if(pow(X,2)+pow(Y,2)<=pow(D,2)){
      j++;
    }
  }
  printf("%d\n",j);
}

Measured memory_bytes: 1712
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll INF = 9223372036854775807;
const ll half_inf = 0x3f3f3f3f;
const ll inf = 0x7fffffff;
const ll mod = 1e9 + 7;
const ll maxn = 200005;
const ll N = 500005;
char s[100];
int main(){  
	cin.tie(0); cout.tie(0);
    ios::sync_with_stdio(false);
 	/*int T,n,m,k;
	scanf("%d",&T);
	while(T--){
		
		
		
	} */
	int flag=1;
	scanf("%s",s);
	if(strlen(s)%2==0){
	for(int i=0;i<strlen(s);i+=2){
		if(s[i]!='h'||s[i+1]!='i') flag=0;
	}
	}
	else flag=0;
 	if(flag) printf("Yes");
	else printf("No"); 	
	return 0;
}


Measured memory_bytes: 256