akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <string>
#include <cmath>
using namespace std;
int main(void){
    // Your code here!
    string S,T;
    int a,b,c;
    cin >> a >> b >> c;
    if(1 == ((a == b) + (b == c) + (a == c) )){
        cout  << "Yes" <<endl;
    }else{
        cout << "No" << endl;
    }

}


Measured memory_bytes: 256
#include <iostream>
#include <cmath>
using namespace std;
int main(int argc, char const *argv[]) {
    long long int d,n;
    cin >> d >> n;
    if(n==100)n=101;
    int dec;
    if(d == 0){
        dec = 1;
    }else if(d == 1){
        dec = 100;
    }else{
        dec = 10000;
    }
    cout << n *  dec << endl;
    return 0;
}


Measured memory_bytes: 256
/** 
 * THIS IS CFMASTER'S CODE !
 * HACK IT IF YOU CAN !
**/
#include <bits/stdc++.h>

using namespace std;

const int MAX = 1010;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  long long n, a, b;
  cin >> n >> a >> b;
  cout << (n / (a + b)) * a + min(a, n % (a + b)) << '\n';
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, a, b) for(int i = a; i < b; i++)
#define Rep(i, a, b) for(int i = a; i <= b; i++)
#define _GLIBCXX_DEBUG
#define Vl vector<ll>
#define Vs vector<string>
#define Vp vector<pair<ll, ll>>
#define P pair<ll, ll>
#define ll long long
#define ALL(v) (v).begin(),(v).end()
#define endl "\n"
#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
#define co(x) cout << x << endl
#define coel cout << endl
#define pb push_back
#define sz(v) ((int)(v).size())
using namespace std;  
const double pi = acos(-1.0);
const ll MOD = 1e9 + 7;
const ll INF = 1LL << 60;




////////////////////////////////////////////////////////


int main() {
    ll N, K; cin >> N >> K;
    Vl A(N);
    rep(i, 0, N) cin >> A[i];
    Vl V;
    ll now = 1;
    rep(i, 0, N){
        V.push_back(now);
        now = A[now-1];
    }
    ////////////
    // rep(i, 0, sz(V)) cout << V[i] << " ";
    // cout << endl;
    /////////////
    map<ll, ll> ma;
    ll r;
    ll F; //　ループが始まる値
    rep(i, 0, sz(V)){
        ma[V[i]]++;
        if(ma[V[i]] == 2){
            r = i; 
            F = V[i];
            break;
        }
    }
    ll l;
    rep(i, 0, sz(V)){
        if(V[i] == F){
            l = i;
            break;
        }
    }
    ////////////////////
    // co(l << " " << r);
    ////////////////////
    ll siz = r-l;
    ///////////////////
    // co(siz << " " << l);
    ///////////////////
    if(K < l){
        now = 1;
        rep(i, 0, K){
            now = A[now-1];
        }
        co(now);
        return 0;
    }
    K -= l;
    K %= siz;
    //////////////////
    // co(K);
    //////////////////
    now = F;
    rep(i, 0, K){
        now = A[now-1];
    }
    co(now);

    return 0;
}


Measured memory_bytes: 18544
"use strict"
const create = () => {
    const input = require("fs").readFileSync("/dev/stdin", "utf8").trim().split("\n");
    const res = {
        "list": input, "index": 0, "max": input.length,
        "hasNext": function() {return this.index < this.max},
        "next": function() { if (!this.hasNext()) {throw "ArrayIndexOutOfBoundsException";}else{return this.list[this.index++];}}
    };
    return res;
}
const o = create();
const next = () => o.next()
const nextInt = () => parseInt(o.next())
const nextStrArray = () => o.next().split(" ")
const nextIntArray = () => o.next().split(" ").map(el => parseInt(el))
const nextCharArray = () => o.next().split("")
const hasNext = () => o.hasNext()
const myout = (...x) => console.log(...x)
const Main = () => {
    let [n,k] = nextIntArray()
    let h = nextIntArray()
    let ans = 0
    for(let i = 0; i<h.length; i++){
        if(h[i] >= k) ans++
    }
    console.log(ans)
}
Main()



Measured memory_bytes: 36952
import java.util.*;
class Main{
	static Scanner s = new Scanner(System.in);
	public static void main(String[] args) {
		long a=s.nextLong(),b=s.nextLong(),x=s.nextLong();
		long r=(a%x==0)?1:0;
		System.out.println(b/x-a/x+r);
	}
}

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

int main() {
  int N;
  cin >> N ;
  int all;
  
  for (int i = 0; i < N; i++) {
    int l,r;
    cin >> l >> r ;
    if( l == r ){
      all +=1; } else {
      all = all+(r-l)+1;
    }}
  cout << all << endl;

}


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

#define Int long long int
#define REP(i,n) for(int i=0;i<(n);i++)
#define REAP(i,a,n) for(int i=(a);i<(n);i++)
#define YES cout<<"Yes"<<endl
#define NO cout<<"No"<<endl
#define fr first
#define sc second
#define pb push_back
#define All(v) v.begin(),v.end()

int main(){
    int n,k;
    cin >> n >> k;
    if(k){
        Int sum=0;
        REAP(i,1,n+1){
            int p=n/i;
            int r=n%i;
            sum+=p*max(0,i-k);
            sum+=max(0,r-k+1);
        }
        cout << sum << endl;
    }else{
        cout << (Int)n*n << endl;
    }
}


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

#define REP(i, n) for(int (i)=0; (i)<(n); (i)++)
#define ALL(v) (v).begin(), (v).end()
#define INF 1e9

using namespace std;
int coin[4] = {10, 50, 100, 500};

int main(){
  int p;
  int counter = 0;
  while(cin >> p and p){
    if(counter++){
      cout << endl;
    }
    p /= 10;
    int c[4];
    REP(i, 4) cin >> c[i];
    int res[4] = {0};
    int mincoin = INF;
    REP(i, c[0]+1) REP(j, c[1]+1) REP(k, c[2]+1) REP(l, c[3]+1){
      int coins = c[0] - i + c[1] - j + c[2] - k + c[3] - l;
      int sum = i + j * 5 + k * 10 + l * 50;
      if(sum < p) continue;
      int ret = sum - p;
      int back[4] = {ret % 5, (ret % 10) / 5, (ret % 50) / 10, ret / 50};
      if(i * back[0] or j * back[1] or k * back[2] or l * back[3]) continue;
      if(mincoin > coins + back[0] + back[1] + back[2] + back[3]){
        mincoin = coins + back[0] + back[1] + back[2] + back[3];
        res[0] = i; res[1] = j; res[2] = k; res[3] = l;
      }
    }
    REP(i, 4) { if(res[i]) cout << coin[i] << " " << res[i] << endl; }
  }
  return 0;
}

Measured memory_bytes: 3020
package main

import (
	"fmt"
)

func main() {
	var r int
	fmt.Scan(&r)

	if r < 1200 {
		fmt.Println("ABC")
	} else if r < 2800 {
		fmt.Println("ARC")
	} else {
		fmt.Println("AGC")
	}
}


Measured memory_bytes: 1772
#include <bits/stdc++.h>
#define ll long long int
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);
using namespace std;
template <class T1, class T2>void print(T1 a[], T2 n) { for (T2 i = 0; i < n; i++) { cout << a[i] << " ";} cout << endl;}
template <class T1, class T2>void print(vector<T1> a, T2 n) { for (T2 i = 0; i < n; i++) { cout << a[i] << " "; } cout << endl;}
ll modexpo(ll a, ll b, ll m) {if (b == 0) {return 1;} else if (a == 1) {return 1;} if (b % 2 == 0) {ll t = modexpo(a, b / 2, m); t = (t * t) % m; return t;} else {ll t = modexpo(a, b / 2, m); t = (t * t) % m; t = (t * a) % m; return t;}}

ll dp1[100004];
ll dp2[100004];
ll m = 1e9 + 7;

void dfs(ll x, vector<ll> g[], ll p) {

    for (int i = 0; i < g[x].size(); i++) {
        int t = g[x][i];
        if (t != p) {
            dfs(t, g, x);
            dp1[x] = (((dp1[t] + dp2[t]) % m) * dp1[x]) % m;
            dp2[x] = (dp1[t] * dp2[x]) % m;
        }
    }

}

int main() {

    // taskkill /IM "cp.exe" /F
    fast
//#ifndef ONLINE_JUDGE
  //  freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
//#endif


    ll n;
    cin >> n;
    vector<ll> g[n + 1];

    for (int i = 0; i < n - 1; i++) {
        ll x, y;
        cin >> x >> y;
        g[x].push_back(y);
        g[y].push_back(x);
    }


    for (int i = 0; i <= n; i++) {
        dp1[i] = 1;
        dp2[i] = 1;
    }
    // cout << (dp1[1] + dp2[1] ) << endl;
    dfs(1, g, 0);
    cout << ((dp1[1] + dp2[1]) % m) << endl;





}

Measured memory_bytes: 12800
#include<bits/stdc++.h>
using namespace std;
#define se second
#define fi first
#define ll long long
#define ld long double
#define pll pair<ll ,ll >
#define plll pair<ll,pll>
#define ppll pair<pll, pll>
#define pii pair<int, int> 
#define pb push_back
#define mod 1000000007
#define N 2000007
ll power(ll a,ll b){
    ll res=1ll;
    while(b>0){
        if(b%2!=0) res=(res*a)%mod;
        a=(a*a)%mod;
        b/=2;
    }
    return res%mod;
}
ll ncr(ll n,ll k){
    if(k>n-k) k=n-k;
    ll pro=1;
    for(ll i=0;i<k;i++){
        pro=(pro*(n-i))%mod;
        pro/=(i+1);
    }
    return (pro)%mod;
}

void swap(ll *a,ll *b) {
    ll temp=*a;
    *a=*b;
    *b=temp;
}
vector<ll> prime;
void seive(){
    vector<bool > isprime(1000001,true);
    for(int i=2;i*i<=1000000;i++){
        if(isprime[i]){
            for(int j=i*i;j<=1000000;j+=i){
                isprime[j]=false;
            }
        }
    }
    for(int i=2;i<=1000000;i++){
        if(isprime[i]) prime.push_back(i);
    }
}
vector<ll> parent;
ll find(ll p) {
    if(parent[p]==p) return parent[p];
    return parent[p]=find(parent[p]); 
}
void unun(ll a,ll b) {
    ll r1=find(a);
    ll r2=find(b);
    if(r1!=r2) parent[r2]=r1;
}
void solve() {
    string str;
    cin>>str;
    ll n=str.size();
    string rstr=str;
    reverse(rstr.begin(),rstr.end());
    if(rstr==str) {
        string s1=str.substr(0,(n-1)/2);
        string rs1=s1;
        reverse(rs1.begin(),rs1.end());
        string s2=rstr.substr(0,(n-1)/2);
        string rs2=s2;
        reverse(rs2.begin(),rs2.end());
        if(s1==rs1 && s2==rs2) {
            cout<<"Yes";
        }
        else cout<<"No";
    }
    else {
        cout<<"No";
        return ;
    }
}   


int main(void){
    ios_base::sync_with_stdio(false); 
    cin.tie(NULL);
    cout.tie(NULL);
    int t;
    t=1;
    // cin>>t;
    while(t--) {
        solve();
        // cout<<endl;
    }
    return 0; 

}


Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <cfloat>
#include <ctime>
#include <cassert>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <numeric>
#include <list>
#include <iomanip>
#include <iterator>
 
using namespace std;
 
typedef long long ll;
typedef pair<int,int> Pii;
typedef pair<ll,ll> Pll;
 
#define FOR(i,n) for(int i = 0; i < (n); i++)
#define sz(c) ((int)c.size())

typedef unsigned long long ull;
const int INF = (int)1e8;


int main(){
	int m = 17;
	queue<int> q;
	vector<int> v(m,-1);
	set<Pii> st;
	int t = 0;
	vector<int> ans(100);

	while(t < 1000 || !q.empty()){
		bool change = false;
		if((t % 5 == 0) && (t / 5 < 100)){
			int i = t/5;
			q.push(i);
			ans[i] = t;
			change = true;
		}

		while(!st.empty() && (*(st.begin())).first == t){
			int c = (*(st.begin())).second;
			st.erase(st.begin());
			FOR(i,m) if(v[i] == c) v[i] = -1;
			change = true;
		}

		if(change) while(!q.empty()){
			int c = q.front();
			int l = (c%5 == 1) ? 5 : 2;
			int cnt = 0;
			int start = -1;
			FOR(i,m){
				if(v[i] == -1) cnt++;
				else cnt = 0;
				if(cnt == l){
					start = i - l + 1;
					break;
				}
			}
			if(start != -1){
				q.pop();
				st.insert(Pii(17*(c%2)+3*(c%3)+19 + t,c));
				ans[c] = t - ans[c];
				FOR(i,l) v[i+start] = c;
			} else {
				break;
			}
		}

		t++;
	}

	int n;
	while(cin>>n){
		cout << ans[n] << endl;
	}
	return 0;
}

Measured memory_bytes: 1200
# -*- coding: utf-8 -*-
 
## Library
 
import sys
from fractions import gcd
import math
from math import ceil,floor
import collections
from collections import Counter
import itertools

## input
 
# N=int(input())
# A,B,C,D=map(int, input().split())
# S = input()
# yoko = list(map(int, input().split()))
# tate = [int(input()) for _ in range(N)]
# N, M = map(int,input().split()) 
#    P = [list(map(int,input().split())) for _ in range(M)]

H,W=map(int, input().split())

if H==1 or W==1:
    print(1)
    sys.exit()

print(ceil(H/2)*ceil(W/2) + floor(H/2)*floor(W/2))


Measured memory_bytes: 77416
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        boolean f = false;
        while (sc.hasNext()) {
            String l = sc.next();
            while (l.length() < 5)
                l = "0" + l;
            if (f)
                System.out.println();
            f = true;
            String s = "";
            for (int i = 0; i < 40; i++) {
                int t = l.charAt(i % 5) - '0';
                if (i < 5)
                    s += t < 5 ? "*" : " ";
                else if (i < 10)
                    s += t < 5 ? " " : "*";
                else if (i < 15)
                    s += "=";
                else
                    s += t % 5 == i / 5 - 3 ? " " : "*";
                if (i % 5 == 4)
                    s += "\n";
            }
            System.out.print(s);
        }
    }
}



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

#define repd(i, a, b) for (ll i = (a); i < (b); i++)
#define repb(i, n) for (ll i = (n)-1; i >= 0; i--)
#define rep(i, n) repd(i, 0, n)

using namespace std;

using ll = long long;
using ul = unsigned long long;
ll mod = 1000000007;

int main() {
    ll n, c;
    cin >> n >> c;
    ll d[c][c];
    rep(i, c) {
        rep(j, c) { cin >> d[i][j]; }
    }

    ll memo[3][c];
    rep(i, 3) {
        rep(j, c) { memo[i][j] = 0; }
    }

    rep(i, n) {
        rep(j, n) {
            ll color;
            cin >> color;
            color--;
            ll index = (i + j) % 3;
            memo[index][color]++;
        }
    }

    ll ans = mod * mod;
    rep(c0, c) {
        rep(c1, c) {
            rep(c2, c) {
                if (c0 == c1 || c1 == c2 || c0 == c2)
                    continue;
                ll temp = 0;
                rep(num, c) { temp += memo[0][num] * d[num][c0]; }
                rep(num, c) { temp += memo[1][num] * d[num][c1]; }
                rep(num, c) { temp += memo[2][num] * d[num][c2]; }
                // cout << c0 << " " << c1 << " " << c2 << ":" << temp << endl;
                ans = min(ans, temp);
            }
        }
    }

    cout << ans << endl;
}



Measured memory_bytes: 256
<?php
//error_reporting(0);
//$N = trim(fgets(STDIN));
list($N,$K) =  explode(" ",trim(fgets(STDIN)));
$A = explode(" ",trim(fgets(STDIN)));

$res=0;
foreach($A as $v) {
  if ($v >= $K) $res++;
}
printf("%d\n",$res);


Measured memory_bytes: 12792
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>

#define REP(i, n) for(int i = 0;i < n;i++)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define ALL(a) (a).begin(), (a).end()

using namespace std;

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

    vector<int> A(N), B(N), C(N);

    REP(i, N)
        cin >> A[i];
    REP(i, N)
        cin >> B[i];
    REP(i, N)
        cin >> C[i];

    sort(ALL(A));
    sort(ALL(B));
    sort(ALL(C));

    unsigned long long sum = 0;

    // O(N)
    // i_B を決定したときに，許容されるCの数の早引き
    vector<size_t> table(N);
    REP(i, N)
        table[i] = C.end() - upper_bound(ALL(C), B[i]);

    // O(N)
    // tableの累積和
    vector<size_t> sum_table(N);
    for( int i = N - 1; i >= 0; i-- )
    {
        if( i == N - 1 )
            sum_table[i] = table[i];
        else
            sum_table[i] = sum_table[i+1] + table[i];
    }

    // O(NlogN)
    REP(i, N)
    {
        int top = A[i];

        size_t mid_it = (upper_bound(ALL(B), top) - B.begin());

        sum += sum_table[mid_it];
    }

    cout << sum << endl;

    return 0;
}


Measured memory_bytes: 2944
#include <bits/stdc++.h>
#define MOD 1000000007
#define md %998244353
#define INF 2e9
#define EPS 1e-9
#define MAX LLONG_MAX
#define MIN LLONG_MIN
#define F first
#define S second
#define MP make_pair
#define PB push_back
#define EB emplace_back
#define endl "\n"
#define FOR(i,a,b) for (long long i = a; i < b; i++)
#define REV(i,a,b) for (long long i = a; i > b; i--)
#define mset(a, v) memset(a, v, sizeof(a))
#define fd(n) fixed<<setprecision(n)
typedef std::pair<int, int> pii;
typedef std::vector<long long> vi;
typedef std::vector<vi> vvi;
typedef long long ll;
typedef unsigned long long ull;
using namespace std;

ll solve(ll x,ull y,ll p) {
    ll res = 1;
    x = x % p;
    while (y > 0) {
        if (y & 1)
            res = (res*x) % p;
        y = y>>1;
        x = (x*x) % p;
    }
    return res;
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(NULL);
   
   ll i,j,n,k;
   cin>>n>>k;
   ll a[k];
   for(i=0;i<k;i++)cin>>a[i];

  sort(a,a+k);
   ll ans =0;
   

   
    
    ll s[k]={0};
    
    
    for(i=0;i<k-1;i++)
     s[i]=a[i+1]-a[i];
    
    s[k-1]=n-a[k-1] +a[0];
    
    sort(s,s+k);
    ll sum=0;
    for(i=0;i<k-1;i++)
      sum=sum + s[i];

  cout<<sum;
}


Measured memory_bytes: 3328
#include <bits/stdc++.h>
using namespace std;
#define modulo 1000000007
#define mod(mod_x) ((((long long)mod_x+modulo))%modulo)
#define Inf 10000000


int main(){
	
	int N;
	cin>>N;
	
	vector<int> H(N);
	
	for(int i=0;i<N;i++){
		cin>>H[i];
	}
	
	int maxi = 0;
	
	for(int i=0;i<N;i++){
		int cnt = 0;
		for(int j=i+1;j<N;j++){
			if(H[j]<=H[j-1]){
				cnt++;
			}
			else{
				i=j-1;
				break;
			}
			if(j==N-1){
				i=j;
				break;
			}
		}
		maxi = max(cnt,maxi);
	}
	cout<<maxi<<endl;
		
	
	return 0;
}


Measured memory_bytes: 768
#include <stdio.h>
#include <vector>
#include <iostream>
#include <math.h>
#include <algorithm>
#include <cstring>
#include <string>
using namespace std;
typedef long long ll;
using vi = vector<int>;

string str;
string stra;
int id = 0;

vi number(){
  vi res;
  for (; isdigit(stra[id]); id++) {
    res.push_back(stra[id] - '0');
  }
  reverse(res.begin(),res.end());
  return res;
}
int solve(){
  stra = str;
  for (int i = 9; i >= 0; i--) {
    id = 0;
    for (int j = 0; j <(int)str.size(); j++) {
      if (str[j] == 'X') {
        stra[j] = i + '0';
      }
    }
    vi a = number();
    if (stra[id] == '+' ) {
      id++;
    }
    vi b = number();
    a.resize(max(b.size() + 1,a.size()+1),0);
    for (size_t j = 0; j < b.size(); j++) {
      a[j] += b[j];
      if (a[j]>=10) {
        a[j] -= 10;
        a[j+1]++;
      }
    }
    for (size_t j = b.size(); j < a.size()-1; j++) {
      if (a[j] >= 10) {
        a[j] -= 10;
        a[j+1]++;
      }
    }
    if (stra[id] == '=') {
      id++;
    }
    b = number();



    if(i==0){
      if(a[a.size()-1]==0){
        a.pop_back();
      }
      if (a.size() != b.size()) {
        continue;
      }
    }
    else{
      if (a.size() >= b.size()) {
        b.resize(a.size(),0);
      } else {
        a.resize(b.size(),0);
      }
    }



    int flag = 0;
    for (size_t j = 0; j < a.size(); j++) {
      if (a[j] == b[j]) {
        flag++;
      }
    }
    if (flag ==(int)a.size()) {
      return i;
    }

  }
  return -1;
}
int main(){
  cin >> str;
  while(str.size()){
  int ans = solve();
  if (ans >= 0) {
    cout << ans << endl;
  } else {
    puts("NA");
  }
  str.clear();
  cin >> str;
}
  return 0;
}



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

#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define REPl(i, n) for (ll i = 0; i < (ll)(n); i++)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define REPRl(i, n) for(ll i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < (int)n; i++)
#define FORl(i, m, n) for(ll i = m; i < (ll)n; i++)
#define ALL(v) v.begin(), v.end()
ll gcd(ll a,ll b) {
  return b? gcd(b,a%b): a;  
}
ll lcm(ll a,ll b) {
  return a*b/gcd(a,b);
}
int main() {
  int n,m,X,Y;cin>>n>>m>>X>>Y;
  int maxX=max(-INT_MAX,X),minY=min(INT_MAX,Y);
  REP(i,n){
    int x;cin>>x;
    maxX=max(maxX,x);
  }
  REP(i,m){
    int y;cin>>y;
    minY=min(minY,y);
  }
  string ans;
  if(maxX<minY){
    ans="No War";
  }else{
    ans="War";
  }
  cout << ans << endl;
}


Measured memory_bytes: 256
#include <stdio.h>

int main() {
    unsigned long long int a, b, x;
    scanf("%lld %lld %lld", &a, &b, &x);

    if (a == b) {
        printf("%d\n", a%x==0);
        return 0;
    }

    unsigned long long int c, d, e;
    c = a / x;
    d = b / x;
    e = d - c + (a%x==0); // a/x?

    printf("%lld\n", e);

    return 0;
}

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

namespace IO {
    const int maxn((1 << 21) + 1);

    char ibuf[maxn], *iS, *iT, c;
    int f;

    inline char Getc() {
        return iS == iT ? (iT = (iS = ibuf) + fread(ibuf, 1, maxn, stdin), iS == iT ? EOF : *iS++) : *iS++;
    }

    template <class Int> inline void In(Int &x) {
        for (f = 1, c = Getc(); c < '0' || c > '9'; c = Getc()) f = c == '-' ? -1 : 1;
        for (x = 0; c >= '0' && c <= '9'; c = Getc()) x = (x << 1) + (x << 3) + (c ^ 48);
        x *= f;
    }
}

using IO :: In;

const int maxn(105);

int n, a[maxn], x;

int main() {
	In(n), In(x);
	for (int i = 1; i <= n; ++i) In(a[i]);
	sort(a + 1, a + n + 1);
	for (int i = 1; i <= n; ++i) {
		if (a[i] == x) return printf("%d\n", i), 0;
		if (a[i] > x) return printf("%d\n", i - 1), 0;
		x -= a[i];
	}
	if (!x) printf("%d\n", n);
	else printf("%d\n", n - 1);
    return 0;
}

Measured memory_bytes: 256
# -*- coding: utf-8 -*-


def main():
    n = int(input())
    seats = [0] * 100000
    count = 0

    for i in range(n):
        left, right = map(int, input().split())

        for j in range(left - 1, right):
            seats[j] = 1

    for seat in seats:
        if seat == 1:
            count += 1

    print(count)


if __name__ == '__main__':
    main()


Measured memory_bytes: 3828
#include <iostream>
#include <fstream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <cstring>
#include <string>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <deque>
#include <bitset>
#include <algorithm>
#include <complex>
using namespace std;
 
#define REP(i,n) for(int i=0; i<n; ++i)
#define FOR(i,a,b) for(int i=a; i<=b; ++i)
#define FORR(i,a,b) for (int i=a; i>=b; --i)
#define ALL(c) (c).begin(), (c).end()
 
typedef long long ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef vector<VI> VVI;
typedef vector<VL> VVL;
typedef pair<int,int> P;
typedef pair<ll,ll> PL;

int in() { int x; scanf("%d", &x); return x; }
ll lin() { ll x; scanf("%lld", &x); return x; }

const int N = 1e5 + 10;
ll par[N], height[N], sum[N], id2e[N], use[N];

int find(int x){
    if (par[x] == x) return x;
    return find(par[x]);
}

bool same(int x, int y){
    return find(x) == find(y);
}

void merge(int x, int y, int id){
    x = find(x);
    y = find(y);
    if (x == y) return;

    if (height[x] < height[y]){
        par[x] = y;
        sum[y] += sum[x];
        id2e[id] = x;
    }else{
        par[y] = x;
        sum[x] += sum[y];
        id2e[id] = y;
        if (height[x] == height[y]) height[x]++;
    }
}

void split(int id){
    int x = id2e[id];
    int y = par[x];
    par[x] = x;
    sum[y] -= sum[x];
}

struct edge{ ll u, v, cost; };

bool comp(const pair<edge, int> &e1, const pair<edge, int> &e2){
    return e1.first.cost < e2.first.cost;
}

int main() {
    int n, m;
    cin >> n >> m;
    VL x(n);
    REP(i,n) x[i] = in();
    vector<pair<edge, int>> es(m);
    REP(i,m){
        int u = in() - 1, v = in() - 1, y = in();
        es[i] = make_pair(edge{u, v, y}, i);
    }

    REP(i,n){
        par[i] = i;
        height[i] = 1;
        sum[i] = x[i];
    }

    sort(ALL(es), comp);
    REP(i,m){
        edge e = es[i].first;
        if (same(e.u, e.v)) continue;

        merge(e.u, e.v, es[i].second);
        use[es[i].second] = 1;
    }


    int ans = 0;
    FORR(i,m-1,0){
        // cout << i << endl;
        edge e = es[i].first;
        int p = find(e.u);
        // cout << p << " " << sum[p] << " " << e.cost << endl;
        if (sum[p] < e.cost) ans++;
        else continue;
        if (!use[es[i].second]) continue;
        split(es[i].second);

        // cout << endl;
        // REP(j,n) cout << " " << j << " " << par[j] << " " << sum[j] << endl;
    }
    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 8064
import java.io.*
import java.util.*

const val MOD = 1000000007
fun solve(S: String) {
    val n = S.length
    // dp[mod][i] = 左からi桁まで見て、あまりがmodであるものの数
    val dp = Array(13) { LongArray(n + 1) }
    dp[0][0] = 1L
    for (i in 1..n) {
        for (mod in 0..12) {
            val digits = when (S[i - 1]) {
                '?' -> (0..9).asSequence()
                else -> sequenceOf(S[i - 1] - '0')
            }
            for (digit in digits) {
                val nextMod = (mod * 10 + digit).floorMod(13).toInt()
                dp[nextMod][i] += dp[mod][i - 1]
                dp[nextMod][i] = dp[nextMod][i] % MOD
            }
        }
    }
    // println(dp.contentDeepToString())
    println(dp[5][n])
    return
}

fun Int.floorMod(mod: Int): Int{
    val ret = this % mod
    return if (ret >= 0) ret else ret+mod
}

fun main(args: Array<String>) {
    fun StringArray(size: Int, init: (Int) -> String = { "\u0000" }): Array<String> {
        return Array<String>(size, init)
    }
    class Scanner(stream: InputStream) {
        private val reader = BufferedInputStream(stream).bufferedReader()
        private var st: StringTokenizer? = null
        fun next(): String {
            while (!(st?.hasMoreTokens() ?: false)) st = StringTokenizer(reader.readLine())
            return st!!.nextToken()
        }
    }
    val sc = Scanner(System.`in`)
    val S = sc.next()
    solve(S)
}


Measured memory_bytes: 77976
#include <bits/stdc++.h>
#define endl '\n'
using namespace std;
struct _IO { _IO() { ios::sync_with_stdio(0); cin.tie(0); } } _io;
typedef long long ll; typedef long double db;

int exgcd(int a, int b, int& x, int& y)
{
    if (!b)
    {
        x = 1;
        y = 0;
        return a;
    }
    int d = exgcd(b, a % b, x, y);
    int t = x;
    x = y;
    y = t - (a / b) * y;
    return d;
}
int getInv(int a, int mod)
{
    int x, y;
    return exgcd(a, mod, x, y) == 1 ? (x % mod + mod) % mod : -1;
}

int main()
{
    ll D, T, S;
    cin >> D >> T >> S;
    if (T * S >= D) cout << "Yes" << endl;
    else cout << "No" << endl;

    return 0;
}

Measured memory_bytes: 3648
#include <bits/stdc++.h>
// Hey! 僕の提出を見てくれてありがとう.
// ロボ子さん可愛いぞ！！！！！君もV沼にはまろう↓
// https://www.youtube.com/channel/UCDqI2jOz0weumE8s7paEk6g
using namespace std;
using ll = long long;
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}//a,bの最大公約数(gcd)を求める
ll lcm(ll a,ll b){return abs(a*b)/gcd(a,b);}//a,bの最小公倍数(lcm)を求める
vector<ll> enum_div(ll n){vector<ll> ret;for(int i=1 ; i*i<=n ; i++){if(n%i == 0){ret.push_back(i);if(i!=1 && i*i!=n)ret.push_back(n/i);}}ret.push_back(n);return ret;}
//↑nの約数を求める
vector<bool> IsPrime; void sieve(size_t max){if(max+1 > IsPrime.size())IsPrime.resize(max+1,true);IsPrime[0] = false;IsPrime[1] = false;for(size_t i=2; i*i<=max; ++i)if(IsPrime[i])for(size_t j=2; i*j<=max; ++j)IsPrime[i*j] = false;}
//↑エラトステネスの篩で素数を求める
#define roundup(divisor,dividend) (divisor + (dividend - 1)) / dividend //切り上げ割り算
#define all(x) (x).begin(),(x).end() //xの初めから終わりまでのポインタ
#define size_t ll //size_tは自動でllに変換される
#define pb(x) push_back(x)
#define pri_queue priority_queue //優先度付きキュー
#define syo(x) fixed << setprecision(x) //iostreamで小数をx桁表示
//sortを降順にする時は greater<型>()

void solve(long long N, long long L, std::vector<std::string> S){
  sort(all(S));
  string ans="";
  for (int i = 0; i <S.size() ; i++) {
    ans += S[i];
  }
  cout << ans << endl;
}

int main(){
    long long N;
				scanf("%lld",&N);
				long long L;
				scanf("%lld",&L);
				std::vector<std::string> S(N);
				for(int i = 0 ; i < N ; i++){
								std::cin >> S[i];
				}
    solve(N, L, std::move(S));
    return 0;
}


Measured memory_bytes: 256
/// Containers Start
#include <algorithm>
#include <bitset>
#include <cstdlib>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <queue>
#include <regex>
#include <random>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
/// C Header Files
#include <cassert>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <ctime>
#include <math.h>
#include <stdio.h>
/// Containers End

using namespace std;

/// Math Start
#define PI acos(-1.0)
#define Pi 3.141592653589793
#define EPS (1e-7)
#define INF (0x3f3f3f3f)
/// Math End

/// Extra Start
#define nn '\n'
#define pb push_back
#define ull unsigned long long
#define ll long long
#define MOD 1000000007
#define sz(a) int((a).size())
#define space " "
#define All(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
/// Extra End

#define rep(i, n) for (int i = 0; i < n; i++)
#define Cini(a)                                                                \
    int a;                                                                     \
    cin >> a;
#define Cinii(a, b)                                                            \
    int a, b;                                                                  \
    cin >> a >> b;
#define Ciniii(a, b, c)                                                        \
    int a, b, c;                                                               \
    cin >> a >> b >> c;
#define Cins(s)                                                                \
    string s;                                                                  \
    cin >> s;
#define Cinss(s1, s2)                                                          \
    string s1, s2;                                                             \
    cin >> s1 >> s2;
#define Cinc(c)                                                                \
    char c;                                                                    \
    cin >> c;
/// Functions End

/// Debug Start
#define deb(x) cout << #x << ": " << x << endl
#define deb2(x, y) cout << #x << ": " << x << '\t' << #y << ": " << y << endl;
#define deb3(x, y, z)                                                          \
    cout << #x << ": " << x << '\t' << #y << ": " << y << '\t' << #z << ": "   \
         << z << endl;
/// Debug End

int dx[] = {-1, 0, 1, 0};
int dy[] = {0, -1, 0, 1};

/**>>>>>>>>>>>>>>>>>>> END <<<<<<<<<<<<<<<<<<**/

/// template

signed main(void) {
    cin.sync_with_stdio(false);
    cin.tie(0);
    Cini(N);
    cout << (N+2-1)/ 2 << nn;
    return 0;
}

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

int H, W, white = 0, INF = 100000000;
vector<vector<char>> S;
vector<vector<int>> D;
vector<int> dx = {1, 0, -1, 0}, dy = {0, 1, 0, -1};

int bfs() {
  queue<pair<int, int>> Q;
  for (int i = 0; i < H; i++) {
    for (int j = 0; j < W; j++) {
      D.at(i).at(j) = INF;
    }
  }
  pair<int, int> start = make_pair(0, 0);
  Q.push(start);
  D.at(0).at(0) = 0;
  
  while(Q.size()) {
    pair<int, int> p = Q.front();
    Q.pop();
    if (p.first == H - 1 && p.second == W - 1) break;
    for (int i = 0; i < 4; i++) {
      int nx = p.first + dx.at(i), ny = p.second + dy.at(i);
      if (nx >= 0 && nx < H && ny >= 0 && ny < W &&
          S.at(nx).at(ny) == '.' && D.at(nx).at(ny) == INF) {
        pair<int, int> N = make_pair(nx, ny);
        Q.push(N);
        D.at(nx).at(ny) = D.at(p.first).at(p.second) + 1;
      }
    }
  }
  return D.at(H - 1).at(W - 1);
}

int main() {
  cin >> H >> W;
  S.resize(H);
  D.resize(H);
  for (int i = 0; i < H; i++) {
    S.at(i).resize(W);
    D.at(i).resize(W);
    for (int j = 0; j < W; j++) {
      cin >> S.at(i).at(j);
      if (S.at(i).at(j) == '.') white++;
    }
  }
  int res = bfs();
  if (res == INF) cout << -1 << endl;
  else cout << white - res - 1 << endl;
}


Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;

namespace AtCoder
{
    static class Program
    {
        static void Main()
        {
            //ここから
            var N = IO.ReadLineToInt();
            var S = IO.ReadLineToString();
            var sum = 0;

            for(int i = 0; i < N - 2; i++)
            {
                if (S[i] != 'A') continue;
                if (S[i + 1] != 'B') continue;
                if (S[i + 2] != 'C') continue;
                sum++;
            }

            //ここまで

            Console.WriteLine(sum);
            Console.ReadKey();
        }

    }

    static class Func
    {
        static public long mod = 1000000007;
        static public void Swap<T>(ref T a, ref T b) { T temp = a; a = b; b = temp; }
        static public long GCD(long a, long b) { return b != 0 ? GCD(b, a % b) : a; }
        static public long LCM(long a, long b) { return (long)a * b / GCD(a, b); }
        static public long Factorial(long a) { return a == 1 ? a : a * Factorial(a - 1); }


        public static double ToAngle(this double radian)
        {
            return (double)(radian * 180 / Math.PI);
        }

        public static double ToRadian(this double angle)
        {
            return (double)(angle * Math.PI / 180);
        }

        static public long Conbination(long n, long m)
        {
            if (m == 0) return 1;
            if (n == 0) return 0;
            return n * Conbination(n - 1, m - 1) / m;
        }

        static public void Factoring(long num, ref long[] vs)
        {
            if (num == 1)
            {
                vs[1]++;
            }
            for (long i = 2; i < Math.Sqrt(num); i++)
            {
                if (num % i == 0)
                {
                    vs[i]++;
                    Factoring(num / i, ref vs);
                }
            }
            vs[1]++;
        }
    }

    static class IO
    {
        static public string ReadLineToString() { return Console.ReadLine(); }

        static public int ReadLineToInt() { return int.Parse(Console.ReadLine()); }
        static public long ReadLineToLong() { return long.Parse(Console.ReadLine()); }
        static public List<string> ReadLineToStringList() { return Console.ReadLine().Split(' ').ToList(); }

        static public List<int> ReadLineToIntList() { return Console.ReadLine().Split(' ').Select(int.Parse).ToList(); }
        static public List<long> ReadLineToLongList() { return Console.ReadLine().Split(' ').Select(long.Parse).ToList(); }

        static public List<double> ReadLineToDoubleList() { return Console.ReadLine().Split(' ').Select(double.Parse).ToList(); }

        static public void WriteStrings(object[] strings) { foreach (var o in strings) { Console.Write(o + " "); } }
    }
}

Measured memory_bytes: 11092
#include "bits/stdc++.h"

using namespace std;
using ll = long long;
const double pi = acos(-1);
#define FOR(i,a,b) for (ll i=(a),__last_##i=(b);i<__last_##i;i++)
#define RFOR(i,a,b) for (ll i=(b)-1,__last_##i=(a);i>=__last_##i;i--)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define __GET_MACRO3(_1, _2, _3, NAME, ...) NAME
#define rep(...) __GET_MACRO3(__VA_ARGS__, FOR, REP)(__VA_ARGS__)
#define rrep(...) __GET_MACRO3(__VA_ARGS__, RFOR, RREP)(__VA_ARGS__)
template<typename T> ostream& operator<<(ostream& os, const vector<T>& v) {
	REP(i, v.size()) { if (i)os << " "; os << v[i]; }return os;
}
template<typename T> ostream& operator<<(ostream& os, const vector<vector<T>>& v) {
	REP(i, v.size()) { if (i)os << endl; os << v[i]; }return os;
}

const ll INF = 1LL << 60;
ll MOD = 1000000007;
ll _MOD = 1000000009;
double EPS = 1e-10;

#define int long long

inline void my_io() {

	std::ios::sync_with_stdio(false);

	std::cin.tie(0);

	cout << fixed << setprecision(16);

}

signed main() {
	ll n, m;

	cin >> n >> m;

	ll ans = 1;
	ll now;

	RFOR(i, 2, (m / n) + 1) {
		now = m - n * i;

		if (now % i == 0) {
			ans = i;
			break;
		}
	}

	cout << ans << endl;
}

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

int main() {
  int a, b, c;
  cin >> a >> b >> c;
  string result;
  if (a == b && a != c
     || b == c && a != b
     || a == c && a != b) {
    result = "Yes";
  } else {
    result = "No";
  }
  cout << result << endl;
  return 0;
}

Measured memory_bytes: 256
/*input
100 100 100
*/
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
#define REP(i,j,k)     for(int i = j ; i < k ; ++i)
#define RREP(i,j,k)    for(int i = j ; i >=k ; --i)
#define A    first
#define B    second
#define mp   make_pair
#define pb   emplace_back
#define PII pair<int , int>
#define MEM(i,j)   memset(i , j , sizeof i)
#define ALL(i)     i.begin() , i.end()
#define DBGG(i,j)     cout << i << " " << j << endl
#define DB4(i,j,k,l)  cout << i << " " << j << " " << k << " " << l << endl
#define IOS cin.tie(0) , cout.sync_with_stdio(0)
#define endl "\n"
///------------------------------------------------------------
#define MAX 
#define INF 0x3f3f3f3f

int a , b , c;
int32_t main(){
    IOS;
    cin >> a >> b >> c;
    int ans = INF;
    ans = min(ans , abs(a - b) + abs(b - c));
    ans = min(ans , abs(a - c) + abs(c - b));
    ans = min(ans , abs(b - a) + abs(a - c));
    ans = min(ans , abs(b - c) + abs(c - a));
    ans = min(ans , abs(c - a) + abs(a - b));
    ans = min(ans , abs(c - b) + abs(b - a));
    cout << ans << endl;
    return 0;
}

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

#define REP(i,n) for(ll i=0;i<ll(n);++i)
#define RREP(i,n) for(ll i=ll(n)-1;i>=0;--i)
#define FOR(i,m,n) for(ll i=m;i<ll(n);++i)
#define RFOR(i,m,n) for(ll i=ll(n)-1;i>=ll(m);--i)
#define ALL(v) (v).begin(),(v).end()
#define UNIQUE(v) v.erase(unique(ALL(v)),v.end());
#define INF 1000000001ll
#define MOD 1000000007ll
#define EPS 1e-9

const int dx[8] = { 1,1,0,-1,-1,-1,0,1 };
const int dy[8] = { 0,1,1,1,0,-1,-1,-1 };


using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	int n, k;
	cin >> n >> k;
	vl cnt(k, 0);
	REP(i, n) {
		cnt[(i + 1) % k]++;
	}
	ll ans = 0;
	ans += cnt[0] * cnt[0] * cnt[0];
	if (k % 2 == 0)ans += cnt[k / 2] * cnt[k / 2] * cnt[k / 2];
	cout << ans << endl;


}

Measured memory_bytes: 1792
#include <iostream>
#include <string>
#include <algorithm>
#include <utility>
#include <iomanip>
#include <functional>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <vector>
#include <cmath>
#include <cctype>
#include <cstdio>
#define ll long long
#define INF 1000000000000000001
#define MOD 1000000007
using namespace std;



int main(){
    int N;
    cin >> N;
    int a[200001];
    a[0]=0;
    for(int i=1; i<=N; i++){
        cin >> a[i];
    }
    
    int M=0;
    int ball[200001]={};
    for(int i=N; i>=1; i--){
        int temp=0;
        for(int j=i*2; j<=N; j+=i){
            temp = (temp^ball[j]);
        }
        ball[i] = (temp^a[i]);
        if(ball[i]==1){
            M++;
        }
    }
    
    cout<<M<<endl;
    if(M==0){
        return 0;
    }
    for(int i=1; i<=N; i++){
        if(ball[i]==1){
            cout<<i;
        }else{
            continue;
        }
        M--;
        if(M>0){
            cout<<" ";
        }else{
            cout<<endl;
            break;
        }
    }
    return 0;
}



Measured memory_bytes: 2560
#include <bits/stdc++.h>
#define ALL(obj) begin(obj), end(obj)
#define debug(x) cerr << #x << ": " << x << '\n'
using namespace std;
template <class T>
vector<T> make_vec(size_t a) {
    return vector<T>(a);
}
template <class T, class... Ts>
auto make_vec(size_t a, Ts... ts) {
    return vector<decltype(make_vec<T>(ts...))>(a, make_vec<T>(ts...));
}
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;
}

using ll = long long;
using ull = unsigned long long;
const int INF = 1e9;
// const int MOD = 1e9 + 7;

int main() {
    int s, w;
    cin >> s >> w;
    if (s <= w) {
        cout << "unsafe\n";
    } else {
        cout << "safe\n";
    }
}


Measured memory_bytes: 3592
import std.algorithm;
import std.array;
import std.ascii;
import std.container;
import std.conv;
import std.math;
import std.numeric;
import std.range;
import std.stdio;
import std.string;
import std.typecons;
void log(A...)(A arg) { stderr.writeln(arg); }
int size(T)(in T s) { return cast(int)s.length; }

void main() {
    int N; readf("%d\n", &N);
    auto A = iota(0, N, 1).map!((i) => readln.chomp.to!int).array;
    bool[int] map;
    foreach (a; A) {
        if (map.get(a, false)) {
            map[a] = false;
        } else {
            map[a] = true;
        }
    }
    writeln(map.values().count!((a) => a));
}


Measured memory_bytes: 5116
#include<iostream>
using namespace std;
int main()
{
    int n;
    cin>>n;
    int *a=new int [n];
    for(int i=0;i<n;i++)
        cin>>a[i];
    int SortNext=0;
    int times=0;
    int Min=0;
    int Min_i=0;
    while(SortNext<n){
        Min=a[SortNext];
        Min_i=SortNext;
        for(int i=SortNext;i<n;i++){
            if (a[i]<Min){
                Min=a[i];
                Min_i=i;
            }
        }
        if(Min_i!=SortNext){
            swap(a[Min_i],a[SortNext]);
            times++;
            SortNext++;
        }
        else{
            SortNext++;
        }
    }
    for(int i=0;i<n-1;i++)
        cout<<a[i]<<" ";
    cout<<a[n-1]<<endl;
    cout<<times<<endl;

    return 0;
}



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

#define is_uruu main
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
	
int is_uruu() {
	int N;
	cin >> N;
	int A[N];
	FOR(i,0,N)cin >> A[i];
	FOR(i,0,N-1)cout << A[i] << " ";
	cout << A[N-1] << endl;
	
	FOR(i,1,N){
		int v=A[i];
		int j=i-1;
		while(A[j]>v && j>=0){
			A[j+1]=A[j];
			j--;
		}
		A[j+1]=v;
		FOR(i,0,N-1)cout << A[i] << " ";
		cout << A[N-1] << endl;
	}
	
	return 0;
}


Measured memory_bytes: 3104
import numpy as np
N,M = list(map(int,input().split()))
A= np.array(list(map(int,input().split())))
limit = A.sum()/4/M
#print(limit)
over = np.where(A >= limit)[0]
#print(over)
ans = over.size
#print(ans)
if ans >= M:
  print("Yes")
else:
  print("No")

Measured memory_bytes: 21408
#include<iostream>
#include<string>
#include<algorithm>

using namespace std;
static const int N = 1000;

int Edit_Distance(string s1,string s2){
  int dp[N + 1][N + 1] = {};
  int m,n;
  
  m = s1.size();
  n = s2.size();
  
  for(int i = 0;i <= m;i++){
    dp[i][0] = i;
  }
  
  for(int i = 0;i <= n;i++){
    dp[0][i] = i;
  }
  
  for(int i = 1;i <= m;i++){
    for(int j = 1;j <= n;j++){
      int c;
      if(s1[i - 1] == s2[j - 1]) c = 0;
      else c = 1;
      
      int m = min(dp[i - 1][j] + 1,dp[i - 1][j - 1] + c);
      
      dp[i][j] = min(m,dp[i][j - 1] + 1);
    }
  }
  
  return dp[m][n];
}
      
int main(){
  string s1,s2;
  
  cin >> s1 >> s2;
  
  cout << Edit_Distance(s1,s2) << '\n';
  
  return 0;
}



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

#define ll long long

typedef vector< ll > vi;
typedef vector< vi > vvi;
typedef pair< ll,ll > ii;
#define sz(a) ll((a).size())
#define pb push_back
#define all(c) (c).begin(),(c).end()
#define present(c,x) ((c).find(x) != (c).end())
#define cpresent(c,x) (find(all(c),x) != (c).end())

#define endl "\n"
#define fast ios::sync_with_stdio(0);cin.tie(0)

int main(){
	fast;
	int n, a, b;
	cin>>n>>a>>b;
	string s;
	cin>>s;

	int cnt = 0, b_rank = 0;
	for(int i = 0; i<n; i++){
		if(s[i] == 'a' && cnt <a+b){
			cnt++;
			cout<<"Yes"<<endl;
		}else if(s[i] == 'b' && cnt < a+b && b_rank < b){
			cout<<"Yes"<<endl;
			cnt++;
			b_rank++;
		}else{
			cout<<"No"<<endl;
		}
	}
	return 0;
}


Measured memory_bytes: 848
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

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

            // 整数配列の入力
            var XYZ = Console.ReadLine().Split(' ').Select(i => int.Parse(i)).ToArray();

            var temp = 0;

            temp = XYZ[0];
            XYZ[0] = XYZ[1];
            XYZ[1] = temp;

            temp = XYZ[0];
            XYZ[0] = XYZ[2];
            XYZ[2] = temp;

            Console.WriteLine("{0} {1} {2}", XYZ[0].ToString(), XYZ[1].ToString(), XYZ[2].ToString());

            Console.Out.Flush();
        }
    }
}


Measured memory_bytes: 28260
#include <iostream>
#include <algorithm>
#include <stdio.h>
using namespace std;
int main(void){
    // Your code here!
    long H,W,minimum,i,k,count;
    
    
    
    cin>>H>>W;
    
    while(H!=0 || W!=0)
    {
        for(i=0;i<H;i++)
        {
            for(k=0;k<W;k++)
            {
                cout<<"#";
            }
            cout<<endl;
        }
        cin>>H>>W;
        cout<<endl;
        
    }
    
    

    

    
    
    
    
    return 0;
    
}



Measured memory_bytes: 3084
#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<int, int>;

int main() {
  char c;
  cin >> c;
  if (isupper(c)) {
    cout << 'A' << endl;
  } else {
    cout << 'a' << endl;
  }
  return 0;
}

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

int main()
{
	string S;
	cin >> S;
	if (S == "zyxwvutsrqponmlkjihgfedcba") {
		cout << -1 << endl;
		return 0;
	}
	if ((int)S.size() == 26) {
		string T = S;
		next_permutation(T.begin(), T.end());
		for (int i = 0; i < 26; i++) {
			if (S[i] != T[i]) {
				T.erase(T.begin() + i + 1, T.end());
				break;
			}
		}
		cout << T << endl;
		return 0;
	}
	vector<int> cnt(26);
	for (auto c : S) {
		cnt[c - 'a'] = 1;
	}
	for (int i = 0; i < 26; i++) {
		if (cnt[i] == 0) {
			S.push_back(i + 'a');
			break;
		}
	}
	cout << S << endl;
	return 0;
}


Measured memory_bytes: 256
K,N = map(int,input().split())
l1 = list(map(int,input().split()))
l2 = [l1[i]-l1[i-1] for i in range(len(l1))]
l2[0] = l1[0] + K - l1[-1] 
l2.sort()
ans = 0
for i in range(N-1):
  ans += l2[i]
print(ans)

Measured memory_bytes: 32340
import numpy as np

n = int(input())

ans_array = np.zeros(n+1, dtype = np.int)

for i in range(n+1):
  if (i % 3 !=0) and (i % 5 != 0):
    ans_array[i] = i

ans_array[0] = 0

# print(ans_array)

ans = sum(ans_array)

print(ans)

Measured memory_bytes: 34216
n,k = map(int,input().split())
a = [0 for x in range(n)]
b = [0 for x in range(n)]
for i in range(n):
    a[i],b[i] = map(int,input().split())
cnt = [0 for x in range(10**5+1)]
for i in range(n):
    cnt[a[i]] += b[i]
    # print(f'{a[i]}, {b[i]}, {cnt[a[i]]}')
i = 1
sum = 0
while sum < k:
    sum += cnt[i]
    if sum >= k: break
    i += 1
    # print('@', i, ' ', sum)
print(i)


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

using namespace std;
using ll=long long;
using ld=long double;
using P=pair<ll,ll>;
#define FOR(i,n,m) for(ll i=n; i<(ll)m;i++)
#define FORr(i,n,m) for(ll i=n; i>(ll)m; i--)
#define cinv(v,n,m) FOR(i,n,m) cin>>v.at(i)
#define coutv(v,n,m) FOR(i,n,m) cout<<v.at(i) <<" "
#define cout(n) cout<<fixed<<setprecision(n)
int main(){
  ll sum=0;
  int in,N;
  cin>>N;
  FOR(i,0,N){
    cin>>in;
    sum+=in;
  }
  cout<<sum-N<<endl;
}


Measured memory_bytes: 384
package main

import (
	"fmt"
	"sort"
)

func main() {
	var n int
	fmt.Scan(&n)
	
	v := make([]float64, n)
	
	for i := range v {
		fmt.Scan(&v[i])
	}
	sort.Float64s(v)
	avg := v[0]
	for j := 1; j < n; j++ {
		avg = (avg + v[j]) / 2
        //fmt.Printf("j=%d,avg=%v\n",j,avg)
	}
	fmt.Println(avg)
}

Measured memory_bytes: 512