akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <fstream>
#include <string>
#include <cmath>
#include <vector>
#include <algorithm>
#include <functional>
#include <cstdio>
#include <cstdlib>
#include <iomanip>
#include <cctype>
#include <bits/stdc++.h>
#include <queue>

using namespace std;
// for loop
#define F(i, L, R) for(long i = L; i < R; i++)
#define FE(i, L, R) for(long i = L; i <= R; i++)
// for (reversed)
#define FR(i, L, R) for(long i = L; i > R; i--)
#define FRE(i, L, R) for(long i = L; i >= R; i--)

// data types
#define Int long
#define ul unsigned long
#define ll long long
#define ull unsigned long long
#define ui unsigned int
#define us unsigned shoft

// vectors
typedef vector<int> vi;
typedef vector<long> vl;
typedef vector<long long> vll;
typedef vector<vi> vvi;
typedef pair<int, int> ii;
#define ALL(c) (c).begin(),(c).end()
#define last(vec) vec.size()-1
#define lastEle(vec) vec[last(vec)]
#define pb push_back
#define InputV(a, n) F(i,0,n){long l; cin >> l; a.pb(l);}

// debug
#define DBG(vari) cerr<<#vari<<" = "<<(vari)<<endl;
#define printA(a, L, R) FE(i, L, R) cout << a[i] << (i==R?'\n':' ')
#define printAF(a, L) printA(a, 0, L-1)
#define printV(a) printA(a, 0, a.size()-1)

// utils
#define char2int(c) (c-'0')
#define bit(x, i) (x&(1<<i))
#define space ' '
#define PI 3.14159265358979323

#define TST 0
int main() {
#if TST==1
    ifstream in ("input.txt");
    cin.rdbuf(in.rdbuf());
#endif
    long n;
    cin >> n;
    vl h(n);
    // dp table has mininum cost to go i-1 th.
    // for convenience, allocate more memory than actually is
    vll dp(n+10);
    F(i, 0, n){
        cin >> h[i];
    }
    dp.assign(n+10, pow(10, 9));
    dp[0] = 0;
    F(i, 0, n){
        dp[i+1] = min(dp[i+1], dp[i] + abs(h[i] - h[i+1]));
        dp[i+2] = min(dp[i+2], dp[i] + abs(h[i] - h[i+2]));
    }
    cout << dp[n-1] << endl;
#if TST==1

#endif
}


Measured memory_bytes: 1792
__precompile__()

N, Z, W = parse.(split(readline(STDIN)))
a = parse.(split(readline(STDIN)))
unshift!(a, W)
N += 1

dpx, dpy = fill(-1, N), fill(-1, N)

function f(isx, pos)
    if isx
        if dpx[pos] < 0
            dpx[pos] = max(abs(a[pos] - a[N]), pos < N-1 ? maximum([f(false, p) for p in pos+1:N-1]) : typemin(Int64))
        end
        return dpx[pos]
    else
        if dpy[pos] < 0
            dpy[pos] = min(abs(a[pos] - a[N]), pos < N-1 ? minimum([f(true, p) for p in pos+1:N-1]) : typemax(Int64))
        end
        return dpy[pos]
    end
end

ans = f(true, 1)
println(ans)

Measured memory_bytes: 161220
#include<stdio.h>
#include<string.h>
#include<ctype.h>

struct shufProj{
	char deck[201];	/*文字列の長さ <= 200*/
	int shuf_cnt;	/*シャッフル回数 <= 100*/
	int shuf_no[101];	/*シャッフル位置 <= 文字列の長さ*/
};


int main(){
	
	int i,j,k,l;
	int cnt;
	struct shufProj deckNo[10];
	char deck_cpy[201]={0};
	char test_str[201]={0};
	
	for(i=0; ; i++){
		scanf("%s",deckNo[i].deck);
		if( strcmp(deckNo[i].deck,"-") == 0){
				break;
		}
		scanf("%d",&deckNo[i].shuf_cnt);
		for(j=0; j<deckNo[i].shuf_cnt; j++){
			scanf("%d",&deckNo[i].shuf_no[j]);
		}
	}	
	
	cnt = i;
	for(i=0; i<cnt; i++){
		for(j=0; j<deckNo[i].shuf_cnt; j++){		/*Input 2行目で指定したシャッフル回数だけ繰り返す*/
			l=0;
//			printf("詰める前：\n%s\n",deckNo[i].deck);
			for(k=deckNo[i].shuf_no[j]; k < strlen(deckNo[i].deck); k++){	/*初期値=入替位置、条件：文字列の長さの回数ループ*/
//				printf("%d番目：%cをセット\n",k,deckNo[i].deck[k]);
				deck_cpy[l] = deckNo[i].deck[k];
//				printf("%c\n");
				l++;
			}
//			printf("詰めた後：\n%s\n",deck_cpy);
/*			{	//test_結合前に確認
				strncat(test_str, &deckNo[i].deck[0], deckNo[i].shuf_no[j]);
				printf("以下を結合：\n%s\n",test_str);
				memset(test_str, '\0', sizeof(test_str));
			}
*/			strncat(&deck_cpy[l], &deckNo[i].deck[0], deckNo[i].shuf_no[j]);
			deck_cpy[k] = '\0';
			strcpy(deckNo[i].deck,deck_cpy);
//			printf("%s\n(%d回:%d)\n",deck_cpy,j,deckNo[i].shuf_no[j]);
			memset(deck_cpy, '\0', sizeof(deck_cpy));
//			printf("入れ替え%d回目：%s\n",j,deck_cpy);
//			printf("(Originへのコピー：%s)\n",deckNo[i].deck);
		}
		printf("%s\n",deckNo[i].deck);
	}
	
	return 0;
}


Measured memory_bytes: 2104
#include <iostream>
#define rep(i, n) for(i = 0; i < n; i++)
using namespace std;

int a = 1e+8;
int H, W, h, w;
int ans[500][500];

int main() {
	int i, j;
	
	cin >> H >> W >> h >> w;
	
	if (H % h == 0 && W % w == 0) { cout << "No" << endl; return 0; }
	if (W % w != 0) {
		rep(i, H) {
			rep(j, W) {
				if (j % w == 0) ans[i][j] = a;
				else ans[i][j] = -(a / (w - 1) + 1);
			}
		}
	}
	else {
		rep(j, W) {
			rep(i, H) {
				if (i % h == 0) ans[i][j] = a;
				else ans[i][j] = -(a / (h - 1) + 1);
			}
		}
	}
	
	cout << "Yes" << endl;
	rep(i, H) {
		rep(j, W) {
			cout << ans[i][j];
			if (j + 1 < W) cout << " ";
		}
		cout << endl;
	}
	return 0;
}

Measured memory_bytes: 3840
use std::io;


fn main() {
    let mut n = read_one::<usize>();
    if n % 2 != 0 { println!("0"); return; }
    let mut ans: usize = 0;
    let mut x: usize = 5;
    n /= 2;
    while x <= n {
        ans +=  n / x;
        x *= 5;
    }
    println!("{}", ans);
}


#[allow(dead_code)]
fn read<T>() -> Vec<T>
where T:
std::str::FromStr,
T::Err: std::fmt::Debug {

    let mut buf = String::new();
    io::stdin().read_line(&mut buf).unwrap();
    buf.split_whitespace()
        .map(|s| s.trim().parse().unwrap())
        .collect()
}

#[allow(dead_code)]
fn read_one<T>() -> T
where T:
std::str::FromStr,
T::Err: std::fmt::Debug {

    let mut buf = String::new();
    io::stdin().read_line(&mut buf).unwrap();
    buf.trim().parse().unwrap()
}

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

#define int long long

#define CHOOSE(a) CHOOSE2 a
#define CHOOSE2(a0,a1,a2,a3,x,...) x
#define REP1(i, s, cond, cal) for (signed i = signed(s); i cond; i cal)
#define REP2(i, s, n) REP1(i, s, < signed(n), ++)
#define REP3(i, n) REP2(i, 0, n)
#define rep(...) CHOOSE((__VA_ARGS__,REP1,REP2,REP3))(__VA_ARGS__)
#define rrep(i, s) rep(i, s, >= 0, --)

#define all(c) begin(c), end(c)
template<typename T>bool maxup(T& a, T&& b) { if (a < b) { a = b; return true; }; }
template<typename T>bool maxup(T& a, T& b) { if (a < b) { a = b; return true; }; }
template<typename T>bool minup(T& a, T&& b) { if (a > b) { a = b; return true; }; }
template<typename T>bool minup(T& a, T& b) { if (a > b) { a = b; return true; }; }

#define X first
#define Y second

using VV = vector<vector<int>>;
using V = vector<int>;
using P = pair<int, int>;
using IP = pair<int, P>;

template<typename T>
inline void input(vector<T>& v) { for (auto& x : v) cin >> x; }

signed main() {
	vector<string> s(3); input(s);
	int now = 0;
	while (s[now].size()) {
		int next = s[now][0] - 'a';
		s[now].erase(s[now].begin());
		now = next;
	}
	cout << "ABC"[now] << endl;
	system("pause");
}

Measured memory_bytes: 504
#include<bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (int) n; i++)
using ll = long long;
template <class T>
using vt = std::vector<T>;
using vvi = std::vector<vt<int>>;

int main(){
  int a,b,c,x;
  std::cin >> a >> b >> c >> x;

  int ans = 0;
  rep(i,a+1)
    rep(j,b+1)
      rep(k,c+1){
        if(x == 500*i + 100*j + 50*k)
          ans++;
      }

  std::cout << ans << '\n';
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <string>
#include <cmath>
#include <cstdio>
#include <iomanip>
#include <fstream>
#include <cassert>
#include <cstring>
#include <unordered_set>
#include <unordered_map>
#include <numeric>
#include <ctime>
#include <bitset>
#include <complex>
#include <chrono>
#include <random>
#include <functional>

using namespace std;

const int N = 501;
const vector<int> di = {0, 0, 1, -1};
const vector<int> dj = {1, -1, 0, 0};

int n;
int sel[N][N];
int p[N * N];
int ans[N][N];

int ok(int i, int j) {
	return i >= 0 && j >= 0 && i < n && j < n;
}

signed main() {
	ios_base::sync_with_stdio(false);
	cin.tie(0);	
	
	cin >> n;
	for (int i = 0; i < n * n; i++) {
		cin >> p[i];
		p[i]--;
	}
	for (int i = 0; i < n; i++) {
		for (int j = 0; j < n; j++) {
			ans[i][j] = min(min(i, n - 1 - i), min(j, n - 1 - j));
			sel[i][j] = 1;
		}
	}
	int res = 0;
	for (int l = 0; l < n * n; l++) {
		int i = p[l] / n;
		int j = p[l] % n;
		sel[i][j] = 0;
		// cerr << i << ' ' << j << endl;
		res += ans[i][j];
		// ans[i][j]--;
		deque<pair<int, int>> q;
		q.push_back({i, j});
		while (!q.empty()) {
			int ti, tj;
			tie(ti, tj) = q.front();
			q.pop_front();
			for (int kek = 0; kek < 4; kek++) {
				int ni = ti + di[kek];
				int nj = tj + dj[kek];
				if (ok(ni, nj) && ans[ni][nj] > ans[ti][tj] + sel[ti][tj]) {
					ans[ni][nj] = ans[ti][tj] + sel[ti][tj];
					if (sel[i][j]) q.push_back({ni, nj});
					else q.push_front({ni, nj});
				}
			}
		}
	}
	cout << res << endl;
}

Measured memory_bytes: 6808
#include<iostream>
#include<algorithm>
using namespace std;
#define Max 251

main(){
	int h,i,a[Max];
	scanf("%d",&h);
	for(i=1;i<=h;i++)
	scanf("%d",&a[i]);
	for(i=1;i<=h;i++){
		printf("node %d: key = %d, ",i,a[i]);
		if(i/2>0)
		printf("parent key = %d, ",a[i/2]);
		if(i*2<=h)
		printf("left key = %d, ",a[i*2]);
		if(i*2+1<=h)
		printf("right key = %d, ",a[i*2+1]);
		printf("\n");
		
	}
	return 0;
}



Measured memory_bytes: 3228
#include <bits/stdc++.h>
#define mod 1000000007
const long long INF = 1LL << 60;
using namespace std;
typedef long long ll;
typedef long double ld;
// a>b -> a==b;
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
// a<b -> a==b;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }

int main(void)
{
    ll N, i, A[200001], sum=0, ans=0;

    cin >> N;

    for(i=1; i<=N; i++){
        cin >> A[i];
        sum += A[i];
        sum %= mod;
    }

    for(i=1; i<=N-1; i++){
        sum -= A[i];
        if(sum<0) sum += mod;
        ans += ((A[i]*sum) % mod);
        ans %= mod;
    }

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 5144
#![allow(non_snake_case)]
use proconio::input;
// use std::collections::HashMap;

fn main() {
    input! {
        S: String,
        Q: i64,
    }

    // 反転をまじめに扱おうとするとO(N)かかる。
    // 反転しているかどうかフラグを持って、それを最後に解決するようにすれば途中の計算はカットできる

    let mut is_normal = true;
    let mut head = Vec::new();
    let mut tail = Vec::new();

    for _i in 0..Q {
        input! {
            T: i64,
        }

        if T == 1 {
            // 逆転させるクエリ
            is_normal = !is_normal;
        } else {
            input! {
                F: i64,
                C: String,
            }

            if F == 1 {
                // 先頭に追加
                if is_normal {
                    head.push(C);
                } else {
                    tail.push(C);
                }
            } else {
                // 末尾に追加
                if is_normal {
                    tail.push(C);
                } else {
                    head.push(C);

                }
            }
        }
    }

    if is_normal {
        for s in head.iter().rev() {
            print!("{}", s.as_str());
        }

        print!("{}", S);

        for s in tail.iter() {
            print!("{}", s.as_str());
        }
    } else {
        for s in tail.iter().rev() {
            print!("{}", s);
        }

        let r = S.chars().rev().collect::<String>();
        print!("{}", r.as_str());


        for s in head.iter() {
            print!("{}", s.as_str());
        }
    }
    println!("");



}


Measured memory_bytes: 14240
#include <cstdio>
#include <algorithm>

using namespace std;
using ll = long long;

#define Input(x) scanf("%lld",&x);

ll n;
ll a[234567];
ll sum[234567];

bool cond(int index,ll limit)
{
	int nowind = index;
	nowind = lower_bound(sum + nowind, sum + n + n + 1, sum[nowind] + limit) - sum;
	if (nowind > index + n)
	{
		return false;
	}
	nowind = lower_bound(sum + nowind, sum + n + n + 1, sum[nowind] + limit) - sum;
	if (nowind > index + n)
	{
		return false;
	}
	nowind = lower_bound(sum + nowind, sum + n + n + 1, sum[nowind] + limit) - sum;
	if (nowind > index + n)
	{
		return false;
	}
	return true;
}

int main()
{
	Input(n);
	for (int i = 0; i < n; ++i)
	{
		Input(a[i]);
		a[i + n] = a[i];
	}
	sum[0] = 0;
	for (int i = 1; i <= 2 * n; ++i)
	{
		sum[i] = sum[i - 1] + a[i - 1];
	}
	ll answer = 0;
	for (int i = 0; i < n; ++i)
	{
		ll cmin = 0, cmax = sum[n];
		for (int j = 0; j < 100; ++j)
		{
			ll find = (cmin + cmax) / 2;
			if (cond(i, find))
			{
				cmin = find;
			}
			else
			{
				cmax = find;
			}
		}
		answer = max(answer, cmin);
	}
	printf("%lld\n", answer);
	return 0;
}

Measured memory_bytes: 5868
#pragma GCC optimize ("O3")

#include <bits/stdc++.h>


using namespace std;

#ifdef LOCAL
#include <prettyprint.hpp>
#define debug(...)  cerr << "[" << #__VA_ARGS__ << "]: ", d_err(__VA_ARGS__);
#else
#define debug(...) 83;
#endif

void d_err() {
    cerr << endl;
}

template <typename H, typename... T>
void d_err(H h, T... t) {
    cerr << h << " ";
    d_err(t...);
}

#define FOR(i, m, n) for (int i = (m); i < (n); ++i)
#define REP(i, n) FOR(i, 0, n)
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define bcnt __builtin_popcountll

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef pair<ll,ll> Pll;
typedef pair<int,int> Pin;

ll INF = 1e16;
int inf = 1e9;
ll MOD = 1e9+7;

struct mint {
    ll x; // typedef long long ll;
    mint(ll x=0):x((x%MOD+MOD)%MOD){}
    mint operator-() const { return mint(-x);}
    mint& operator+=(const mint a) {
        if ((x += a.x) >= MOD) x -= MOD;
        return *this;
    }
    mint& operator-=(const mint a) {
        if ((x += MOD-a.x) >= MOD) x -= MOD;
        return *this;
    }
    mint& operator*=(const mint a) {
        (x *= a.x) %= MOD;
        return *this;
    }
    mint operator+(const mint a) const {
        mint res(*this);
        return res+=a;
    }
    mint operator-(const mint a) const {
        mint res(*this);
        return res-=a;
    }
    mint operator*(const mint a) const {
        mint res(*this);
        return res*=a;
    }
    mint pow(ll t) const {
        if (!t) return 1;
        mint a = pow(t>>1);
        a *= a;
        if (t&1) a *= *this;
        return a;
    }
    // for prime MOD
    mint inv() const {
        return pow(MOD-2);
    }
    mint& operator/=(const mint a) {
        return (*this) *= a.inv();
    }
    mint operator/(const mint a) const {
        mint res(*this);
        return res/=a;
    }
};

ostream& operator << (ostream& os, const mint a) {
    os << a.x;

    return os;
}


void SOE(ll N, vi & p) {
    int m = int(floor(sqrt(N))) + 1;
    int s[m];
    REP(i ,m) s[i] = i;

    FOR (i, 2, m) {
        if (s[i] != i) continue;

        p.pb(i);

        for (int j = i+i; j <= m; j += i) {
            s[j] = i;
        }
    }
}


int main(){
    cin.tie(0);
    ios_base::sync_with_stdio(false);
    cout << fixed << setprecision(20);
    
    int N;
    cin >> N;

    vi p;
    SOE(N, p);

    map<int, int> m;
    FOR(i, 2, N + 1) {
        int n = i;
        REP(i, p.size()) {
            int cnt = 0;
            while(n % p[i] == 0) {
                ++cnt;
                n /= p[i];
            }
            if (cnt > 0) m[p[i]] += cnt;
        }
        if (n > 1) m[n] += 1;
    }

    mint ans = 1;
    for(auto it = m.begin(); it != m.end(); ++it) {
        mint c = it->se;
        ans *= (c + 1);
    }

    cout << ans << endl;
}


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

const int mod = 1000000007;
int n, i, j, m;
int e [22][22];
int dp [2100001];
vector <int> masks [101];

int main ()
	{
	scanf ("%d",&n);
	for (i=1; i<=n; i++)
		for (j=1; j<=n; j++)
			scanf ("%d",&e[i][j]);
	for (m=0; m<(1<<n); m++)
		masks[__builtin_popcount(m)].push_back(m);
	dp[0]=1;
	for (i=1; i<=n; i++)
		for (int mask : masks[i])
			for (j=1; j<=n; j++)
				if (e[i][j] && (mask&(1<<(j-1))))
					{
					dp[mask]+=dp[mask^(1<<(j-1))];
					if (dp[mask]>=mod)
						dp[mask]-=mod;
					}
	printf ("%d\n",dp[(1<<n)-1]);
	return 0;
	}


Measured memory_bytes: 17852
#include<stdio.h>
#include <cstdio>
#include <iostream>
#include <iomanip>
#include <string>
#include <algorithm>
#include <vector>
#include <math.h>
#include<stack>
#include <queue>
#include<map>
#include <set>
#include<math.h>
using namespace std;
#define int long long
#define ll long long
#define rep(i,n) for(ll i=0;i<n;++i)
#define loop(i,m,n) for(ll i=m;i<n;++i)
#define ggr getchar(); getchar();return 0;
#define pie 3.141592653589793238462643383279
#define elif else if
#define P pair<ll,ll>
const int inf = 1000000007;
int bin(int bina) {
	int ans = 0;
	for (int i = 0; bina > 0; i++)
	{
		ans = ans + (bina % 2) * pow(10, i);
		bina = bina / 2;
	}
	return ans;
}
bool prime(int n) {
	for (ll i = 2; i <= sqrt(n); i++) {
		if (n % i == 0)return false;
	}
	return n != 1;
}
int gcd(int x, int y) {
	if (y == 0)return x;
	return gcd(y, x % y);
}
int lcm(int x, int y) {
	return x * y / gcd(x, y);
}
int kai(int x) {
	if (x == 0)return 1;
	return kai(x - 1) * x % inf;
}
int mod_pow(int x, int y, int mod) {
	int res = 1;
	while (y > 0) {
		if (y & 1) {
			res = res * x % mod;
		}
		x = x * x % mod;
		y >>= 1;
	}
	return res;
}
int comb(int x, int y) {
	return kai(x)* mod_pow(kai(x - y), inf - 2, inf) % inf * mod_pow(kai(y), inf - 2, inf) % inf;
}

signed main() {
	int a, b;
	cin >> a >> b;
	if (a < 6) {
		cout << 0 << endl;
	}
	else if (a < 13) {
		cout << b / 2 << endl;
	}
	else {
		cout << b << endl;
	}
}

Measured memory_bytes: 256
<?php
$n = (int)(fgets(STDIN));
$towns = [];

for ($i = 0; $i < $n; $i++) {
     $towns[$i] = explode(" ", trim(fgets(STDIN)));
}

$sum = [];
for ($mask = 0; $mask < (1 << $n); $mask++) {
    if(substr_count(decbin($mask), "1") !== 2) continue;
    
    $tmp = [];
    for ($i = 0; $i < $n; $i++) {
         if(($mask >> $i) & 1) {
             $tmp[] = $i;
         }
    }
     
    $sum[] = sqrt(pow(($towns[$tmp[0]][0] - $towns[$tmp[1]][0]), 2) + pow(($towns[$tmp[0]][1] - $towns[$tmp[1]][1]), 2));
}

$average = array_sum($sum) / count($sum);
echo $average * ($n - 1) ;

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

int main() {
    int n,z,w; cin >> n >> z >> w;
    vector<int> a(n);
    rep(i,n) cin >> a[i];
    int ans;
    if (n == 1) ans = abs(w - a[n - 1]);
    else ans = max(abs(w - a[n - 1]),abs(a[n - 1] - a[n - 2]));
    cout << ans << endl;
}

Measured memory_bytes: 256
#include<stdio.h>

int main(){
    
    int h = 0;
    int w = 0;
    int i = 0;
    int j = 0;
    
    while(1){
        scanf("%d%d",&h,&w);
        
        if(h==0 && w==0){
            break;
        }
        
        for(i=0;i<h;i++)
        {
            for(j=0;j<w;j++)
            {
                if((i+j)%2==0){
                    printf("#");  
                }else{
                    printf(".");
                }
                
            }
            printf("\n");
        }
        printf("\n");
    }
    return 0;
}


Measured memory_bytes: 2044
import java.util.*;
import java.lang.*;


public class Main {

    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int m1 = sc.nextInt();
        int d1 = sc.nextInt();
        int m2 = sc.nextInt();
        int d2 = sc.nextInt();
        if(m1==m2) System.out.println(0);
        else System.out.println(1);

    }
}


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

int main(){
	string s; cin >> s;
	int len = s.l_ength();
	for( int i = 0; i < len; ++i ){
		for( int j = 0; i+j <= len ; ++j ){
			string t = s;
			t.erase(i, j);
			if( t == "keyence" ){
				cout << "YES" << endl;
				return 0;
			}
		}		
	}
	cout << "NO" << endl;
	return 0;
}

Measured memory_bytes: 256
//quming
#include<bits/stdc++.h>
#define R register
#define fp(i,a,b) for(R int i=(a),I=(b)+1;i<I;++i)
#define fd(i,a,b) for(R int i=(a),I=(b)-1;i>I;--i)
#define go(u) for(int i=head[u],v=e[i].v;i;i=e[i].nx,v=e[i].v)
template<class T>inline bool cmax(T&a,const T&b){return a<b?a=b,1:0;}
template<class T>inline bool cmin(T&a,const T&b){return a>b?a=b,1:0;}
using namespace std;
typedef long long ll;
const int N=1005;
int a[N],n,ans,m;
int main(){
	ll n,res;scanf("%lld",&n);
	res=1e18;
	fp(i,1,sqrt(n))if(n%i==0)cmin(res,i+n/i-2);
	printf("%lld\n",res);
	return 0;
}

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

using ll = long long;

signed main(){
	ll n;
	cin >> n;

	vector<ll>v(n);
	for(ll i=0;i<n;i++){
		cin >> v[i];
	}

	vector<ll>a(n);
	a[0] = v[0];

	for(ll i=1;i<n;i++){
		a[i] = max(v[i],a[i-1]);
	}

	ll sum = 0;
	for(ll i=0;i<n;i++){
		sum = sum + abs(a[i]-v[i]);
	}
	
	cout << sum << "\n";

	return 0;
}

Measured memory_bytes: 6360
import sys
n,k=map(int,input().split())
s=[]
tmp_a=[]
tmp=0
for i in range(n):
    a,b=map(int,input().split())
    tmp_a.append(a)
    s.append([a,b])#aをb個挿入する
s.sort()
tmp1_a=set(tmp_a)
sS=[]
s_sum=s[0][1]
for i in range(1,n):
    if s[i-1][0]==s[i][0]:
        s_sum+=s[i][1]
    else:
        sS.append([s[i-1][0],s_sum])
        s_sum=0
        s_sum+=s[i][1]
    if i==(n-1):
        sS.append([s[i][0],s_sum])
for i in range(len(tmp1_a)):
    tmp+=sS[i][1]
    if tmp>=k:
        print(sS[i][0])
        break


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

const ll MOD=1000000007;

ll abs1(ll a){
  if(a>=0)return a;
  else return -a;
}

ll pow1(ll a,ll b){
  ll p=1;
  for(int i=0;i<b;i++){
    p*=a;
  }
  return p;
}

int digit(ll a,ll b){
  int i=0;
  while(a!=0){
    a/=b;
    i++;
  }
  return i;
}

ll gcd1(ll a,ll b){
  if(a==0 && b==0)return 0;
  ll n;
  while(a%b!=0){
    n=a%b;
    a=b;
    b=n;
  }
  return b;
}

ll solveLinear(ll n,ll m,ll c){
  if(n==0 && m==0)return 0;
  ll a[100],b[100];
  a[0]=n;b[0]=m;
  int i=1;
  while(b[i-1]!=0){
    a[i]=b[i-1];
    b[i]=a[i-1]%b[i-1];
    i++;
  }
  n=i;
  if(c%a[n-1]!=0){
    return 0;
  }
  ll x=c/a[n-1],y=0;
  for(i=1;i<n;i++){
    ll cnt=x;
    x=y;
    y=cnt-(a[n-i-1]/b[n-i-1])*y;
  }
  return x;
}

ll modRev(ll a,ll p=MOD){
  a%=p;
  ll n=solveLinear(a,p,1);
  n%=p;
  if(n<0)return n+p;
  return n;
}

ll binom1(ll n,ll k,ll p=MOD){
  if(n<0 || k<0 || n<k)return 0;
  int i;
  ll ret=1;
  for(i=0;i<k;i++){
    ret=ret*(n-i)/(i+1);
    if(ret>=p)ret%=p;
  }
  return ret;
}

int main(){
  int i,j,k,cnt=0;
  string s;
  cin>>s;
  int n=s.size();
  for(i=0;i<26;i++){
    for(j=1;j<n;j++){
      if(s[j-1]=='a'+i && s[j]=='a'+i){
        cout<<j<<" "<<j+1<<endl;
        return 0;
      }
    }
    for(j=2;j<n;j++){
      if(s[j-2]=='a'+i && s[j]=='a'+i){
        cout<<j-1<<" "<<j+1<<endl;
        return 0;
      }
    }
  }
  cout<<-1<<" "<<-1<<endl;
}


Measured memory_bytes: 512
#include <stdio.h>

int main()
{
    int x, y, a=1, b=2, c=3;
    scanf("%d%d", &x, &y);
    if(x==2 && y==1)
    {
        printf("%d\n", c);
    }
    else if(x==1 && y==2)
    {
        printf("%d\n", c);
    }
    else if(x==1 && y==3)
    {
        printf("%d\n", b);
    }
    else if(x==3 && y==1)
    {
        printf("%d\n", b);
    }
    else if(x==3 && y==2)
    {
        printf("%d\n", a);
    }
    else if(x==2 && y==3)
    {
        printf("%d\n", a);
    }

    return 0;
}


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

int main() {
    int n,k;cin>>n>>k;
    pair<int,int> a[n];
    for (int i=0;i<n;i++) {
        int b,c;cin>>b>>c;
        b--;
        a[i]={c,b};
    }
    sort(a,a+n,greater<pair<int,int>>());
    int used[n]{};
    stack<int> dup;
    ll sum=0;
    ll c=0;
    for (int i=0;i<k;i++) {
        sum+=a[i].first;
        if (used[a[i].second])
            dup.push(a[i].first);
        else {
            used[a[i].second]=1;
            c++;
        }
    }
    ll mx=sum+c*c;
    for (int i=k;i<n&&dup.size();i++)
        if (!used[a[i].second]) {
            sum-=dup.top();
            dup.pop();
            sum+=a[i].first;
            used[a[i].second]=1;
            c++;
            mx=max(mx,sum+c*c);
        }
    cout<<mx<<endl;
    return 0;
}

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

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

#define fi first
#define se second
#define repl(i,a,b) for(ll i=(ll)(a);i<(ll)(b);i++)
#define rep(i,n) repl(i,0,n)
#define all(x) (x).begin(),(x).end()
#define dbg(x) cout<<#x"="<<x<<endl
#define mmax(x,y) (x>y?x:y)
#define mmin(x,y) (x<y?x:y)
#define maxch(x,y) x=mmax(x,y)
#define minch(x,y) x=mmin(x,y)
#define uni(x) x.erase(unique(all(x)),x.end())
#define exist(x,y) (find(all(x),y)!=x.end())
#define bcnt __builtin_popcount

#define INF 1e16
#define mod 1000000007

ll N,M,K;
ll x[100010],d[100010];
ll ch[61][100010];
ll res[100010];

int main(){
  cin>>N;
  rep(i,N){
    cin>>x[i];
  }
  rep(i,N-1){
    d[i]=x[i+1]-x[i];
    ch[0][i]=i;
    res[i]=i;
  }
  cin>>M>>K;
  rep(i,M){
    ll a;
    cin>>a;
    a--;
    swap(ch[0][a-1],ch[0][a]);
  }

  rep(i,60){
    rep(j,N-1){
      ch[i+1][j]=ch[i][ch[i][j]];
    }
  }

  rep(i,60){
    if((K>>i)&1LL){
      rep(j,N-1){
        res[j]=ch[i][res[j]];
      }
    }
  }

  ll ans=x[0];
  rep(i,N){
    cout<<ans<<endl;
    ans+=d[res[i]];
  }

  return 0;
}


Measured memory_bytes: 51200
<?php
list($x, $y) = ints();
if (abs($x) === abs($y)) exit('1');
if (abs($x) < abs($y)) {
    $c = abs($y) - abs($x);
    if ($x >= 0 && $y < 0) $c += 1;
    elseif ($x < 0 && $y > 0) $c += 1;
    elseif ($x < 0 && $y < 0) $c += 2;
    echo $c;
} else {
    $c = abs($x) - abs($y);
    if ($x > 0 && $y > 0) $c += 2;
    elseif ($x > 0 && $y <= 0) $c += 1;
    elseif ($x < 0 && $y > 0) $c += 1;
    echo $c;
}
function ints()
{
    return array_map('intval', explode(' ', trim(fgets(STDIN))));
}


Measured memory_bytes: 16184
s = input()
dic = {}

for i in s:
  if i in dic:
    dic[i] += 1
  else:
    dic[i] = 1
if len(dic.keys()) == 2:
  for i in dic.values():
    if i != 2:
      print('No')
      exit()
  print('Yes')
else:
  print('No')


Measured memory_bytes: 2940
def sSort(A):
    count = 0
    for i in range(len(A)):
        minj = i
        for j in range(i, len(A)):
            if A[j] < A[minj]:
                minj = j
        if minj != i:
            count += 1
        tmp = A[i]
        A[i] = A[minj]
        A[minj] = tmp
    return A, count

if __name__ == '__main__':
    length = input()
    data = [int(x) for x in input().split()]
    data_s, c = sSort(data)
    print (' '.join([str(x) for x in data_s]))
    print (c)


Measured memory_bytes: 5608
#include<iostream>
#include<vector>
#include<string>
#include<cstdio>
using namespace std;

typedef long long int ll;

int main(){

    string s;
    cin >> s;
    int a = s[0] - '0';
    int b = s[1] - '0';
    int c = s[2] - '0';
    int d = s[3] - '0';


    if(a+b+c+d == 7){
        printf("%d+%d+%d+%d=7\n",a,b,c,d);
        return 0;
    }
    if(a+b+c-d == 7){
        printf("%d+%d+%d-%d=7\n",a,b,c,d);
        return 0;
    }
    if(a+b-c+d == 7){
        printf("%d+%d-%d+%d=7\n",a,b,c,d);
        return 0;
    }
    if(a+b-c-d == 7){
        printf("%d+%d-%d-%d=7\n",a,b,c,d);
        return 0;
    }
    if(a-b+c+d == 7){
        printf("%d-%d+%d+%d=7\n",a,b,c,d);
        return 0;
    }
    if(a-b+c-d == 7){
        printf("%d-%d+%d-%d=7\n",a,b,c,d);
        return 0;
    }
    if(a-b-c+d == 7){
        printf("%d-%d-%d+%d=7\n",a,b,c,d);
        return 0;
    }
    if(a-b-c-d == 7){
        printf("%d-%d-%d-%d=7\n",a,b,c,d);
        return 0;
    }

    return 0;
}

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

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

  int temp;
  if (S == "SUN") temp = 7;
  if (S == "MON") temp = 6;
  if (S == "TUE") temp = 5;
  if (S == "WED") temp = 4;
  if (S == "THU") temp = 3;
  if (S == "FRI") temp = 2;
  if (S == "SAT") temp = 1;

  cout << temp << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <math.h>
#include <stdio.h>
#include <cstdio>
using namespace std;
int main(){
	while(1){
		int n;
		cin>>n;
		if(n==-1) break;
		double x,y,s=0,c=1;
		for(int i=2;i<=n;i++){
			double a=1/sqrt((double)i),b=sqrt((double)(i-1)/(double)i),d=s;
			s = s*b+c*a;
			c = c*b-d*a;
		}
		x = sqrt((double)n)*c;
		y = sqrt((double)n)*s;
		printf("%.2lf\n%.2lf\n",x,y);
	}
	return 0;
}

Measured memory_bytes: 1196
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
#include <cmath>
#include <random>
#include <queue>

using namespace std;

int main()
{
	int N ,X;

	cin >> N >> X;

	vector<int> Ms(N);

	int sum = 0;
	int min_m = 1e9;

	for (int ni = 0; ni < N; ni++) {
		cin >> Ms[ni];
		sum += Ms[ni];
		if (Ms[ni] < min_m) {
			min_m = Ms[ni];
		}
	}



	int  ans = N + (X - sum) / min_m;
	//printf("%.9f", ans);
	std::cout << ans;

	return 0;
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define all(a) (a).begin(),(a).end()
#define cinv(v,n) for(size_t i=0;i<(n);i++){cin>>(v)[i];}
#define nvec(type,v,n) vector<type> v(n);cinv(v,n)
#define npairs(type1,type2,v,n) vector<pair<type1,type2>> v(n);for(size_t i=0;i<(n);i++){cin>>v[i].first>>v[i].second;}
#define ntuples(type1,type2,type3,v,n) vector<tuple<type1,type2,type3>> v(n);for(size_t i=0;i<(n);i++){cin>>get<0>(v[i])>>get<1>(v[i])>>get<2>(v[i]);}
 
#define min_index(v) size_t(min_element(all(v))-(v).begin())
#define max_index(v) size_t(max_element(all(v))-(v).begin())
#define min_e(v) *min_element(all(v))
#define max_e(v) *max_element(all(v))
 
#define count_le(v,a) size_t(upper_bound(all(v),a)-(v).begin())
#define count_lt(v,a) size_t(lower_bound(all(v),a)-(v).begin())
#define count_ge(v,a) size_t((v).end()-lower_bound(all(v),a))
#define count_gt(v,a) size_t((v).end()-upper_bound(all(v),a))
 
#define order(neq_sl) [](const auto s, const auto l){return neq_sl;}
#define make_lr(v,type,l,r) vector<type> l(n+1),r(n+1);FOR(i,n){l[i+1]=l[i]+v[i];r[i+1]=r[i]+v[n-1-i];}
 
#define acm accumulate
#define SUM(v) acm(all(v),0l)
 
int main() {
  int n;
  cin>>n;
  ntuples(int, int, long, v, n);
  sort(all(v),order(get<2>(s)>get<2>(l)));
  for (int x = 0; x < 101; x++) {
    for (int y = 0; y < 101; y++) {
      long h = get<2>(v[0])+abs(get<0>(v[0])-x)+abs(get<1>(v[0])-y);
   //   cout<<get<2>(v[0])<<abs(get<0>(v[0])-x)<<abs(get<1>(v[0])-y);
      for (size_t i = 1; i < n; i++) {
    //    cout<<(get<2>(v[i])==0&&h-abs(get<0>(v[i])-x)-abs(get<1>(v[i])-y)<0)<<endl<<h-abs(get<0>(v[i])-x)-abs(get<1>(v[i])-y)<<endl;
        if((!(get<2>(v[i])==0&&h-abs(get<0>(v[i])-x)-abs(get<1>(v[i])-y)<0))&&h!=get<2>(v[i])+abs(get<0>(v[i])-x)+abs(get<1>(v[i])-y))break;
        if(i==n-1)cout<<x<<" "<<y<<" "<<h<<endl;
      }
      
    }
  }
}

Measured memory_bytes: 256
import java.io.InputStream;
import java.io.PrintStream;
import java.util.Arrays;
import java.util.Scanner;

public class Main {
	InputStream in = System.in;
	PrintStream out = System.out;

	public void _main(String[] args) {
		Scanner sc = new Scanner(in);

		int m1 = sc.nextInt();
		int d1 = sc.nextInt();
		int m2 = sc.nextInt();
		int d2 = sc.nextInt();

		sc.close();

		if (m1 != m2) {
			out.println(1);
		} else {
			out.println(0);
		}

	}

	public static void main(String[] args) {
		new Main()._main(args);
	}
}


Measured memory_bytes: 22356
#include <iostream>
#include <iomanip>
#include <vector>
#include <cmath>
#include <algorithm>
#include <iomanip>
#include <cstring>
#define rep(i, N) for (int i = 0; i < (int)N; i++)
using namespace std;
typedef long long ll;
const ll LLINF = 9223372036854775807;
const int MOD = 1000000007;

int main() {
  int A, B, C, D; cin >> A >> B >> C >> D;
  int result = min(A,B) + min(C,D);
  cout << result << endl;
  return 0;
}

Measured memory_bytes: 256
def solve(args):
    n, y = args

    #.
    for i in range(n+1):
        for j in range(0, n-i+1):
            #.
            k = n - i - j

            #.
            if i*10000 + j*5000 + k*1000 == y:
                return "{} {} {}".format(i, j, k)

    return "-1 -1 -1"

print(solve(map(int, input().split())))


Measured memory_bytes: 9140
#include <bits/stdc++.h>
#include<string.h>
using namespace std;
#define FAST ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define Max(x,y,z) max(x,max(y,z))
#define Min(x,y,z) min(x,min(y,z))
#define fr(i,s,e) for(i=s;i<e;i++)
#define rf(i,s,e) for(i=s-1;i>=e;i--)
#define pb push_back
#define eb emblace_back
#define mp make_pair
#define ff first
#define ss second
//#define int   long long
#define ll   long long
#define trace1(x)                cerr<<#x<<": "<<x<<endl
#define trace2(x, y)             cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
#define trace3(x, y, z)          cerr<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
#define trace4(a, b, c, d)       cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl
#define trace5(a, b, c, d, e)    cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<endl
#define trace6(a, b, c, d, e, f) cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<" | "<<#f<<": "<<f<<endl
#define vl vector<long long>
#define inf (1LL<<61)
#define vi vector<int>
#define vii vector< vector<int> >
#define vll vector< vector<long long> >
#define vpi vector< pair<int,int> >
#define vpl vector< pair<ll,ll> >
#define viii vector< vector<vector<int> > >
typedef pair<pair<int, int>,int> P;
#define cd complex<double>
#define PI 4*atan(1)
#define mod %1000000007
#define pi 3.14159265358979323846//20 decimals
#define ld long double

int main()
{
	FAST;
	ll a, b;
	cin >> a >> b;
	cout << max(a + b, max(a-b, a*b));
}


Measured memory_bytes: 256
#include <cstdio>
#include <cstring>
using namespace std;
const int mod = 1e9+7;
const int maxn = 1e6+5;
typedef long long ll;
int f[maxn];

int up(int a,int b){
    a+=b;
    if(a>=mod) a-=mod;
    return a;
}

int mul(ll  a, ll  b){
    return ((a%mod) *(b%mod)) % mod;
}

int main(){
    int n;
    int sum = 0;
    scanf("%d", &n);
    f[1] = n;f[2] = mul(n,n);
    
    for(int i = 3; i <= n; i++){
        f[i] = up(f[i-1],sum);
        f[i] = up(f[i],mul(n-1,n-1));
        f[i] = up(f[i],n-i+2);
        sum = up(sum,f[i-2]);
    }
    printf("%d\n", f[n]);
    return 0;
}

Measured memory_bytes: 4096
#include <bits/stdc++.h>
//#include <atcoder/all>
using namespace std;
//using namespace atcoder;
#define ll long long
#define FOR(i, a, b) for(int i=(a);i<(b);++i)
#define rep(i, n) FOR(i, 0, n)
#define rep1(i, n) FOR(i, 1, n+1)
#define rrep(i, n) for (int i = ((int)(n)-1); i >= 0; --i)
#define whole(x) (x).begin(),(x).end()
#define rwhole(x) (x).rbegin(), (x).rend()
#define UNIQUE(v) v.erase(unique(v.begin(), v.end()), v.end())
#define P pair<int, int>
#define debug(var) cerr << "[" << #var << "] " << var << endl
template<typename T1, typename T2>
bool chmax(T1 &a,T2 b){if(a<b){a=b;return true;}else return false;}
template<typename T1, typename T2>
bool chmin(T1 &a,T2 b){if(a>b){a=b;return true;}else return false;}
#define vi vector<int>
#define vl vector<ll>
#define pb push_back
#define eb emplace_back
#define fi first
#define se second
#define pr(s) cout << (s) << '\n'
const ll mod = 1000000007;
const int dx[] = {-1,0,1,0};
const int dy[] = {0,-1,0,1};
const int INF = 1001001001;
const ll INFll = 1E+18;


int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    ll a, b, k;
    cin >> a >> b >> k;
    rep(i, k) {
        if (i%2==1) swap(a, b);
        a = a/2*2;
        b += a/2;
        a = a/2;
        if (i%2==1) swap(a, b);
    }
    cout << a << " " << b << endl;
    
    return 0;
}


Measured memory_bytes: 3604
#include <algorithm>
#include <iostream>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <list>
#include <cmath>
#include <stack>
#include <string>
#include <cstring>
#include <numeric>
#include <iomanip>
#include <fstream>
using namespace std;
double pi=3.1415926535;
int main(){
	double r;
	cin>>r;
	cout<<fixed<<setprecision(12)<<2*r*pi<<endl;
	return 0;
}

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

using namespace std;

int main(){
	int q;
	cin >> q;
	for(int i=0;i<q;i++){
		int n;
		cin >> n;
		int c=0;
		while(n>=10){
			string s = to_string(n);
			n=0;
			for(int unsigned j = 1;j<s.size();j++){
				n = max(n,stoi(s.substr(0,j))*stoi(s.substr(j)));
			}
			c++;
		}
		cout << c << endl;
	}
	return 0;
}

Measured memory_bytes: 3276
// Sakhiya07 - Yagnik Sakhiya
 
#include <bits/stdc++.h>
using namespace std;
 
#define ll long long int
#define ld long double
#define ff first
#define ss second
#define pb push_back
#define mp make_pair

#define bp __builtin_popcountll
#define MOD  1000000007
#define FAST ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);srand(time(NULL));
const int N = 200005;

#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
using namespace __gnu_pbds; 
#define ordered_set tree<ll, null_type,less<ll>, rb_tree_tag,tree_order_statistics_node_update>

void solve()
{
	ll a[] = {1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51};
	ll n;
	cin >> n;
	n--;
	cout<<a[n];
}
 
int main()
{
    FAST;
    ll t = 1;
   // cin >> t;
    while(t--)
    {
    	solve();
    }
}

Measured memory_bytes: 256
// RAM RAM

#include <bits/stdc++.h>
#define int long long
#define pb push_back
#define ppb pop_back
#define vi vector<int>
#define mp make_pair

using namespace std;

int32_t main()
{
	ios_base::sync_with_stdio(false);cin.tie(0);
	
	
	int n,l;cin>>n>>l;
	string s[n];
	for(int i=0;i<n;i++){
		cin>>s[i];
	}

	sort(s,s+n);
	for(string x:s){
		cout<<x;
	}cout<<endl;
}

Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;

namespace AtCoder
{
    class Program
    {
        static void Main(string[] args)
        {
            //[summary]C - Five Transportations
            long n = long.Parse(Console.ReadLine());
            long capacity = Capacities(5).Min();

            if (capacity >= n)
            {
                Console.WriteLine(5);
            }
            else
            {
                long time = (n - capacity) / capacity + 5;

                long remainder = (n - capacity) % capacity;
                
                if (remainder > 0)
                {
                    time++;
                }

                Console.WriteLine(time);
            }
        }

        static List<long> Capacities(int count = 0)
        {
            //[summary]コンソールの値を読み込む
            var list = new List<long>();
            
            for (int i = 0; i < count; i++)
            {
                string s = Console.ReadLine();
                list.Add(long.Parse(s));
            }

            return list;
        }
    }
}

Measured memory_bytes: 13268
#include <bits/stdc++.h>
#include <assert.h>
using namespace std;
using i64 = long long;

int main()
{
  i64 a, b;
  cin >> a >> b;
  if (a < 10 && b < 10)
    cout << a * b << endl;
  else
    cout << -1 << endl;
  return 0;
}


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

MOD = 10 ** 9 + 7

def main():
    n, k = map(int, input().split())
    res = 0
    for l in range(k, n + 2):
        res += l * (n + 1 - l) + 1
        res %= MOD
    print(res)

if __name__ == "__main__":
    main()


Measured memory_bytes: 9168
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <functional>
#include <queue>
#include <string>
#include <cstring>
#include <numeric>
#include <cstdlib>
#include <cmath>
#include <map>
#include <unordered_map>
#include <set>
using namespace std;

typedef long long ll;

#define INF 10e17 // 4倍しても(4回足しても)long longを溢れない
#define rep(i,n) for(int i=0; i<n; i++)
#define rep_r(i,n,m) for(int i=m; i<n; i++)
#define END cout << endl
#define MOD 1000000007
#define pb push_back
#define sorti(x) sort(x.begin(), x.end())
#define sortd(x) sort(x.begin(), x.end(), std::greater<int>())
#define debug(x) std::cerr << (x) << std::endl;
#define roll(x) for (auto itr : x) { debug(itr); }

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

using p = pair<ll,ll>;

int main() {
  ll n;
  cin >> n;
  vector<ll> a(n), b(n);
  vector<p> pa(n);

  rep(i, n) {
    cin >> a[i] >> b[i];
    pa[i] = make_pair(b[i], a[i]);
  }
  sorti(pa);

  ll tas = 0, bf = 0;
  bool flag = true;
  bool flag2 = true;

  for (int i = 0; i < n; ++i) {
    tas += pa[i].second;
    if (tas > pa[i].first) flag = false;
  }

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



Measured memory_bytes: 6528
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <cstring>
#include <queue>
#include <set>
#include <map>
#include <functional>
#include <string>
#define MOD 1000000007

using namespace std;
typedef long long int ll;
typedef pair <int,int> P;

int main()
{
	int S;
	scanf("%d",&S);
	ll ret=0;
	int sum=0,tw=10,start=1;
	int nxt=10;
	int f=1,t=1;
	for(int i=1;i<100000000;i++)
	{
		if(i==nxt)
		{
			nxt*=10;
			t++;
		}
		sum+=t;
		while(sum>S)
		{
			sum-=f;
			start++;
			if(start==tw)
			{
				tw*=10;
				f++;
			}
		}
		if(sum==S) ret++;
	}
	//printf("%lld\n",ret);
	ll all=900000000;
	for(int k=8;k<=S;k++)
	{
		int mx=S/k;
		int t=S%k;
		if(t==0) mx--,t+=k;
		if(mx-t>=0)
		{
			ret+=(mx-t)/(k+1)+1;
			if(ret>=MOD) ret-=MOD;
			if(S%(k+1)==0)
			{
				int len=S/(k+1);
				ret+=all-len;
				if(ret<0) ret+=MOD;
				if(ret>=MOD) ret-=MOD;
			}
		}
		all=all*10LL%MOD;
	}
	printf("%lld\n",ret);
	return 0;
}


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

using namespace std;

int main(int argc, char const *argv[]) {
  string s;
  long long int k, idx=0;
  cin >> s;
  cin >> k;
  for (long long int i = 0; i < k; i++) {
    if (s[i]=='1') continue;
    else {
      idx = i;
      break;
    }
  }
  cout << s[idx] << endl;
  return 0;
}


Measured memory_bytes: 256
// 問題の URL を書いておく
// 

#include <algorithm>
#include <array>
#include <bitset>
#include <cmath>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <vector>

using namespace std;

//#define ENABLE_PRINT

#if defined(ENABLE_PRINT)

#define Print(v) \
do {\
    cout << #v << ": " << v << endl; \
}while(0)

#define PrintVec(v) \
do {\
    for(int __i = 0; __i < v.size(); ++__i) \
    { \
        cout << #v << "[" << __i << "]: " << v[__i] << endl; \
    }\
}while(0)

#else

#define Print(v) ((void)0)
#define PrintVec(v) ((void)0)

#endif

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

using ll = int64_t;

int main(int, const char**)
{
    int x;
    cin >> x;
    if(x >= 400 && x <= 599)
    {
        cout << 8 << endl;
    }
    else if(x >= 500 && x <=  799)
    {
        cout << 7 << endl;
    }
    else if(x >= 800 && x <=  999)
    {
        cout << 6 << endl;
    }
    else if(x >= 1000 && x <=  1199)
    {
        cout << 5 << endl;
    }
    else if(x >= 1200 && x <=  1399)
    {
        cout << 4 << endl;
    }
    else if(x >= 1400 && x <=  1599)
    {
        cout << 3 << endl;
    }
    else if(x >= 1600 && x <= 1799)
    {
        cout << 2 << endl;
    }
    else if(x >= 1800 && x <=  1999)
    {
        cout << 1 << endl;
    }
    return 0;
}


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

int main() {
	
	vector<int> a(3);
	for (int i = 0; i < 3; i++) {
		cin >> a.at(i);
	}
	sort(a.begin(), a.end());

	cout << a.at(0) + a.at(1) << endl;
	

}

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

#define _USE_MATH_DEFINES
#include<cstdio>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <deque>
#include <algorithm>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#include <iterator>
#include<iomanip>
#include<unordered_set>
#include<bitset>
#include<complex>

using namespace std;

#define rep(i,a,b) for(int i=(a), i##_len=(b);i<i##_len;i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define all(c) begin(c),end(c)

#define int ll
#define SZ(x) ((int)(x).size())
#define pb push_back
#define mp make_pair

//typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<ll, int> pli;
typedef pair<double, double> pdd;
typedef vector< vector<int> > mat;

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

const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD = (int)1e9 + 7;
const double EPS = 1e-9;

int get_gcd(int n, int m) {
	if (n < m) swap(n, m);
	while (m) {
		swap(n, m);
		m %= n;
	}
	return n;
}

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

	int N;
	int mul = 1;
	cin >> N;
	int T;
	rep(i, 0, N)
	{
		cin >> T;
		mul = mul / get_gcd(mul, T)*T;
	}

	cout << mul << endl;

	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <math.h>
#include <numeric>
#include <sstream>
#include <set>
#include <map>
#define LLMAX 9223372036854775807

using namespace std;
using ll = long long;

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

    string ret;
    for (ll i = 0; i < base.size(); ++i) {
        if (base.at(i) == 'A') {
            ret.push_back('T');
        }
        else if (base.at(i) == 'T') {
            ret.push_back('A');
        }
        else if (base.at(i) == 'G') {
            ret.push_back('C');
        }
        else if (base.at(i) == 'C') {
            ret.push_back('G');
        }
    }

    cout << ret << endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<set>
#define LL long long
LL N;
LL mod = 1000000000 + 7;
LL T[100010];
LL A[100010];
LL ans = 1;
int main() {
	std::cin >> N;
	LL bef = 0;
	for (int i = 1; i <= N; i++) {
		std::cin >> T[i];
	}
	for (int i = 1; i <= N; i++) {
		std::cin >> A[i];
	}
	if (T[1] > A[1] || T[N] < A[N]) {
		std::cout << 0 << std::endl;
		return 0;
	}
	for (int i = 2; i < N; i++) {
		if (T[i] == T[i - 1]) {
			if (A[i] == A[i + 1]) {
				ans *= std::min(T[i], A[i]);
			}
			else {
				if (T[i] < A[i]) {
					std::cout << 0 << std::endl;
					return 0;
				}
			}
		}
		else {
			if (A[i] < T[i]) {
				std::cout << 0 << std::endl;
				return 0;
			}
			if (A[i + 1] != A[i] &&  T[i] != A[i]) {
				std::cout << 0 << std::endl;
				return 0;
			}
		}
		ans %= mod;
	}
	std::cout << ans << std::endl;
	return 0;
}

Measured memory_bytes: 1920
#include <cstdio>
#include <cmath>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <algorithm>

#ifdef _DEBUG
#define DMP(x) cerr << #x << ": " << x << "\n"
#else
#define DMP(x) ((void)0)
#endif

const int MOD = 1000000007, INF = 1111111111; 
using namespace std;
typedef long long lint;

int main() {

	cin.tie(nullptr);
	ios::sync_with_stdio(false);

	int N, K;
	cin >> N >> K;

	if (N%K) cout << 1 << "\n";
	else cout << 0 << "\n";

	return 0;
}

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

int32_t main()
{
    int n,k;
    cin>>n>>k;
    int a[n];
    for(int i=0;i<n;i++)
    cin>>a[i];
    sort(a,a+n);
    int ans=0;
    for(int i=0;i<k;i++)
    ans+=a[i];
    
    cout<<ans<<endl;
}

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

int main(){
	ll a,b,c,d;
	cin>>a>>b>>c>>d;
	if(a>=0){
		if(c>=0)cout<<b*d;
		else{
			if(d>=0)cout<<b*d;
			else cout<<a*d;
		}
	}else if(a<0){
		if(b>=0){
			if(c>=0)cout<<b*d;
			else cout<<max({0ll,a*c,b*d});
		}else{
			if(c>0)cout<<b*c;
			else cout<<a*c;
		}
	}
	return 0;
}


Measured memory_bytes: 3632
N = int(input())
A = [0]+list(map(int, input().split()))+[0]
s = 0
for i in range(N+1):
    s += abs(A[i+1]-A[i])
for i in range(1,N+1):
    ans = s - abs(A[i]-A[i-1])-abs(A[i+1]-A[i])+abs(A[i+1]-A[i-1])
    print(ans)

Measured memory_bytes: 13920