akhauriyash/Code-Regression huggingface dataset:
/*
    Code by:-
  ______                                                                __          
 /      \                                                              |  \         
|  ▓▓▓▓▓▓\ ______  ______ ____  ______ ____  __    __       __  ______  \▓▓_______  
| ▓▓___\▓▓|      \|      \    \|      \    \|  \  |  \     |  \|      \|  \       \ 
 \▓▓    \  \▓▓▓▓▓▓\ ▓▓▓▓▓▓\▓▓▓▓\ ▓▓▓▓▓▓\▓▓▓▓\ ▓▓  | ▓▓      \▓▓ \▓▓▓▓▓▓\ ▓▓ ▓▓▓▓▓▓▓\
 _\▓▓▓▓▓▓\/      ▓▓ ▓▓ | ▓▓ | ▓▓ ▓▓ | ▓▓ | ▓▓ ▓▓  | ▓▓     |  \/      ▓▓ ▓▓ ▓▓  | ▓▓
|  \__| ▓▓  ▓▓▓▓▓▓▓ ▓▓ | ▓▓ | ▓▓ ▓▓ | ▓▓ | ▓▓ ▓▓__/ ▓▓     | ▓▓  ▓▓▓▓▓▓▓ ▓▓ ▓▓  | ▓▓
 \▓▓    ▓▓\▓▓    ▓▓ ▓▓ | ▓▓ | ▓▓ ▓▓ | ▓▓ | ▓▓\▓▓    ▓▓     | ▓▓\▓▓    ▓▓ ▓▓ ▓▓  | ▓▓
  \▓▓▓▓▓▓  \▓▓▓▓▓▓▓\▓▓  \▓▓  \▓▓\▓▓  \▓▓  \▓▓_\▓▓▓▓▓▓▓__   | ▓▓ \▓▓▓▓▓▓▓\▓▓\▓▓   \▓▓
                                            |  \__| ▓▓  \__/ ▓▓                     
                                             \▓▓    ▓▓\▓▓    ▓▓                     
                                              \▓▓▓▓▓▓  \▓▓▓▓▓▓                      

*/

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

int main()
{
    int n;
    cin>>n;
    string ss;
    // vector <string> s;
    int countA=0;
    int countW=0;
    int countT=0;
    int countR=0;

    for(int i=0;i<n;i++)
    {
        cin>>ss;
        // s.push_back(ss);

        if(ss=="AC")
        {
            countA++;
        }
        else if(ss=="WA")
        {
            countW++;
        }
        else if(ss=="RE")
        {
            countR++;
        }
        else if(ss=="TLE")
        {
            countT++;
        }
    }

    cout<<"AC"<<" "<<'x'<<" "<<countA<<endl;
    cout<<"WA"<<" "<<'x'<<" "<<countW<<endl;
    cout<<"TLE"<<" "<<'x'<<" "<<countT<<endl;
    cout<<"RE"<<" "<<'x'<<" "<<countR<<endl;
}

Measured memory_bytes: 3568
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
if A % 10 == 0:
	aw = A
else:
	aw = int(A/10)*10 + 10
if B % 10 == 0:
	bw = B
else:
	bw = int(B/10)*10 + 10
if C % 10 == 0:
	cw = C
else:
	cw = int(C/10)*10 + 10
if D % 10 == 0:
	dw = D
else:
	dw = int(D/10)*10 + 10
if E % 10 == 0:
	ew = E
else:
	ew = int(E/10)*10 + 10
V1 = [A,B,C,D,E]
V2 = [aw,bw,cw,dw,ew]
V3 = [V2[j] - V1[j] for j in range(0,5)]
mx = V3.index(max(V3))
print(aw + bw + cw + dw + ew - V2[mx] + V1[mx])



Measured memory_bytes: 3064
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace std;
using namespace __gnu_pbds;
typedef tree<int, null_type, less<int>, rb_tree_tag,tree_order_statistics_node_update> ordered_set;

#define scan(x) do{while((x=getchar())<'0'); for(x-='0'; '0'<=(_=getchar()); x=(x<<3)+(x<<1)+_-'0');}while(0)
char _;
#define complete_unique(a) a.erase(unique(a.begin(),a.end()),a.end())
#define all(a) a.begin(),a.end()
#define println printf("\n");
#define readln(x) getline(cin,x);
#define pb push_back
#define endl "\n"
#define INT_INF 0x3f3f3f3f
#define LL_INF 0x3f3f3f3f3f3f3f3f
#define MOD 1000000007
#define MOD2 1494318097
#define SEED 131
#define mp make_pair
#define fastio cin.tie(0); cin.sync_with_stdio(0);

#define MAXN 12
#define MAXM 1005

typedef unsigned long long ull;
typedef long long ll;
typedef long double ld;
typedef unordered_map<int,int> umii;
typedef pair<int,int> pii;
typedef pair<double,double> pdd;
typedef pair<ll,ll> pll;
typedef pair<int,pii> triple;
typedef int8_t byte;

mt19937 g1(time(0));

int randint(int a, int b){return uniform_int_distribution<int>(a, b)(g1);}
ll randlong(ll a,ll b){return uniform_int_distribution<long long>(a, b)(g1);}

ll gcd(ll a, ll b){return b == 0 ? a : gcd(b, a % b);}
ll lcm(ll a, ll b){return a*b/gcd(a,b);}
ll fpow(ll  b, ll exp, ll mod){if(exp == 0) return 1;ll t = fpow(b,exp/2,mod);if(exp&1) return t*t%mod*b%mod;return t*t%mod;}
ll divmod(ll i, ll j, ll mod){i%=mod,j%=mod;return i*fpow(j,mod-2,mod)%mod;}

int len,num_key,keys[MAXM],cost[MAXM];
int dp[MAXM][1<<MAXN];

int solve(int key, int msk){
	if(msk == 0) return 0;
	if(key == 0) return INT_INF;
	if(dp[key][msk] != -1) return dp[key][msk];
	int res = solve(key-1,msk);
	int nmsk = msk;
	for(int i=0; i<len; i++)
		if((keys[key]&(1<<i)) && (msk&(1<<i)))
			nmsk^=(1<<i);
	res = min(res,solve(key-1,nmsk)+cost[key]);
	return dp[key][msk] = res;
}

int main(){
	scanf("%d %d",&len,&num_key);
	for(int i=1; i<=num_key; i++){
		int m; scanf(" %d %d",&cost[i],&m);
		while(m--){
			int a; scanf(" %d",&a); a--;
			keys[i]|=(1<<a);
		}
	}
	memset(dp,-1,sizeof dp);
	printf("%d\n",solve(num_key,(1<<len)-1)==INT_INF?-1:solve(num_key,(1<<len)-1));
}

Measured memory_bytes: 16384
#include <stdio.h>
#include<string.h>

int main(void)
{
	int N, i, n, min;
	int P[200001];
	
	scanf("%d", &N);
	
	n=0; min=9999999;
	for(i=0; i<N; i++){
		scanf("%d", &P[i]);
	}
	
	for(i=0; i<N; i++){
		if(P[i]<min){
			min=P[i]; n++;
		}
	}
	
	printf("%d", n);
	
	return 0;
}

Measured memory_bytes: 896
// inputに入力データ全体が入る
function Main(input) {
	// 1行目がinput[0], 2行目がinput[1], …に入る
	input = input.split("\n");
    nums = input[0].split("/");

    if(input[0] <= '2019/04/30')
        console.log('Heisei');
    else
        console.log('TBD');
}
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));

Measured memory_bytes: 21064
numbers = input().split(" ")
N = int(numbers[0])
K = int(numbers[1])
list = [int(i) for i in input().split(" ")]

def cost(N):
    dp = [0] * N
    if N > K:
        dp[1] = abs(list[0]-list[1])
        for i in range(2,K):
            dp[i] = min([dp[j]+abs(list[i]-list[j]) for j in range(i)])
        for k in range(K,N):
            dp[k] = min([dp[l]+abs(list[k]-list[l]) for l in range(k-K,k)])
        return dp[N-1]
    else:
        dp[1] = abs(list[0]-list[1])
        for i in range(2,N):
            dp[i] = min([dp[j]+abs(list[i]-list[j]) for j in range(i)])
        return dp[N-1]
        
print(cost(N))

Measured memory_bytes: 52192
import java.util.*;

public class Main {
    public void main(Scanner sc) {
        int n, cnt = 0;
        long a, sum = 0, min = Long.MAX_VALUE;

        n = sc.nextInt();
        for (int i = 0; i < n; i++) {
            a = sc.nextLong();
            if (a < 0) {
                cnt++;
            }
            if (Math.abs(a) <= min) {
                min = Math.abs(a);
            }

            sum += Math.abs(a);
        }

        System.out.println(cnt % 2 == 0 ? sum : sum - min * 2);
    }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        new Main().main(sc);
        sc.close();
    }
}


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

string s, t;

string solve();

int main() {
  while(1) {
    cin >> s;
    if(s == ".") break;
    cin >> t;
    cout << solve() << endl;
  }
  return 0;
}

string solve() {
  if(s == t) return "IDENTICAL";
  int si = 0, ti = 0, cnt = 0;
  while(si < s.size() && ti < t.size()) {
    if(s[si] != t[ti]) return "DIFFERENT";
    if(s[si] == '"') {
      string sc, tc;
      while(s[++si] != '"') sc += s[si];
      while(t[++ti] != '"') tc += t[ti];
      if(sc != tc) ++cnt;
    }
    ++ti, ++si;
  }
  if(cnt == 1 && si == s.size() && ti == t.size())
    return "CLOSE";
  return "DIFFERENT";
}


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

using namespace std;
using ll = long long;
using IP = pair<int, int>;

const ll linf = 1LL << 62;
const int inf = 99999999;
const int dx[4] = { 1,0,-1,0 };
const int dy[4] = { 0,1,0,-1 };
const ll atcoder = 1e9 + 7;

#define Endl endl
#define mp make_pair
#define all(v) v.begin(),v.end()
#define pb push_back
#define pr(x) cout << x << endl
#define chmax(x,y) x = max(x,y)
#define chmin(x,y) x = min(x,y)
#define rep(i,n) for(int i= 0;i<n;i++)

ll gcd(ll a, ll b) {//最大公約数
	if (a%b == 0)return b;
	else gcd(b, a%b);
}

ll lcm(ll a, ll b) {//最小公倍数
	return (a / gcd(a, b))*b;
}

int n, x, a[100010];

int main() {

	cin >> n >> x;
	rep(i, n) cin >> a[i];
	ll cnt = 0;

	for (int i = 1; i < n; i++) {
		if(a[i] + a[i - 1] > x) {
			cnt += a[i] + a[i - 1] -x ;
			a[i] -= a[i] + a[i - 1] - x;
			if (a[i] < 0)a[i] = 0;
		}
	}

	pr(cnt);

	//system("pause");
	return 0;
}

Measured memory_bytes: 640
#include <iostream>
#include <utility>
#include <vector>
#include <set>

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

int n, m, t;
vector<P> vec[100005];
set<int> S;
int sum[100005];
bool used[100005];
vector<int> uvec;

int main(void)
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	
	cin >> n >> m >> t;
	int a, b, c;
	for(int i = 1; i <= m; i++){
		cin >> a >> b >> c;
		if(c == 1){
			for(auto it = S.begin(); it != S.end(); it++){
				vec[*it].push_back(make_pair(b, -a));
				vec[b].push_back(make_pair(*it, -a));
			}
			S.insert(b);
		}
		else{
			S.erase(b);
			for(auto it = S.begin(); it != S.end(); it++){
				vec[*it].push_back(make_pair(b, a));
				vec[b].push_back(make_pair(*it, a));
			}
		}
	}
	for(auto it = S.begin(); it != S.end(); it++){
		for(auto it2 = S.begin(); it2 != S.end(); it2++){
			if(*it == *it2) continue;
			vec[*it].push_back(make_pair(*it2, t));
		}
	}
	
	for(int i = 1; i <= n; i++){
		for(int j = 0; j < vec[i].size(); j++){
			int id = vec[i][j].first;
			if(!used[id]){
				used[id] = true;
				uvec.push_back(id);
			}
			sum[id] += vec[i][j].second;
		}
		P ans = make_pair(0, -1);
		if(i == 1) ans.second = -2;
		for(int j = 0; j < uvec.size(); j++){
			int id = uvec[j];
			ans = max(ans, make_pair(sum[id], -id));
			used[id] = false;
			sum[id] = 0;
		}
		uvec.clear();
		cout << -ans.second << "\n";
	}
	flush(cout);
	
	return 0;
}


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

const int N = 100005;

int n, root = -1;
vector<int> G[N];

int dfs(int u, int p) {
	int ret = 0;
	int cnt = 0;
	for (int v : G[u]) if (v != p) {
		int cur = dfs(v, u);
		ret += cur;
		if (!cur) ++cnt;
	}
	ret += max(0, cnt - 1);
	return ret;
}

int main() {
	ios_base::sync_with_stdio(false); cin.tie(0);
	cin >> n;
	for (int i = 1; i < n; ++i) {
		int u, v; cin >> u >> v;
		G[u].push_back(v); G[v].push_back(u);
	}
	for (int i = 0; i < n; ++i) if (G[i].size() > 2) {
		root = i; break;
	}
	if (root == -1) {
		cout << 1 << endl; return 0;
	}

	int ans = dfs(root, root);
	printf("%d\n", ans);
}

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

def main():
    l = int(input())
    r = 0
    while True:
        if 2 ** (r + 1) <= l:
            r += 1
        else:
            break
    n = r + 1
    edges = []
    for i in range(1, n):
        edges.append((i, i + 1, 0))
        edges.append((i, i + 1, 2 ** (i - 1)))

    for t in reversed(range(1, n)):
        if l - 2 ** (t - 1) >= 2 ** r:
            edges.append((t, n, l - 2 ** (t - 1)))
            l -= 2 ** (t - 1)
    print(n, len(edges))
    for u, v, w in edges:
        print(u, v, w)

if __name__ == "__main__":
    main()


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

#define froop1(a,n) for(int i = a;i < n;i++)
#define froop2(a,n) for(int i = a;i > n;i--)

#define ll long long

#define pq(name,type) priority_queue<type> name
#define vec(name,type,length,value) vector<type> name(length,value)
#define vec2(name,type,length,width,value) vector<vector<type>> name(length,vector<type>(width,value));

int main(){
	string N;
  cin >> N;
  ll ans = 0;
  int sl = N.length(),pre = 0;
 vector<int> a;
  vector<int> b;
  froop1(0,sl + 1){
    a.push_back(pre);
    if(i == sl)break;
    if(N[i] == '<'){
      pre += 1;
    }else{
      pre = 0;
    }
  }
    froop2(sl - 1,-2){
    b.push_back(pre);
      if(i == -1)break;
    if(N[i] == '>'){
      pre += 1;
    }else{
      pre = 0;
    }
  }
  froop1(0,sl + 1){
    ans += max(a.at(i),b.at(sl - i));
  }
  cout << ans << endl;

return 0;
}

Measured memory_bytes: 8780
#include <bits/stdc++.h>
#define FOR(i, a, n) for(ll i = (ll)a; i < (ll)n; i++)
#define FORR(i, n) for(ll i = (ll)n - 1LL; i >= 0LL; i--)
#define rep(i, n) FOR(i, 0, n)
#define ALL(x) begin(x), end(x)
using namespace std;
using ll = long long;
constexpr ll Mod = 998244353;
constexpr ll mod = 1e9 + 7;
constexpr ll inf = 1LL << 60;
const double PI = acos(-1);
template <typename T1, typename T2> inline bool chmax(T1 &a, T2 b) {
    return a < b && (a = b, true);
}
template <typename T1, typename T2> inline bool chmin(T1 &a, T2 b) {
    return a > b && (a = b, true);
}
template <typename T> istream &operator>>(istream &is, vector<T> &v) {
    for(T &in : v)
        is >> in;
    return is;
}
template <typename T> ostream &operator<<(ostream &os, const vector<T> &v) {
    for(int i = 0; i < (int)v.size(); i++)
        os << (i ? " " : "") << v[i];
    return os;
}
/*-------------------------------------------*/

int D;
int c[26];
int s[365][26];

void input() {
    cin >> D;
    rep(i, 26) cin >> c[i];
    rep(d, D) rep(i, 26) cin >> s[d][i];
}

int compute_score(const vector<int> &v) {
    int ret = 0;
    int last[26]{};
    rep(d, v.size()) {
        ret -= (d + 1 - last[v[d]]) * (d - last[v[d]]) / 2 * c[v[d]];
        ret += s[d][v[d]];
        last[v[d]] = d + 1;
    }
    rep(i, 26) ret -= (D + 1 - last[i]) * (D - last[i]) / 2 * c[i];
    return ret;
}

void output(const vector<int> &v) {
    for(int e : v)
        cout << e + 1 << "\n";
    cerr << compute_score(v) << "\n";
}

// 山登り法
vector<int> solve() {
    const double TL = 1.9;
    vector<int> ret(D);
    for(int &e : ret)
        e = rand() % 26;
    int score = compute_score(ret);
    while(clock() < TL * CLOCKS_PER_SEC) {
        if(rand() & 1) {
            int r = rand();
            int d = r % D;
            int q = r % 26;
            int old = ret[d];
            ret[d] = q;
            int new_score = compute_score(ret);
            if(score > new_score)
                ret[d] = old;
            else
                score = new_score;
        } else {
            int d1 = rand() % (D - 1);
            int d2 = d1 + 1 + rand() % (min(d1 + 16, D) - d1 - 1);
            swap(ret[d1], ret[d2]);
            int new_score = compute_score(ret);
            if(score > new_score)
                swap(ret[d1], ret[d2]);
            else
                score = new_score;
        }
    }
    return ret;
}

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

    input();

    srand((unsigned)time(NULL));

    output(solve());

    return 0;
}

Measured memory_bytes: 3660
#include<bits/stdc++.h>
#define fo(i,w,n) for(int i=(int) w;i<(int) n;i++)
#define qi queue<int>
#define vi vector<int>
#define ll long long
#define pb push_back
#define lb lower_bound
#define ub upper_bound
#define pii pair<int,int>
#define mp make_pair
#define all(a) (a).begin(),(a).end()
#define fi first
#define se second
#define prq priority_queue
#define foreach(it,c) for(__typeof((c).begin()) it=c.begin();it!=c.end();it++)
using namespace std;
inline ll read(){
	ll x=0;
	int f=1;
	char c=getchar();
	for(;!isdigit(c);c=getchar()) if(c=='-')f=-f;
	for(;isdigit(c);c=getchar())x=x*10+(c-'0');
	return x*f;
}
int main(){
	//freopen("a.in","r",stdin);
	//freopen("a.out","w",stdout);
	int n,a,b,c,d;
	string s;
	cin>>n>>a>>b>>c>>d>>s;
	if(a>c||b>d){
		cout<<"No\n";
		return 0;
	}
	if(a>b)swap(a,b),swap(c,d);
	int i=b;
	bool an=1;
	while(i<=d){
		if(s[i-1]=='#'){an=0;break;}
		if(i==d||i+1==d)break;
		if(s[i+1]!='#')i+=2;
		else i++;
	}
	i=a;
	while(i<=c){
		if(s[i-1]=='#'){an=0;break;}
		if(i==c||i+1==c)break;
		if(s[i+1]!='#')i+=2;
		else i++;
	}
	if(!an){
		cout<<"No\n";
		return 0;
	}
	if(an&&c<d){
		cout<<"Yes\n";
		return 0;
	}
	fo(i,b,d+1) if(i>1&&i<n)
	if(s[i-2]=='.'&&s[i-1]=='.'&&s[i]=='.'){
		cout<<"Yes\n";
		return 0;
	}
	cout<<"No\n";
	return 0;
}


Measured memory_bytes: 640
/* ファイル名：ITP1_10_D.c	*/
/* 内容：２つの n 次元ベクトル( x と y )が与えられる。*/
/*		 p  がそれぞれ 1、2、3、∞ のミンコフスキー距離を出力する。*/

/* include	*/
#include <stdio.h>
#include <math.h>

/* 外部変数宣言	*/

/* プロトタイプ宣言	*/

/* 関数名:main	*/
/* 処理内容:２つの n 次元ベクトルのミンコフスキー距離を求める	*/
int main( void )
{
	/* 入力	*/
	int n;		/* ベクトルの次元	*/
	int x[100];	/* n次元ベクトル1	*/
	int y[100];	/* n次元ベクトル2	*/
	
	/* 処理	*/
	int i;	/* ループ用変数	*/
	
	/* 出力	*/
	double D1;	/* p=1のミンコフスキー距離	*/
	double D2;	/* p=2のミンコフスキー距離	*/
	double D3;	/* p=3のミンコフスキー距離	*/
	double Di;	/* p=∞のミンコフスキー距離	*/
	
	/* 出力変数の初期化	*/
	D1 = 0;
	D2 = 0;
	D3 = 0;
	Di = 0;
	
	/* 入力処理	*/
	scanf("%d",&n);	/* ベクトルの次元を取得	*/
	
	for(i = 0; i < n; i++){
		scanf("%d",&x[i]);/* xの要素を取得	*/
	}
	
	for(i = 0; i < n; i++){
		scanf("%d",&y[i]);/* yの要素を取得	*/
	}
	
	/* D1の算出	*/
	for(i = 0; i < n; i++){
		D1 += fabs(x[i] - y[i]);		/* 2つのベクトルの差の絶対値を合計する	*/
	}
	
	/* D2の算出	*/
	for(i = 0; i < n; i++){
		D2 += pow(fabs(x[i] - y[i]),2);	/* 2つのベクトルの差の絶対値の2乗を合計する	*/
	}
	D2 = sqrt(D2);	/* 絶対値の2乗の合計の平方根を出す。*/
	
	/* D3の算出	*/
	for(i = 0; i < n; i++){
		D3 += pow(fabs(x[i] - y[i]),3);	/* 2つのベクトルの差の絶対値の3乗を合計する	*/
	}
	D3 = pow(D3,1.0 / 3.0);	/* 絶対値の3乗の合計の3乗根を出す。*/
	
	/* Diの算出	*/
	for(i = 0; i < n; i++){
		/* 2つのベクトルの差が最大の場合*/
		if(fabs(x[i] - y[i]) > Di){
			Di = fabs(x[i] - y[i]);	/*  2つのベクトルの差をp=∞のミンコフスキー距離とする	*/
		}
		else{
			/* 処理なし	*/
		}
	}
	
	/* 結果の出力	*/
	printf("%lf\n%lf\n%lf\n%lf\n",D1,D2,D3,Di);
	
	return 0;
}



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

#ifdef LOCAL
#include "debug.h"
#else
#define DEBUG(...)
#endif

int main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  int h1, m1, h2, m2, k;
  cin >> h1 >> m1 >> h2 >> m2 >> k;
  m1 += 60 * h1;
  m2 += 60 * h2;
  cout << m2 - m1 - k << '\n';
}


Measured memory_bytes: 3608
#pragma target("avx")
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> P;
typedef vector<ll> V;
typedef unordered_map<ll, ll> U_MAP;
typedef priority_queue<ll> pq;
typedef priority_queue<ll, vector<ll>, greater<ll>> rpq;
constexpr ll INF = 1e9, MOD = 1e9 + 7, ohara = 1e6 + 10;
constexpr ll LINF = 1e18;

#define rep(i, n) for (ll(i) = 0; (i) < (int)(n); (i)++)
#define rrep(i, a, b) for (ll i = (a); i < (b); i++)
#define rrrep(i, a, b) for (ll i = (a); i >= (b); i--)
#define all(v) (v).begin(), (v).end()
#define Size(n) (n).size()
#define Cout(x) cout << (x) << endl
#define doublecout(a) cout << fixed << setprecision(15) << a << endl;
#define fi first
#define se second
#define m_p make_pair
#define p_b push_back
string to_string(string s) { return '"' + s + '"'; }
string to_string(const char* s) { return to_string((string)s); }
string to_string(bool b) { return (b ? "true" : "false"); }
template <typename A, typename B>
string to_string(pair<A, B> p) {
  return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}
template <typename A>
string to_string(A v) {
  bool first = true;
  string res = "{";
  for (const auto& x : v) {
    if (!first) {
      res += ", ";
    }
    first = false;
    res += to_string(x);
  }
  res += "}";
  return res;
}
void debug_out() { cerr << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cerr << " " << to_string(H);
  debug_out(T...);
}
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)

//------ Believe yourself as a genius!!!!!! ------

int dy[] = {1, 0, -1, 0};
int dx[] = {0, 1, 0, -1};
// int dy[]={-1,0,1,-1,1,-1,0,1};int dx[]={-1,-1,-1,0,0,1,1,1};
string alph("abcdefghijklmnopqrstuvwxyz"), s, t;
ll n, cnt, ans, a, b, c, d, tmp, m, h, w, x, y, sum, k, q;

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

  cin >> s >> t;
  rep(i, Size(s)) {
    string co = "";
    co += s.substr(i, (ll)Size(s) - i);
    co += s.substr(0, i);
    if (co == t) {
      Cout("Yes");
      return 0;
    }
  }
  Cout("No");
  return 0;
}

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

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

using namespace std;
typedef int Data;
pair<vector<int>,vector<int>> compressor(vector<Data> c) {
  int n = c.size();
  vector<Data> v(c), w;
  vector<int> res(n);
  sort(v.begin(), v.end());
  auto itr = unique(begin(v),end(v));
  v.erase(itr,end(v));
  REP(i,v.size()) w.push_back(v[i]);
  REP(i,n) res[i] = lower_bound(w.begin(), w.end(), c[i]) - w.begin();
  return make_pair(v,res);
}

int main() {
  int n,m;
  cin>>n>>m;
  vector<int> x(n),y(n),x1(m),x2(m),y1(m),y2(m);
  REP(i,n)
    cin>>x[i]>>y[i];
  REP(i,m)
    cin>>x1[i]>>y1[i]>>x2[i]>>y2[i];
  vector<int> xl;
  vector<int> yl;
  REP(i,n){
    xl.push_back(x[i]);
    yl.push_back(y[i]);
  }
  vector<int> cmpx,cmpy,sxl,syl;
  tie(sxl, cmpx) = compressor(xl);
  tie(syl, cmpy) = compressor(yl);
  sxl.insert(begin(sxl),-1000000001);
  syl.insert(begin(syl),-1000000001);
  int w=sxl.size();
  int h=syl.size();
  vector<vector<int16_t>> t(h,vector<int16_t>(w));
  REP(i,n)
    ++t[cmpy[i]][cmpx[i]];
  vector<vector<int16_t>> t2(h+1,vector<int16_t>(w+1));
  REP(i,h) {
    vector<int16_t> t1(w+1);
    partial_sum(begin(t[i]),end(t[i]),begin(t1)+1);
    REP(j,w+1){
      t2[i+1][j] = t2[i][j] + t1[j];
    }
  }
  REP(i,m){
    int xi1,yi1,xi2,yi2;
    xi1=prev(lower_bound(begin(sxl),end(sxl),x1[i]))-begin(sxl);
    yi1=prev(lower_bound(begin(syl),end(syl),y1[i]))-begin(syl);
    xi2=prev(upper_bound(begin(sxl),end(sxl),x2[i]))-begin(sxl);
    yi2=prev(upper_bound(begin(syl),end(syl),y2[i]))-begin(syl);
    cout<<(t2[yi2][xi2]-t2[yi2][xi1]-t2[yi1][xi2]+t2[yi1][xi1])<<endl;
  }
  return 0;
}

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

int main(){
	int n,q;cin >> n >> q;
	string s;cin >> s;
	vector<int> pre(n + 5, 0);
	for(int i = 1;i < n;i++){
		if(s[i] == 'C' && s[i - 1] == 'A'){
			pre[i] = pre[i - 1] + 1;
		}
		else pre[i] = pre[i - 1];
	}
	for(int i = 0;i < q;i++){
		int l,r;cin >> l >> r;
		cout << pre[r - 1] - pre[l - 1] << endl;
	}
}
// make pair, tuple
// make pair, tuple
// 
// __gcd(int, int);
// lcm = a * b / __gcd(a, b);
// 
// bool isPrime(int n){
//       if(n <= 1)return false;
//       if(n <= 3)return true;
//       if(n % 2 == 0 || n % 3 == 0)return false;
//       for(int i = 5;i * i <= n;i += 6){
//             if(n % i == 0 || n % (i + 2) == 0)return false;
//       }
//       return true;
// }
// int countSubString(string s, string temp){
//       int ans = 0;
//       size_t f = s.find(temp);
//       while(f != string::npos){
//             ans++;
//             f = s.find(temp, f + 1);
//       }
//       return ans;
// }
// 
// #Count leading & trailing zero of an integer bits
// __builtin_clz(n);
// __builtin_clzll(n);
//
// #Count 1s bits of an integer
// __builtin_popcount(n);
// __builtin_popcountll(n);
//
// #Error checking
// assert(n == 3);
// 
// #Error Printing
// cerr << "Some thing";

// #binary exponentiation
// long long binpow(long long a, long long b) {
//     long long res = 1;
//     while (b > 0) {
//         if (b & 1)
//             res = res * a;
//         a = a * a;
//         b >>= 1;
//     }
//     return res;
// }


Measured memory_bytes: 1408
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <map>
#include <bitset>
#include <cstdio>
#include <cstring>
#include <ctime>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <sstream>
#include <utility>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> pii;
#define all(c) (c).begin(), (c).end()
#define loop(i,a,b) for(ll i=a; i<ll(b); i++)
#define rep(i,b) loop(i,0,b)
#define each(e,c) for(auto&e:c)
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define mt make_tuple
#define lb lower_bound
#define ub upper_bound
#ifdef DEBUG
#define dump(...) (cerr<<#__VA_ARGS__<<" = "<<(DUMP(),__VA_ARGS__).str()<<" ["<<__LINE__<<"]"<<endl)
struct DUMP:ostringstream{template<class T>DUMP &operator,(const T&t){if(this->tellp())*this<<", ";*this<<t;return *this;}};
#else
#define dump(...)
#endif
template<class T> ostream& operator<<(ostream& os, vector<T> const& v){
    rep(i,v.size()) os << v[i] << (i+1==v.size()?"":" ");
    return os;
}

int n;
int x[24], y[24], r[24], c[24];
bool hit[24][24];
char dp[1<<24];

char dfs(int S, int rem){
    char & res = dp[S];
    if(res!=-1) return res;
    res = 0;
    rep(i,n){
        if(S>>i & 1){
            rep(j,i){
                if(S>>j & 1){
                    if(hit[i][j] || c[i]!=c[j]) continue;
                    bool ok = true;
                    rep(k,i) if(hit[i][k] && (S>>k & 1)) ok = false;
                    rep(k,j) if(hit[j][k] && (S>>k & 1)) ok = false;
                    if(!ok) continue;
                    S ^= 1<<i;
                    S ^= 1<<j;
                    res = max<char>(dfs(S,rem-2)+2, res);
                    if(res==rem) return res;
                    S ^= 1<<i;
                    S ^= 1<<j;
                }
            }
        }
    }
    return res;
}

int main(){
    while(cin>>n && n){
        memset(dp,-1,sizeof(dp));
        rep(i,n) cin >> x[i] >> y[i] >> r[i] >> c[i];
        rep(i,n)rep(j,i){
            int dx=x[i]-x[j], dy=y[i]-y[j];
            int d = dx*dx+dy*dy;
            hit[i][j] = hit[j][i] = d < (r[i]+r[j])*(r[i]+r[j]);
        }
        int S = 0;
        rep(i,n) S |= 1<<i;
        cout << (int)dfs(S,n) << endl;
    }
}

Measured memory_bytes: 17552
module Main where

import Control.Applicative
import Data.List

getInt :: IO Int
getInt = head <$> getInts

getInts :: IO [Int]
getInts = map read . words <$> getLine

main :: IO ()
main = do
  { xs <- getInts
  ; putStrLn $ unwords $ map show $ sort xs
  }



Measured memory_bytes: 3600
#include <bits/stdc++.h>
#define N 1001
using namespace std;

long long n, a[N], ans;

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

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

class Program
{
    static void Main(string[] args)
    {
        string[] str = Console.ReadLine().Split(' ');
        int H = int.Parse(str[0]);
        int W = int.Parse(str[1]);
        string[] a = new string[100];

        for(int i = 0; i < H; i++){
            a[i] = Console.ReadLine();
        }

        int cnt = 0;
        for(int i = 0; i < H + 2; i++){
            if(i == 0 || i == H + 1){
                for(int j = 0; j < W + 2; j++){
                    Console.Write('#');
                }
            }else{
                Console.Write('#');
                Console.Write(a[cnt]);
                Console.Write('#');
                cnt++;
            }
            Console.WriteLine();
        }
    }
}

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

int main()
{
	int N, X;
	int x[100005];
	int ans;

	cin >> N >> X;

	cin >> x[0];
	
	ans = abs(X - x[0]);
	
	for ( int i = 1; i < N; i++ ) {
		cin >> x[i];

		ans = __gcd(abs(X - x[i]), ans);
	}
	
	cout << ans << endl;

	return ( 0 );
}


Measured memory_bytes: 640
#include <stdio.h>

#define MAX 45

int fibonacci(int);

int main()
{
  int n;

  scanf("%d", &n);

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

int fibonacci(int n)
{
  int i;
  int f[MAX];

  if(n == 0 || n == 1)
    return 1;

  f[0] = 1;
  f[1] = 1;
  for(i=2; i<=n; i++) {
  f[i] = f[i-2] + f[i-1];
  }
  return f[n];
}

Measured memory_bytes: 596
from bisect import bisect_right
def main():
    N = int(input())
    min_a = 10**9 + 1
    values = []
    ans = 0
    for i in range(N):
        tmp = -int(input())
        idx = bisect_right(values, tmp)
        if idx != len(values):
            values[idx] = tmp
        else:
            values.append(tmp)
            ans += 1

    print(ans)








main()

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

const int INF = 0x3f3fffff;

int main() {
    int n;
    while(~scanf("%d", &n)) {
        std::vector<int> a(n);
        int mn = INF, mx = 0;
        for(int i = 0; i < n; ++i)
            scanf("%d", &a[i]), mn = std::min(mn, a[i]), mx=std::max(mx, a[i]);
        int ans = INF;
        for(int i = mn; i <= mx; ++i) {
            int res = 0;
            for(int j = 0; j < n; ++j)
                res += (a[j] - i) * (a[j] - i);
            ans = std::min(ans, res);
        }
        printf("%d\n", ans);
    }
    return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;
public class Main {
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int m = scan.nextInt();
		int a = scan.nextInt();
		
		if(n>=m&&n>=a) {
			System.out.println(m+a);
		}else if(m>=n&&m>=a) {
			System.out.println(n+a);
		}else {
			System.out.println(n+m);
		}

	}

}

Measured memory_bytes: 21844
import sys

N = int(input())

c = [list(map(int, sys.stdin.readline().split())) for i in range(N-1)]

for i in range(N-1):
    ans = c[i][0]+c[i][1]
    for j in range(i+1, N-1):
        if ans <= c[j][1]:
            ans = c[j][1] + c[j][0]
        elif ans % c[j][2] == 0:
            ans += c[j][0]
        else:
            ans = (ans//c[j][2]+1)*c[j][2] + c[j][0]
    print(ans)

print(0)

Measured memory_bytes: 3188
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>

#define ll long long
#define ull unsigned long long

using namespace std;

int main() {
	ll N;
	cin >> N;
    string ans;
    while (N) {
        ll r = N % 26;
        if (!r) r = 26;
        ans.push_back('a' + r - 1);
        N -= r;
        N /= 26;
    }
    reverse(ans.begin(), ans.end());
    cout << ans << '\n';

	return 0;
}


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

#define FOR(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define RFOR(i,a,b) for(int i=(int)(b)-1;i>=(int)(a);i--)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define LL long long
#define INF INT_MAX

const double EPS = 1e-14;
const double PI  = acos(-1.0);


int main(){
  int n;
  int d, x;
  cin >> n >> d >> x;

  vector<int> v(n);
  REP (i, n) cin >> v[i];

  int ans = x;
  REP (i, n) {
    int t = 1;
    while (t <= d) {
      ans += 1;
      t += v[i];
    }
  }

  cout << ans << endl;
}


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

int main(){
  int n;
  cin >> n;
  int v[n], c[n];
  rep(i, n) cin >> v[i];
  rep(i, n) cin >> c[i];
  int ans = 0;
  rep(i,n){
    if(v[i] > c[i]) ans += v[i] - c[i];
  }
  cout << ans << endl;
  return 0;
}


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

const int inf = 1e9;
const ll linf = 1e18;

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

    int n, k; cin >> n >> k;
    vector<int> a(n);
    for (int i = 0; i < n; i++) cin >> a[i], a[i]--;
    
    int res = inf;
    int l = 0, r = 0, s = 0;
    vector<int> count(k, 0);
    for (; l < n; l++) {
        while (r < n && s < k) {
            if (a[r] < k && ++count[a[r]] == 1) s++;
            r++;
        }
        if (s < k) break;
        res = min(res, r - l);
        if (a[l] < k && --count[a[l]] == 0) s--;
    }
    cout << (res <= n ? res : 0) << endl;
    return 0;
}


Measured memory_bytes: 3636
N, K = gets.split.map(&:to_i)
A = gets.split.map(&:to_i)
sum = A.sum
#warn sum
ave = Rational(sum, K + N)
D = A.map{|i|[(i / ave).to_i, 1].max}
#warn D.inspect
k = K + N
D.each{|d|
    k -= d
}
#warn k
R = A.zip(D)
R.sort_by!{|i|-Rational(i[0], i[1])}
#warn R.inspect
puts Rational(*R[k]).ceil


Measured memory_bytes: 48292
#include<cstdio>
#include<cstdlib>
#include<cstring>

struct Node{
	int key;
	Node *next, *prev;
};

Node *nil;

Node* listsearch(int key) {
	Node *cur = nil->next;
	while (cur != nil && cur->key != key) {
		cur = cur->next;
	}
	return cur;
}

void init() {
	nil = (Node *)malloc(sizeof(Node));
	nil->next = nil;
	nil->prev = nil;
}

void printlist() {
	Node *cur = nil->next;
	int isf = 0;
	while (1) {
		if (cur == nil) {
			break;
		}
		if (isf++ > 0) {
			printf(" ");
		}
		printf("%d", cur->key);
		cur = cur->next;
	}
	printf("\n");
}

void deletenode(Node *t){
	if (t == nil) {
		return;
	}
	t->prev->next = t->next;
	t->next->prev = t->prev;
	free(t);
}

void deletefirst(){
	deletenode(nil->next);
}

void deletelast() {
	deletenode(nil->prev);
}

void deletekey(int key){
	deletenode(listsearch(key));
}

void insert(int key) {
	Node *x = (Node *)malloc(sizeof(Node));
	x->key = key;
	x->next = nil->next;
	nil->next->prev = x;
	nil->next = x;
	x->prev = nil;
}

int main()
{
	int key, n, i;
	char s[20];
	scanf("%d", &n);
	init();
	for (i = 0; i < n; i++) {
		scanf("%s%d", s, &key);
		if (s[0] == 'i') {
			insert(key);
		}
		else if (s[0] == 'd') {
			if (strlen(s) > 6) {
				if (s[6] == 'F') {
					deletefirst();
				}
				else if (s[6] == 'L') {
					deletelast();
				}
			}
			else deletekey(key);
		}
	}
	printlist();
    return 0;
}

Measured memory_bytes: 33808
/***********************************************************
	When you are inspired by passion 
	and you want to live for the current moment

	When your every thought and action
	has the power to become the story of your future

	When difficulties stand to demolish your Glory
	Just remember that Life is a 'Golden adverse Story'

	Withstand it to acheive your passion and dreams
	more amazingly more easily.

	Why then? When writing the story of your Life
	You want to Let someone else hold your pen

					huzaifa242©

***********************************************************/
#include <bits/stdc++.h>
using namespace std;
#define int int64_t
#define MAX 100005
#define x first 
#define y second

int seed;
mt19937 rng(seed=chrono::steady_clock::now().time_since_epoch().count());
inline int rnd(int l=0,int r=INT_MAX)
{return uniform_int_distribution<int>(l,r)(rng);}

template <typename T,typename G>
ostream& operator << (ostream& out, const pair<T,G> &a) 
{return out<<"( "<<a.x<<", "<<a.y<<")";}

template <typename T>
ostream& operator << (ostream& out, const vector<T> &a) 
{out<<"[ ";for(const auto &i:a)out<<i<<", ";return out<<"]"<<endl;}

template <typename T>
ostream& operator << (ostream& out, const set<T> &a) 
{out<<"{ ";for(const auto &i:a)out<<i<<", ";return out<<"}"<<endl;}

template <typename T,typename G>
ostream& operator << (ostream& out, const map<T,G> &a) 
{out<<"< ";for(const auto &i:a)out<<i<<", ";return out<<">"<<endl;}

template<typename T, size_t N>
typename enable_if<!is_same<typename remove_cv<T>::type, char>::value,
ostream&>::type operator<<(ostream& out, T(&a)[N])
{out<<"[ ";for(size_t i=0;i<N;++i)out<<a[i]<<", ";out <<"]"<<endl;return out;}

void debug_out(){cerr<<endl;} 
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T)
{cerr<<(H)<<" ";debug_out(T...);}
 
#ifdef LOCAL
#define debug(...) cerr<<"#"<<#__VA_ARGS__<<":\n",debug_out(__VA_ARGS__)
#else
#define debug(...) 24
#endif

signed main(){
	ios_base::sync_with_stdio(false);
	cin.tie(0);cout.tie(0);
	int a,b,c,k;
	cin>>a>>b>>c>>k;
	int ans=0;
	ans+=min(a,k);
	k-=min(a,k);
	k-=min(b,k);
	ans-=min(c,k);
	cout<<ans<<"\n";
	return 0;
}


Measured memory_bytes: 3648
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main{
	
	static Main byakko = new Main();
	static BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
	
	public static void main(String[] args)throws IOException{
		
		double x = 0, y = 0,z = 0,w = 0,h = 0;
		String str;
		
		while(true){
			if((str = byakko.Input()).equals("0,0"))break;
			z = Double.parseDouble(str.split(",",0)[0]);
			w = Double.parseDouble(str.split(",",0)[1]);
			
			x += (z * Math.sin(Math.toRadians(h)));
			y += (z * Math.cos(Math.toRadians(h)));
			h += w;
		}
		System.out.println((int)x);
		System.out.println((int)y);
		
		reader.close();
	}
	
	public String Input()throws IOException{
		return reader.readLine();
	}
	
}

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



int main()
{
int n, m;


	scanf("%d%d", &n, &m);
	if(n & 1); else n--;
	int l = 1, r = (n + 1) / 2 + 1;
	int t = n / 2;
	for(int i = 1; i <= m; i++) {
		if(i & 1) {
			printf("%d %d\n", l, l + t);
			t--;
			l++;
		}
		else {
			printf("%d %d\n", r, r + t);
			t--;
			r++;
		}
	}
}

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

using namespace std;

using ll = long long;
using ull = unsigned long long;

int main(int argc, char const *argv[]) {
	int a,b;
	std::cin >> a >> b;
	if (a < 9 && b < 9) {
		std::cout << "Yay!" << '\n';
	}
	else {
		std::cout << ":(" << '\n';
	}
	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int n,m;
priority_queue<int>q;
int main(){
   // freopen("tt.in","r",stdin),freopen("tt.out","w",stdout);
    cin>>n>>m;
    for(int i=1,t;i<=n;i++)cin>>t,q.push(t);
    for(int i=1;i<=m;i++){
        int x=q.top();q.pop();
        q.push(x/2);
    }
    ll sum=0;
    while(!q.empty())sum+=q.top(),q.pop();
    cout<<sum<<endl;
    return 0;
}

Measured memory_bytes: 892
#include <bits/stdc++.h>
#define base 1000000007LL
#define ll long long
#define X first
#define Y second
#define mp make_pair
#define pb push_back
#define CLR(a) memset(a,0,sizeof(a))
#define FOR(i,a,b) for(int i=(a),_b=(b); i<=_b; i++)
#define FORE(i,a,b) for(int i=(a),_b=(b); i>=_b; i--)

using namespace std;

typedef pair<ll, ll> II;
typedef vector<II> vi;

int main()
{
    int t, n, d;
    ios::sync_with_stdio(0);
    //freopen("inp.txt", "r", stdin);
    cin >> t;
    while (t--) {
        cin >> n >> d;
        int p = n-1;
        if (p % 2 == 0) cout << d + 127*p;
        else cout << (127^d) + 127*p;
        cout << endl;
    }
    return 0;
}


Measured memory_bytes: 256
import math

def main():
	N, K = [int(n) for n in input().split(" ")]
	R, S, P = [int(p) for p in input().split(" ")]
	T = list(input())
	T.reverse()
	cnt = 0
	for i in range(K):
		tmp = []
		for j in range(math.ceil((N - i) / K)):
			if len(tmp) == 0 or T[i + j * K] != tmp[-1][0]:
				if T[i + j * K] == "r":
					tmp.append(["r", P, 1])
				elif T[i + j * K] == "s":
					tmp.append(["s", R, 1])
				elif T[i + j * K] == "p":
					tmp.append(["p", S, 1])
			else:
				tmp[-1][2] += 1
		for l in range(len(tmp)):
			cnt += tmp[l][1] * math.ceil(tmp[l][2] / 2)

	print(cnt)


main()

Measured memory_bytes: 16432
#include<bits/stdc++.h>
using namespace std;
#define ll long long
void solve(){
   int a,b,c;
   cin>>a>>b>>c;
   if((max(a,max(b,c))==7) && (min(a,min(b,c))==5) && (a+b+c == 17) ){
       cout<<"YES";
   } else {
       cout<<"NO";
   }
}
int main(){
   int t=1;
//   cin>>t;
   while(t--){
       solve();
   }
   return 0;
}

Measured memory_bytes: 3640
#include<stdio.h>
#include<string.h>
#include<math.h>
int main(void)
{
	int a,s,d,f,g,h,i,j;
	while(scanf("%d",&a)!=EOF){
		s=a%39;
		if(s==0)	s=39;
		printf("3C%02d\n",s);
	}
	return 0;
}

Measured memory_bytes: 2596
n, x = map(int, input().split())

a, p = [1], [1]
for i in range(n):
    a.append(a[i] * 2 + 3)
    p.append(p[i] * 2 + 1)

def rec(n, x, a, p):
    if n == 0:
        return 0 if x <= 0 else 1
    elif x <= 1 + a[n - 1]:
        return rec(n - 1, x - 1, a, p)
    else:
        return p[n - 1] + 1 + rec(n - 1, x - 2 - a[n - 1], a, p)

ans = rec(n, x, a, p)
print(ans)

Measured memory_bytes: 38384
import java.util.Arrays;
import java.util.Scanner;

public class Main{
	public static void main(String[] args) {
		try(Scanner sc = new Scanner(System.in)){
			int n = sc.nextInt();
			sc.nextLine();
			Dice[] dices = new Dice[n];
			for(int i = 0; i < n; i++) {
				dices[i] = new Dice(sc.nextLine().split(" "));
			}

			Boolean[] clear = new Boolean[n];

			for (int i = 1; i < n; i++) {
				for (int j = 0; j < 3; j++) {
					for (int k = 0; k < 4; k++) {
						for (int h = 0; h < 4; h++) {
							if (Arrays.equals(dices[0].d, dices[i].d)) {
								clear[i - 1] = false;
								break;
							}else {
								clear[i - 1] = true;
							}
							dices[i].S();
						}
						if (!clear[i - 1]) break;
						dices[i].E();
					}
					if (!clear[i - 1]) break;
					dices[i].R();
				}
			}
			if (!Bool(clear)) {
				System.out.println("No");
			} else {
				System.out.println("Yes");
			}
		}
	}
	public static Boolean Bool(Boolean[] b) {
		for (int i = 0; i < b.length - 1; i++) {
			if (!b[i]) return false;
		}
		return true;
	}
	static class Dice{
		private int[] d = new int[6];

		public Dice(String[] d_num) {
			for(int i = 0;i < d.length;i++) {
				d[i] = Integer.parseInt(d_num[i]);
			}
		}

		public void N() {
		    int tmp = d[0];
		    d[0] = d[1];
		    d[1] = d[5];
		    d[5] = d[4];
		    d[4] = tmp;
		}

		public void E() {
		    int tmp = d[0];
		    d[0] = d[3];
		    d[3] = d[5];
		    d[5] = d[2];
		    d[2] = tmp;
		}

		public void W() {
		    int tmp = d[0];
		    d[0] = d[2];
		    d[2] = d[5];
		    d[5] = d[3];
		    d[3] = tmp;
		}

		public void S() {
		    int tmp = d[0];
		    d[0] = d[4];
		    d[4] = d[5];
		    d[5] = d[1];
		    d[1] = tmp;
		}
		public void R() {
			int tmp = d[1];
			d[1] = d[3];
			d[3] = d[4];
			d[4] = d[2];
			d[2] = tmp;
		}
	}
}



Measured memory_bytes: 26844
n,k=map(int,input().split())
s=list(map(int,input().split()))

ans=0
tmp=0
tmp2=sum(s[0:k])
kukan=[0,n]
for i in range(n-k):
    tmp2 -= s[i]
    tmp2 += s[k+i]
    if tmp < tmp2:
        tmp = tmp2
        kukan = [i+1,i+k+1]

for i in range(kukan[0],kukan[1]):
    ans += (s[i]+1)/2
    
print(ans)

Measured memory_bytes: 25060
#include<iostream>
#include<string>
#include<string.h>
#include<stdio.h>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
using namespace std;
string s[110],ans[110];
bool hang[110],lie[110];
int main()
{
    int h,w,i,j;
    cin >> h >> w;
    for (i=0;i<h;i++) cin >> s[i];
    memset(hang,1,sizeof(hang));
    memset(lie,1,sizeof(lie));
    for (i=0;i<h;i++)
    {
        bool all=1;
        for (j=0;j<w;j++)
            if (s[i][j]=='#') {all=0;break;}
        if (all) hang[i]=0;
    }
    for (i=0;i<w;i++)
    {
        bool all=1;
        for (j=0;j<h;j++)
            if (s[j][i]=='#') {all=0;break;}
        if (all) lie[i]=0;
    }

    for (i=0;i<h;i++)
    {
        bool out=0;
        for (j=0;j<w;j++)
            if ((hang[i]) && (lie[j])) {cout << s[i][j];out=1;}
        if (out) cout << endl;
    }
    return 0;
}

Measured memory_bytes: 256
// https://atcoder.jp/contests/abc153/tasks/abc153_c

#include "algorithm"
#include "bitset"
#include "cmath"
#include "functional"
#include "iomanip"
#include "iostream"
#include "map"
#include "numeric"
#include "queue"
#include "set"
#include "string"
#include "vector"
#define rep(i, to) for (ll i = 0; i < (to); ++i)
#define rep1(i, to) for (ll i = 1; i <= (to); ++i)
#define repf(i, from, to) for (ll i = from; i < (to); ++i)
#define repr(i, from) for (ll i = from - 1; i >= 0; --i)
#define all(vec) vec.begin(), vec.end()
#define unless(cond) if (!(cond))
#define fi first
#define se second
using namespace std;
typedef long long ll;
typedef long double ld;
template <typename T>
using V = vector<T>;
using VL = V<ll>;
using VVL = V<VL>;
template <typename T, typename U>
using P = pair<T, U>;
using PL = P<ll, ll>;
using VPL = V<PL>;
template <typename T>
inline bool chmax(T& a, T b);
template <typename T>
inline bool chmin(T& a, T b);
void print_ints(vector<ll> v);
template <typename T>
void drop(T a);

const ll INF = 1e18;

void solve() {
  ll N, K;
  cin >> N >> K;

  VL hs(N);
  rep(i, N) cin >> hs[i];

  sort(all(hs));

  ll res = 0;
  rep(i, N - K) { res += hs[i]; }

  cout << res << endl;
}

struct exit_exception : public std::exception {
  const char* what() const throw() { return "Exited"; }
};

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

  try {
    solve();
  } catch (exit_exception& e) {
  }

  return 0;
}
#endif

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

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

void print_ints(vector<ll> v) {
  rep(i, v.size()) {
    if (i > 0) {
      cout << " ";
    }

    cout << v[i];
  }

  cout << endl;
}

template <typename T>
void drop(T res) {
  cout << res << endl;
  throw exit_exception();
}


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

using namespace std;
typedef long long LL;

const int N=1e5+10;

int a[N][3],n,op[2],topos[2],pos[N];

struct Binary_Indexed_Tree
{
	#define lowbit(x) ((x)&(-(x)))
	int v[N];
	
	void clear(){ memset(v,0,sizeof(v)); }
	
	void add(int pos,int value)
	{
		for (;pos<N;pos+=lowbit(pos))
			v[pos]+=value;
	}
	
	int query(int pos)
	{
		int ret=0;
		for (;pos;pos-=lowbit(pos))
			ret+=v[pos];
		return ret;
	}
}bit;

void Init()
{
	scanf("%d",&n);
	for (int i=0;i<3;++i)
		for (int j=1;j<=n;++j) scanf("%d",&a[j][i]);
}

void Solve()
{
	bool fl=1;int p[4];
	for (int i=1;i<=n && fl;++i)
	{
		for (int j=0;j<3;++j) p[j]=a[i][j];
		sort(p,p+3);
		
		int k=p[2]/3;
		
		if (p[2]-p[0]!=2 && p[2]%3!=0) fl=0;
		if (p[1]!=a[i][1]) fl=0;
		if ( ((p[2]/3)&1)!=(i&1) ) fl=0;
		
		op[k&1]^=(a[i][2]<a[i][0]);
		
		pos[i]=k;
	}
	
	bit.clear();
	for (int i=n;i>=1 && fl;i-=2)
	{
		int tpos=i+2*bit.query(pos[i]);
		topos[i&1]^=((tpos-pos[i])>>1)&1;
		bit.add(pos[i],1);
	}
	bit.clear();
	for (int i=n-1;i>=1 && fl;i-=2)
	{
		int tpos=pos[i]+2*bit.query(pos[i]);
		topos[i&1]^=((tpos-pos[i])>>1)&1;
		bit.add(pos[i],1);
	}
	
	if (topos[0]!=op[1] || topos[1]!=op[0]) fl=0;
	
	if (fl) printf("Yes\n");
	else printf("No\n");
	
}

int main()
{
	Init();
	Solve();
	return 0;
}


Measured memory_bytes: 2176
#include<iostream>
#include<cstring>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<cassert>
#include<vector>
#define ll long long
using namespace std;
inline ll read(){
	ll re=0,flag=1;char ch=getchar();
	while(ch>'9'||ch<'0'){
		if(ch=='-') flag=-1;
		ch=getchar();
	}
	while(ch>='0'&&ch<='9') re=(re<<1)+(re<<3)+ch-'0',ch=getchar();
	return re*flag;
}
ll n;
struct node{
	ll num,dis;
}a[100010];
ll siz[100010],fa[100010],d[100010],dep[100010];
vector<ll>son[100010];
bool cmp(node l,node r){
	return l.dis<r.dis;
}
void dfs(ll u,ll f){
	ll i;dep[u]=dep[f]+1;
//	cout<<u<<' '<<dep[u]<<"***\n";
	for(auto v:son[u]){
		if(v!=f) dfs(v,u);
	}
}
int main(){
	n=read();ll i;
	for(i=1;i<=n;i++) a[i].dis=read(),a[i].num=i;
	sort(a+1,a+n+1,cmp);
	for(i=1;i<=n;i++) d[i]=a[i].dis;
	for(i=n;i>=2;i--){
		siz[a[i].num]++;
		ll tmp=d[i]-(n-2*siz[a[i].num]);
		ll pos=lower_bound(d+1,d+i,tmp)-d;
//		cout<<i<<' '<<d[i]<<' '<<a[i].num<<' '<<siz[a[i].num]<<' '<<tmp<<' '<<pos<<' '<<a[pos].num<<' '<<d[pos]<<'\n';
		if(pos>=i||d[pos]!=tmp){
			puts("-1");return 0;
		}
		siz[a[pos].num]+=siz[a[i].num];fa[a[i].num]=a[pos].num;
	}
	std::ios::sync_with_stdio(false);
	for(i=1;i<=n;i++) if(fa[i]) son[fa[i]].push_back(i);
	dep[0]=-1;dfs(a[1].num,0);
	ll ans=0;
	for(i=1;i<=n;i++) ans+=dep[i];
	if(ans!=d[1]){
		puts("-1");return 0;
	}
	for(i=1;i<=n;i++) if(fa[i]) cout<<i<<' '<<fa[i]<<'\n';
} 

Measured memory_bytes: 13952
#include<stdio.h>
#include<math.h>
int main()
{
  int n,i,k,a,in=0;
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d",&a);
    for(k=1;k<=a;k+=2){
      if(k==1 && a==2){in++; break;}
      if(k==1)continue;
      if(a==3 || a==5 || a==7){in++; break;}
      if(a!=2 && a%2==0)break;
      if(a!=3 && a%3==0)break;
      if(a!=5 && a%5==0)break;
      if(a!=7 && a%7==0)break;
      if((a%k)==0 && (a!=k)){
        break;
      }
      if((double)k>sqrt((double)a)){
        in++;
        break;
      }
      if(a%k==0 && a/k==1){in++; break;}
    }
  }
  printf("%d\n",in);
  return 0;
}


Measured memory_bytes: 2072
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main(void){
    // Your code here!
    int n;
    int a;
    int b[200010]={};
    
    scanf("%d", &n);
    
    for(int i=0; i<n-1; i++){
        scanf("%d", &a);
        b[a-1]++;
    }
    
    for(int i=0; i<n; i++){
        printf("%d\n", b[i]);
    }
}


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

using namespace std;

#define ll long long 
#define pi 3.14159265358979323

void solve(){
    int n;
    cin>>n;
    int m;
    cin>>m;
    vector<int> arr(m);
    for(int i = 0;i<m;i++)cin>>arr[i];
    int sum = accumulate(arr.begin(),arr.end(),0);
    if(sum > n){
        cout<<-1;
    }else{
        cout<<n-sum;
    }
}

int main() {
    int t = 1;
    while(t--)
        solve();
    return 0;
}



Measured memory_bytes: 3620