akhauriyash/Code-Regression huggingface dataset:
#pragma GCC optimize ("O2")
#pragma GCC target ("avx2")
//#include<bits/stdc++.h>
#include<cstdio>
#include<cstring>

using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x) cerr << (x) << "\n"
#define cesp(x) cerr << (x) << " "
#define pb push_back
#define mp make_pair
#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
#define Would
#define you
#define please

int A[100000];
char kotae[800000], * it = kotae;
const int CM = 1 << 17, CL = 12;
char cn[CM + CL], * ci = cn + CM + CL, * owa = cn + CM, ct;
const ll ma0 = 1157442765409226768;
const ll ma1 = 1085102592571150095;
const ll ma2 = 71777214294589695;
const ll ma3 = 281470681808895;
const ll ma4 = 4294967295;
inline int getint() {
	if (ci - owa > 0) {
		memcpy(cn, owa, CL);
		ci -= CM;
		fread(cn + CL, 1, CM, stdin);
	}
	ll tmp = *(ll*)ci;
	if ((tmp & ma0) ^ ma0) {
		int dig = 68 - __builtin_ctzll((tmp & ma0) ^ ma0);
		tmp = tmp << dig & ma1;
		tmp = tmp * 10 + (tmp >> 8) & ma2;
		tmp = tmp * 100 + (tmp >> 16) & ma3;
		tmp = tmp * 10000 + (tmp >> 32) & ma4;
		ci += (72 - dig >> 3);
	}
	else {
		tmp = tmp & ma1;
		tmp = tmp * 10 + (tmp >> 8) & ma2;
		tmp = tmp * 100 + (tmp >> 16) & ma3;
		tmp = tmp * 10000 + (tmp >> 32) & ma4;
		ci += 8;
		while ((ct = *ci++) >= '0') tmp = tmp * 10 + ct - '0';
	}
	return tmp;
}

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


	int N, K, kari;
	N = getint();
	K = getint();

	int k = N - K;

	if (k <= K) {
		rep(i, k) A[i] = getint();
		rep(i, K - k) {
			if (ci - owa > 0) {
				memcpy(cn, owa, CL);
				ci -= CM;
				fread(cn + CL, 1, CM, stdin);
			}
			ll tmp = *(ll*)ci;
			if ((tmp & ma0) ^ ma0) {
				ci += (__builtin_ctzll((tmp & ma0) ^ ma0) + 4 >> 3);
			}
			else {
				ci += 8;
				while ((ct = *ci++) >= '0') tmp = tmp * 10 + ct - '0';
			}
		}
		rep(i, k) {
			kari = getint();
			if (kari > A[i]) {
				*it++ = 'Y';
				*it++ = 'e';
				*it++ = 's';
				*it++ = '\n';
			}
			else {
				*it++ = 'N';
				*it++ = 'o';
				*it++ = '\n';
			}
		}
	}
	else if (K == 1) {
		int mae = getint();
		rep(i, k) {
			kari = getint();
			if (kari > mae) {
				*it++ = 'Y';
				*it++ = 'e';
				*it++ = 's';
				*it++ = '\n';
			}
			else {
				*it++ = 'N';
				*it++ = 'o';
				*it++ = '\n';
			}
			mae = kari;
		}
	}
	else {
		rep(i, K) A[i] = getint();
		int kazu = k / K;
		int amari = k % K;
		rep(j, kazu) rep(i, K) {
			kari = getint();
			if (kari > A[i]) {
				*it++ = 'Y';
				*it++ = 'e';
				*it++ = 's';
				*it++ = '\n';
			}
			else {
				*it++ = 'N';
				*it++ = 'o';
				*it++ = '\n';
			}
			A[i] = kari;
		}
		rep(i, amari) {
			kari = getint();
			if (kari > A[i]) {
				*it++ = 'Y';
				*it++ = 'e';
				*it++ = 's';
				*it++ = '\n';
			}
			else {
				*it++ = 'N';
				*it++ = 'o';
				*it++ = '\n';
			}
		}
	}

	fwrite(kotae, 1, it - kotae, stdout);


	Would you please return 0;
}

Measured memory_bytes: 2388
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <cmath>
#include <stdio.h>
#include <queue>
#include <deque>
#include <cstdio>
#include <set>
#include <map>
#include <bitset>
#include <stack>
using namespace std;
int main() {
	long long a, b, c;
	cin >> a >> b;
	c = a * b;
	if (a == 1 || b == 1) {
		cout << "1" << endl;
		return 0;
	}
	if (c % 2 == 1) {
		cout << c / 2 + 1 << endl;
	}
	else {
		cout << c / 2 << endl;
	}
	return 0;
}

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

typedef long long ll;
typedef pair<ll,ll> P;
const ll mod=1e9+7;
#define rep(i,N) for(ll i=0; i<(N); i++)
#define rep1(i,N) for(ll i=1; i<(N); i++)
#define f first
#define s second

ll N;
ll a[15];
ll dp[15][100005];

int main(){

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

cin>>N;

rep(i,7){
	a[i]=pow(6,i);
}

rep(i,5){
	a[i+7]=pow(9,i+1);
}
sort(a,a+12);

rep(i,100003){
	dp[0][i]=i;
}

rep1(i,12){
	rep(n,100003){
		if(n-a[i]>=0){
			dp[i][n]=min(dp[i-1][n],dp[i][n-a[i]]+1);
		}else{
			dp[i][n]=dp[i-1][n];
		}
	}
}

cout<<dp[11][N]<<endl;

}
	


Measured memory_bytes: 10496
#include<cstdio>
#include<iostream>
#include<cstring>
using namespace std;
int main(void)
{
	int a,b,c,flg;
	flg=0;
	cin>>a>>b>>c;
	if(a==1 && b==1) flg=1;
	if(a==0 && b==0 && c==1) flg=1;
	if(flg==1) cout<<"Open"<<endl;
	else  cout<<"Close"<<endl;
	return 0;
}


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

const int M = 1e9+7;
ll n, k, bd[101][200001], a;

int main() {
	cin >> n >> k;
	memset(bd, 0, sizeof(bd));
	bd[0][k] = 1;
	for (int i=1; i<=n; i++) {
		cin >> a;
		bd[i][k] = 1;
		for (int j=k-1; j>=0; j--) {
			bd[i][j] = (bd[i][j+1]-bd[i-1][j+a+1]+bd[i-1][j]+M)%M;	
		}
	}
	cout << bd[n][0] << "\n";
}

Measured memory_bytes: 158080
#include <iostream>
#include <vector>
#include <algorithm>
#include <numeric>
using namespace std;
typedef long long int lli;
int gcd(int a , int b)
{
   if(b==0) return a;
   a%=b;
   return gcd(b,a);
}
int main() {
  lli n;
  cin >> n;
  lli result = 0;
  
  for (int i=1; i<n+1 ; i++){
    for (int j=1; j<n+1; j++){
      long tmp_val = gcd(i,j);
      for (int k=1; k < n+1; k++){
        result += gcd(tmp_val,k);
      }
    }
  }
  
  std::cout << result << std::endl;
}


Measured memory_bytes: 3636
#include <iostream>
#include <queue>
#include <cstring>
using namespace std;

int field[50][50];
bool visit[50][50][50][50];

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

int main()
{
	int w,h,ax,ay,bx,by;

	while(cin >> w >> h, w||h)
	{
		cin >> ax >> ay;
		cin >> bx >> by;

		for(int y=0; y<h; y++)
		for(int x=0; x<w; x++)
		{
			cin >> field[y][x];
		}
		memset(visit,0,sizeof(visit));

		int cnt=0;
		bool flag=false;
		queue<int> q;
		q.push(ax-1);
		q.push(ay-1);
		q.push(bx-1);
		q.push(by-1);
		while(!q.empty())
		{
			int len=q.size()/4;
			for(int l=0; l<len; l++)
			{
				ax=q.front(); q.pop();
				ay=q.front(); q.pop();
				bx=q.front(); q.pop();
				by=q.front(); q.pop();

				if(ax==bx && ay==by)
				{
					flag=true;
					break;
				}

				if(visit[ax][ay][bx][by])
				{
					continue;
				}
				visit[ax][ay][bx][by] = 1;

				for(int d=0; d<4; d++)
				{
					int px = ax+dx[d];
					int py = ay+dy[d];
					int qx = bx-dx[d];
					int qy = by-dy[d];

					if(px<0 || w<=px || py<0 || h<=py) { px=ax; py=ay; }
					if(qx<0 || w<=qx || qy<0 || h<=qy) { qx=bx; qy=by; }
					if(field[py][px]) { px=ax; py=ay; }
					if(field[qy][qx]) { qx=bx; qy=by; }

					if(!visit[px][py][qx][qy])
					{
						q.push(px);
						q.push(py);
						q.push(qx);
						q.push(qy);

					}
				}
			}

			if(flag) break;
			if(++cnt>=100) break;
		}

		if(flag)
		{
			cout << cnt << endl;
		}
		else
		{
			cout << "NA" << endl;
		}
	}

}

Measured memory_bytes: 7492
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

func out(x ...interface{}) {
	fmt.Println(x...)
}

var sc = bufio.NewScanner(os.Stdin)

func getInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func getString() string {
	sc.Scan()
	return sc.Text()
}

func main() {
	sc.Split(bufio.ScanWords)

	N := getInt()
	a := make([]int, N)
	sum := 0
	for i := 0; i < N; i++ {
		a[i] = getInt()
		sum += a[i]
	}

	x := sum / N
	y := sum % N
	if y > N/2 {
		x++
	}

	ans := 0
	for i := 0; i < N; i++ {
		ans += (a[i] - x) * (a[i] - x)
	}
	fmt.Println(ans)
}


Measured memory_bytes: 640
#include <stdio.h>

int main(int argc, const char * argv[]) {
    // insert code here...
    int a,b,c;
    scanf("%d %d %d",&a,&b,&c);
    
    if(a>b){
        int t1 = a;
        a = b;
        b = t1;
    }
    
    if(b>c){
        int t2 = b;
        b = c;
        c = t2;
    }
    
    if(a>b){
        int t3 = a;
        a = b;
        b = t3;
    }
    
    printf("%d %d %d\n",a,b,c);
    
    return 0;
}

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

using namespace std;

int n;
const int MAXN = 100011;
const int N = 100011;
int u[N*2], v[N*2], pre[N*2], bia[N], c[N*2], num = 0;
int illegal = -1;
void addedge(int l, int r, int C)
{
    num++;
    u[num] = l;v[num] = r;pre[num] = bia[l];bia[l] = num;
    c[num] = C;
    num++;
    u[num] = r;v[num] = l;pre[num] = bia[r];bia[r] = num;
    c[num] = C;
}

int cntE[MAXN*2], cntV[MAXN];
bool dn[MAXN*2];

void dfs(int l, int fa)
{
    int r;
    for (int i=bia[l]; i!=0; i=pre[i])
    {
        r = v[i];
        if (r == fa)
        {
            dn[i] = false;
            continue;
        }
        else
        {
            dn[i] = true;
        }
        dfs(r, l);
        cntV[l] += cntV[r];
    }
    cntV[l] ++;
    return;
}


long long dp(int l, int fa, long long now)
{
    int r;
    long long res = 1000000000000000ll;
    //cout << "In " << l << endl;
    for (int i=bia[l]; i!=0; i=pre[i])
    {
        r = v[i];
        if (i == illegal * 2 || i == illegal * 2 - 1) continue;
        if (r == fa) continue;
        res = min(res, (long long)c[i] + now * 2);
        res = min(res, dp(r, l, now + c[i]));
    }
    //cout << "Out " << l << " " << res << endl;
    return res;
}


int main()
{
    scanf("%d", &n);
    for (int i=1; i<n;i++)
    {
        int l, r, C;
        scanf("%d%d%d", &l, &r, &C);
        addedge(l, r, C);
    }
    dfs(1, 0);
    for (int i=1; i<=num; i++)
    {
        if (dn[i] == true)
        {
            cntE[i] = cntV[v[i]];
        }
        else
        {
            cntE[i] = n-cntV[u[i]];
        }
    }
    long long res = 0;
    /*for (int i=1; i<=n; i++) cout << cntV[i] << " "; cout << endl;
    for (int i=1; i<n*2-1; i++)
    {
        cout << u[i] << " " << v[i] << " " << c[i] << " " << cntE[i] << endl;
    }*/
    for (int i=1; i<n; i++)
    {
        res += (long long)c[i*2] * min(cntE[i*2-1], cntE[i*2]) * 2;
    }

    //cout << res << endl;
    long long mi = 1000000000000000ll;
    vector<int> Node;
    if (n % 2 == 0)
    {
        for (int i=1; i<n; i++)
        {
            if (cntE[i*2-1] == cntE[i*2])
            {
                illegal = i;
                Node.push_back(u[i]);
                Node.push_back(v[i]);
                mi = c[i*2];
                break;
            }
        }
    }
    if (mi == 1000000000000000ll)
    {
        illegal = -1;
        for (int i=1; i<=n; i++)
        {
            bool bo = true;
            for (int j=bia[i]; j!=0; j=pre[j])
            {
                if (cntE[j] > n/2)
                {
                    bo = false;
                    break;
                }
            }
            if (bo == true)
            {
                Node.push_back(i);
                //mi = dp(i, 0, 0);
                for (int j=bia[i]; j!=0; j=pre[j])
                {
                    mi = min(mi, (long long)c[j]);
                }
                break;
            }
        }
    }

    //cout << "Ill : " << illegal << endl;
    /*
    for (int i=0; i<Node.size(); i++)
    {
        mi = min(mi, dp(Node[i], 0 ,0));
    }*/

    res -= mi;
    cout << res;
}

Measured memory_bytes: 9088
//#include "pch.h"
#include <iostream>
#include <algorithm>
#include <numeric>
#include <tuple>
#include <string>
#include <vector>
using namespace std;

#define FOR(i, s, e) for(int i=s; i<e; i++)
#define REF(i, s, e) for(int i=s; i>e; i--)
typedef long long ll;

//6桁のゼロ埋め
string zeroPadding(int num) {
	string s = to_string(num);
	int zero = 6 - s.size();
	
	return string("").append(zero, '0') + s;
}

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

	int n, m;
	cin >> n >> m;

	vector<tuple<int, int, int>> py;
	FOR(i, 0, m) {
		int p, y;
		cin >> p >> y;
		py.emplace_back(p, y, i);
	}
	sort(py.begin(), py.end());

	//cout << "py:" << endl;
	//FOR(i, 0, m) cout << get<0>(py[i]) << ", " << get<1>(py[i]) << ", " << get<2>(py[i]) << endl;
	//cout << endl;

	vector<string> ID(m);
	int cnt = 1;

	//初期条件
	ID[get<2>(py[0])] = zeroPadding(get<0>(py[0])) + zeroPadding(1);
	//cout << ID[get<2>(py[0])] << endl;

	FOR(i, 1, m) {
		//pが違うならcntリセット、そうでないならcnt+1
		if (get<0>(py[i]) != get<0>(py[i - 1])) cnt = 1;
		else cnt++;

		ID[get<2>(py[i])] = zeroPadding(get<0>(py[i])) + zeroPadding(cnt);
	}

	//cout << "ID:" << endl;
	FOR(i, 0, m) cout << ID[i] << endl;
	//cout << endl;

}

Measured memory_bytes: 9716
#include <bits/stdc++.h>
typedef long long int ll;
typedef long double ld;
using namespace std;
const long long int INF = 1e18;
const long long int mod = 1e9+7;

typedef pair<ll, ll> pairs;
typedef vector<pairs> p;

struct Edge{
    ll to, weight;
    Edge(ll t, ll w) : to(t), weight(w){}
};
using graph = vector<vector<ll>>;
using Graph = vector<vector<Edge>>;


ll gcd(ll a,ll b){
    if(b == 0){
        return a;
    }else{
        return gcd(b, a%b);
    }
}

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

ll keta(ll N){
    int tmp{};
    while( N > 0 ){
        tmp += ( N % 10 );
        N /= 10;
    }
    N = tmp;
    return N;
}

// 回文
bool kai(string S){
    bool flag = true;
    for(ll i=0;i<S.size()/2;++i){
        if(S[i] != S[S.size()-i-1]){
            flag = false;
            break;
        }
    }
    return flag;
}
// ---------------------------------------------

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

    ll x = a[0];
    for(ll i=1;i<n;++i){
        x ^= a[i];
    }
    string ans = "No";
    if(x == 0){
        ans = "Yes";
    }
    cout<<ans<<endl;

    return 0;
}

Measured memory_bytes: 1024
S=input()
for i in range(len(S)-2):
    if i==0:
        a=abs(int(S[i:i+3])-753)
    else:
        if a>abs(int(S[i:i+3])-753):
            a=abs(int(S[i:i+3])-753)
    
print(a)

Measured memory_bytes: 2940
import java.io.*;
public class Main{
  public static void main(String[] args) throws IOException{
    BufferedReader reader= new BufferedReader(new InputStreamReader(System.in));
    int a = Integer.parseInt(reader.readLine());
    int b = Integer.parseInt(reader.readLine());
    int h = Integer.parseInt(reader.readLine());
    System.out.println((a+b)*h/2);}}

Measured memory_bytes: 22612
from sys import stdin, exit

N = int(stdin.readline().rstrip())
a = [int(x) for x in stdin.readline().rstrip().split()]

num = []
count = []
for k in a:
    if k not in num:
        num.append(k)
        count.append(1)
    else:
        count[num.index(k)] += 1
    if len(num) > 3:
        print('No')
        exit()
if len(num) == 1 and num[0] == 0:
    print('Yes')
    exit()
if len(num) == 2 and num[0] ^ num[1] == num[1] and N % 3 == 0 and count[1] == 2 * count[0]:
    print('Yes')
    exit()
if len(num) == 2 and num[0] ^ num[1] == num[0] and N % 3 == 0 and count[0] == 2 * count[1]:
    print('Yes')
    exit()
if len(num) <= 2:
    print('No')
    exit()
if num[0] ^ num[1] ^ num[2] == 0 and N % 3 == 0 and count[0] == count[1] == count[2]:
    print('Yes')
else:
    print('No')


Measured memory_bytes: 60784
n,m=map(int, input().split())
g=[[] for i in range(n)]
x=[[] for i in range(m)]

count=0
for i in range(m):
    u,v=map(int,input().split())
    u-=1
    v-=1
    g[u].append(v)
    g[v].append(u)
    x[i]=[u,v]
memo=[False for i in range(n)]
memo[0]=True

def dfs(now,prev):
    for next in g[now]:
        
        if next!=prev:
            if memo[next]==True:
                continue
            else:
                memo[next]=True
                dfs(next,now)


for i in range(m):
    g[x[i][0]].remove(x[i][1])
    g[x[i][1]].remove(x[i][0])
    dfs(0,0)
    if memo.count(False)>=1:
        count+=1
    g[x[i][0]].append(x[i][1])
    g[x[i][1]].append(x[i][0])
    memo=[False for i in range(n)]
    memo[0]=True
print(count)
    
    
    
    
    
    

Measured memory_bytes: 3064
// Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools

#include <bits/stdc++.h>

using namespace std;

using i64 = long long;

const i64 MOD = 1e9 + 7;
const i64 INF = i64(1e18) + 7;

const string YES = "Yes";
const string NO = "No";

template <typename T>
bool chmin(T& x, T y){
    if(x > y){
        x = y;
        return true;
    }
    return false;
}

template <typename T>
bool chmax(T& x, T y){
    if(x < y){
        x = y;
        return true;
    }
    return false;
}


void solve(std::string s){
    int n = s.size();
    s = "*" + s;
    int mid = (n - 1) / 2;
    int mid2 = (n + 3) / 2;
    auto t = s.substr(1, mid);
    auto t2 = s.substr(mid2);
    auto t3 = s.substr(1, mid);
    auto t4 = s.substr(mid2);
    reverse(t3.begin(), t3.end());
    reverse(t4.begin(), t4.end());
    auto tt = s.substr(1);
    auto ttt = s.substr(1);
    reverse(tt.begin(), tt.end());
    if(t == t3 && t2 == t4 && tt == ttt)
        cout << "Yes\n";
    else
        cout << "No\n";
}


signed main(){
    std::string S;
    std::cin >> S;
    solve(S);
    return 0;
}


Measured memory_bytes: 256
#include <iostream> // cout, endl, cin
#include <iomanip>
#include <string>        // string, to_string, stoi
#include <vector>        // vector
#include <algorithm>     // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility>       // pair, make_pair
#include <tuple>         // tuple, make_tuple
#include <cstdint>       // int64_t, int*_t
#include <cstdio>        // printf
#include <map>           // map
#include <queue>         // queue, priority_queue
#include <set>           // set
#include <stack>         // stack
#include <deque>         // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset>        // bitset
#include <cctype>        // isupper, islower, isdigit, toupper, tolower
#include <math.h>
#include <numeric>
using namespace std;
#define _GLIBCXX_DEBUG
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
const int INF = 1001001001;

int main()
{
    vector<vector<int>> v(3, vector<int>(3));
    rep(i, 3)
    {
        rep(j,3) cin >> v.at(i).at(j);
    }
    rep(i, 2)
    {
        if(v[i][0] - v[i+1][0] != v[i][1] - v[i+1][1])
        {
            cout << "No" << endl;
            return 0;
        }
        if(v[i][0] - v[i+1][0] != v[i][2] - v[i+1][2])
        {
            cout << "No" << endl;
            return 0;
        }
    }
    rep(j, 2)
    {
        if(v[0][j] - v[0][j+1] != v[1][j] - v[1][j+1])
        {
            cout << "No" << endl;
            return 0;
        }
        if(v[0][j] - v[0][j+1] != v[2][j] - v[2][j+1])
        {
            cout << "No" << endl;
            return 0;
        }
    }
    cout << "Yes" << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int a;
	int b;
	int c;
	int k;
	cin>>a>>b>>c>>k;
	if(max(a,b)-min(a,b)<=k&&max(c,b)-min(c,b)<=k||max(c,a)-min(c,a)<=k)
		cout<<"Yes";
	else
		cout<<"No";
		return 0;
}

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

int N;
string S;

signed main()
{
    cin >> N >> S;
    
    int ma = 0;
    int x = 0;
    REP(i,N) {
        if (S[i] == 'I') x++;
        else x--;
        ma = max(ma, x);
    }
    
    cout << ma << endl;
}


Measured memory_bytes: 256
#include <stdio.h>
#include <iostream>
#include <vector>
#include <string>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <math.h>
#include <algorithm>
using namespace std;
#define ll long long
const double EPS = 1e-10;
const ll MOD = 7+(1e+9);

int main(){
  ll a,b,t;
  cin>>a>>b>>t;
  cout<<(t/a)*b<<endl;
}


Measured memory_bytes: 256
//  main.cpp
//  solve
//
//  Created by Ahmed on 11/16/16.
//  Copyright © 2016 Abdellah. All rights reserved.
//


#include<set>
#include<map>
#include <unordered_map>
#include <unordered_set>
#include<list>
#include<iomanip>
#include<cmath>
#include<string>
#include<vector>
#include<queue>
#include<stack>
#include<complex>
#include<sstream>
#include<iostream>
#include<fstream>
#include<algorithm>
#include<numeric>
#include<utility>
#include<functional>
#include<stdio.h>
#include<assert.h>
#include<memory.h>
#include<bitset>
#include<math.h>
#include <strings.h>
#include <array>


#define f first
#define s second
#define pb push_back
#define sz(a) (int)a.size()
#define lp(i,a,n) for(int (i)=(a);(i)<=(int)(n);(i)++)
#define lpd(i,n,a) for(ll (i)=(n);(i)>=(a);--(i))
#define mp make_pair
#define clr(a,b) memset(a,b,sizeof a)
#define all(v) v.begin(),v.end()
#define mod 1000000007
#define eps 1e-6
#define infi 1000000002
#define infll 1000000000000000000ll
#define MX 1000000
#define X real()
#define Y imag()
#define polar(r,t) ((r)* exp(point(0,(t))))
#define length(a) hypot( (a).X , (a).Y )
#define angle(a) atan2( (a).Y , (a).X )
#define vec(a,b) ( (b) - (a) )
#define dot(a,b) (conj(a)*(b)).X
#define cross(a,b) (conj(a)*(b)).Y
#define lengthsqr(a) dot(a,a)
#define reflect(V,M) (conj((V)/(M)) * (M))
#define normalize(a)   ((a)/length(a))
#define ccw(a,b,c)   cross(vec(a,b) , vec(a,c)) > -eps
#define cosRule(a,b,c) (acos(((a)*(a)+(b)*(b)-(c)*(c))/(2*(a)*(b))))
#define cosDot(a,b) (acos(dot(a,b)/length(a)/length(b)))
#define EQ(a,b) (fabs((a) - (b)) <= eps) /* equal to */
#define NE(a,b) (fabs((a) - (b)) > eps)  /* not equal to */
#define LT(a,b) ((a) < (b) - eps)        /* less than */
#define GT(a,b) ((a) > (b) + eps)        /* greater than */
#define LE(a,b) ((a) <= (b) + eps)       /* less than or equal to */
#define GE(a,b) ((a) >= (b) - eps)       /* greater than or equal to */
#define mod1 100050001
#define mod2 100030001
#define base1 37
#define base2 31
#define que priority_queue<pair<int,int>, vector<pair<int,int>> , greater<pair<int,int> > >
#define rotate(v,t) ((v)*exp(point(0,t)))
#define rotateabout(v,t,a) (rotate(vec(a,v),t)+(a))
#define PI atan(1)*4

using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<double,double> pdd;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vi> vvi;
typedef set<int> si;
typedef map<int, int> mii;
typedef complex<long double> point;
typedef pair<point, point> line;
typedef pair<double , point> Circle;


const int N = 100002;

int n , p[N];

int main()
{
    scanf("%d",&n);
    int ans = 0 , add = 0;
    lp(i,1 , n) {
        scanf("%d",&p[i]);
        if(p[i] == i) ++add;
        else  ans += ceil(add/2.0), add = 0;
    }
    ans += ceil(add/2.0);
    printf("%d\n",ans);
    return 0;
}


/*
 */
//freopen("output.txt","w",stdout);
//freopen("input.txt","r",stdin);
//ios::sync_with_stdio(0);cin.tie(0);

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

using namespace std;

int main()
{
    int H1, H2, M1, M2;
    cin >> H1 >> M1 >> H2 >> M2;
    int k;
    cin >> k;

    int TotalMins = ((H2 - H1) * 60) + (M2 - M1);
    ((TotalMins - k) > 0) ? cout << (TotalMins - k) : cout << 0;

    return 0;
}


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

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

typedef int _loop_int;
#define REP(i,n) for(_loop_int i=0;i<(_loop_int)(n);++i)
#define FOR(i,a,b) for(_loop_int i=(_loop_int)(a);i<(_loop_int)(b);++i)
#define FORR(i,a,b) for(_loop_int i=(_loop_int)(b)-1;i>=(_loop_int)(a);--i)

#define DEBUG(x) cout<<#x<<": "<<x<<endl
#define DEBUG_VEC(v) cout<<#v<<":";REP(i,v.size())cout<<" "<<v[i];cout<<endl
#define ALL(a) (a).begin(),(a).end()

#define CHMIN(a,b) a=min((a),(b))
#define CHMAX(a,b) a=max((a),(b))

// mod
const ll MOD = 1000000007ll;
#define FIX(a) ((a)%MOD+MOD)%MOD

// floating
typedef double Real;
const Real EPS = 1e-11;
#define EQ0(x) (abs(x)<EPS)
#define EQ(a,b) (abs(a-b)<EPS)
typedef complex<Real> P;

char s[125252];
int n;
int qcnt[125252];
int trip[125252];
int acnt[125252];
int ccnt[125252];

int main(){
  scanf("%s",s);
  n = strlen(s);
  REP(i,n)qcnt[i+1] = qcnt[i] + (s[i]=='?');
  REP(i,n)acnt[i+1] = acnt[i] + (s[i]=='A');
  REP(i,n)ccnt[i+1] = ccnt[i] + (s[i]=='C');
  trip[0] = 1;
  FOR(i,1,125252)trip[i] = 3ll * trip[i-1] % MOD;
  int ans = 0;
  REP(i,n){
    if(s[i]=='A' || s[i]=='C')continue;
    int aa = acnt[i];
    int cc = ccnt[n] - ccnt[i+1];
    int qa = qcnt[i];
    int qc = qcnt[n] - qcnt[i+1];
    int la = (ll)aa*trip[qa]%MOD;
    if(qa>0){
      la += (ll)qa*trip[qa-1]%MOD;
      la %= MOD;
    }
    int rc = (ll)cc*trip[qc]%MOD;
    if(qc>0){
      rc += (ll)qc*trip[qc-1]%MOD;
      rc %= MOD;
    }
    ans += (ll)la * rc % MOD;
    ans %= MOD;
  }
  printf("%d\n",ans);
  return 0;
}


Measured memory_bytes: 2048
#include <iostream>                                                                                                               
#include <iomanip>                                                                                                                
#include <cmath>                                                                                                                  
#define _USE_MATH_DEFINES                                                                                                         
using namespace std;                                                                                                              
                                                                                                                                  
int main(void) {                                                                                                                  
  double r;                                                                                                                       
  cin >> r;                                                                                                                       
  double S = M_PI*pow(r,2);                                                                                                       
  double R = 2*M_PI*r;                                                                                                            
  cout << fixed << setprecision(6) << S << " " << R << endl;                                                                      
}                                                                                                                                 
                                                                                                                                  
                                                                                                                                  
                                                     

Measured memory_bytes: 3280
import sys

def sales_result(sales):
    total_sales = {}
    person = []
    for s in sales:
        total_sales[s[0]] = total_sales.get(s[0], 0)
        total_sales[s[0]] += s[1] * s[2]
        if total_sales[s[0]] >= 1000000 and not (s[0] in person):
            person.append(s[0])
    if len(person) == 0:
        print("NA")
    else:
        for p in person:
            print(p)


lineno = 0
n = 0
sales = []
for line in sys.stdin:
    if lineno == 0:
        n = int(line)
        if n == 0:
            break
    elif lineno <= n:
        s = list(map(int, line.strip().split()))
        sales.append(s)
    if lineno == n:
        sales_result(sales)
        lineno = 0
        sales = []
    else:
        lineno += 1



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

#define NREP() for(ll i = 0; i < n; i++)
#define MREP() for(ll j = 0; j < m; j++)
#define REP(i, n) for(ll i = 0; i < n; i++)
#define ALL(x) (x).begin(), (x).end()
#define MSG(x) cout << x << endl;
#define IPT(t, x) t ipt; cin >> ipt; x.push_back(ipt);
#define YN(x) x ? cout << "YES" << endl : cout << "NO" << endl;
#define Yn(x) x ? cout << "Yes" << endl : cout << "No" << endl;
#define yn(x) x ? cout << "yes" << endl : cout << "no" << endl;

using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
typedef vector<string> vs;
typedef vector<vector<string>> vvs;

const static ll MOD = 1e9 + 7;
ll n, cnt, ans, tmp, sum, a, b, c, d, k, m, h, w, q, x, y;
string s, t;

int main() {
    cin >> a >> b >> c;
    if (a == b) MSG(c)
    else if (a == c) MSG(b)
    else
        MSG(a)
}


Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.StringTokenizer;

public class Main {


    public static void main(String[] args) throws IOException {
        Scanner s = new Scanner(System.in);
        int n= s.nextInt();
        if(n%2==0) System.out.println(n);
        else System.out.println(n*2);


    }




}


class Scanner
{
    StringTokenizer st;
    BufferedReader br;

    public Scanner(InputStream s){	br = new BufferedReader(new InputStreamReader(s));}

    public String next() throws IOException
    {
        while (st == null || !st.hasMoreTokens())
            st = new StringTokenizer(br.readLine());
        return st.nextToken();
    }

    public int nextInt() throws IOException {return Integer.parseInt(next());}

    public long nextLong() throws IOException {return Long.parseLong(next());}

    public String nextLine() throws IOException {return br.readLine();}

    public double nextDouble() throws IOException
    {
        String x = next();
        StringBuilder sb = new StringBuilder("0");
        double res = 0, f = 1;
        boolean dec = false, neg = false;
        int start = 0;
        if(x.charAt(0) == '-')
        {
            neg = true;
            start++;
        }
        for(int i = start; i < x.length(); i++)
            if(x.charAt(i) == '.')
            {
                res = Long.parseLong(sb.toString());
                sb = new StringBuilder("0");
                dec = true;
            }
            else
            {
                sb.append(x.charAt(i));
                if(dec)
                    f *= 10;
            }
        res += Long.parseLong(sb.toString()) / f;
        return res * (neg?-1:1);
    }

    public boolean ready() throws IOException {return br.ready();}


}

Measured memory_bytes: 25404
#include <iostream>
#include <cstdlib>
#include <cstdio>
using namespace std;
int main(){
    for (int i = 1; i <= 9; i++)
        for (int j = 1; j <= 9; j++)
            cout << i << "x" << j << "=" << i * j << endl;
    return 0;
}

Measured memory_bytes: 1116
#include <iostream>
#include <algorithm>
#define ll long long
using namespace std;

int main(){
    ll n, m, c = 0;
    cin >> n >> m;
    ll ar[n];
    long double s = 0, b;
    for(ll i = 0;i<n;i++){
        cin >> ar[i];
        s += ar[i];
    }
    b = s/(4*m);
    sort(ar, ar+n);
    for(ll i = n-1;i>=0;i--){
        if(ar[i] >= b)
            c++;
    }
    if(c >= m)
        cout << "Yes";
    else
        cout << "No";
}


Measured memory_bytes: 256
/**-------------------------
|--------From A.R.A--------|
-------------------------**/

#include <bits/stdc++.h>
using namespace std;
/*#define ll            long long int
#define pb            push_back
#define ull           unsigned long long int
#define endl          "\n"
#define sz(c)         (c).size()
#define sall(c)       sort((c).begin(),(c).end())
#define rsall(c)      sort((c).rbegin(),(c).rend())
#define rev(c)        reverse((c).begin(),(c).end())
#define FOR(i,n)      for(ll i=0;i<n;i++)
#define max3(a,b,c)   max(max(a,b),c)
#define min3(a,b,c)   min(min(a,b),c)
#define input(a,i,n)  for(ll i=0;i<n;i++){      cin>>a[i];}
#define output(a,i,n) for(ll i=0;i<n;i++){cout<<a[i]<<" ";}


int64_t R=1;
void solution(){
    int64_t x,n,ml=-1,mr=-1,q,mx=0;
    cin>>x>>n;

    if(n==0){cout<<x<<endl; return;}

    vector <int64_t> pos(101);
    pos[0]=-1;
    mx=x;
    for(int i=1;i<=n;i++){
        cin>>q;
        pos[q]=q;
        mx=max(q,mx);
    }
    for(int i=x;i<=mx+1;i++){
        if(pos[i]==0){ml=i;break;}
    }
    for(int i=x;i>0;i--){
       if(pos[i]==0){mr=i;break;}
    }
    if(mr==-1){
        if(abs(x)<abs(ml-x)){cout<<"0"<<endl;return;}
    }
    if(abs(x-mr)>abs(mr-x)){cout<<mr<<endl;return;}
    else{cout<<ml<<endl;return;}

}*/
int main()
{
    int a,b;
    cin>>a>>b;
    if(b%2==0 && a*2<=b && a*4>=b){cout<<"Yes"<<endl;}
    else{cout<<"No"<<endl;}
    return 0;
}


Measured memory_bytes: 3676
L,R = list(map(int,input().split()))
 
min = 20000000
 
#探索範囲決め
for i in range(L,R+1):
    tmp = i
    if tmp % 2019 == 0:
        break

for i in range(L,tmp+2):
    for j in range(i + 1,tmp+2):
        if min > (i * j) % 2019 and i <= R and j <= R and L <= i:
            min = (i * j) % 2019
            if min == 0:
                break
    if min == 0:
        break
 
print(min)

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

#define rep(i, n) for (int i = 0; i < (n); i++)
#define repr(i, n) for (int i = (n) - 1; i >= 0; i--)

using namespace std;
using ll = long long;

const int MOD = 1000000007;

struct mint { int n; mint(int n_ = 0) : n(n_) {} };
mint operator-(mint a) { return -a.n + MOD * (a.n != 0); }
mint operator+(mint a, mint b) { int x = a.n + b.n; return x - (x >= MOD) * MOD; }
mint operator-(mint a, mint b) { int x = a.n - b.n; return x + (x < 0) * MOD; }
mint operator*(mint a, mint b) { return (long long)a.n * b.n % MOD; }
mint &operator+=(mint &a, mint b) { return a = a + b; }
mint &operator-=(mint &a, mint b) { return a = a - b; }
mint &operator*=(mint &a, mint b) { return a = a * b; }
istream &operator>>(istream &i, mint &a) { return i >> a.n; }
ostream &operator<<(ostream &o, mint a) { return o << a.n; }

int main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  ll N, K;
  cin >> N >> K;
  // i=N/prev -> 1..i
  vector<int> from;
  vector<int> cnt;
  from.push_back(1);
  ll k = 1;
  while (k <= N) {
    ll l = k;
    ll r = N+1;
    while (r - l > 1) {
      ll m = (l + r) / 2;
      if (N / l == N / m) {
        l = m;
      } else {
        r = m;
      }
    }
    from.push_back(r);
    cnt.push_back(r - k);
    k = r;
  }
  const int m = cnt.size();
  vector<mint> dp0(m+1);
  dp0[0] = 1;
  rep(i, K) {
    vector<mint> dp1(m+1);
    rep(j, m) {
      // from[j] * k <= N
      // k <= floor(N/from[j])
      int k = upper_bound(from.begin(), from.end(), N/from[j]) - from.begin();
      dp1[0] += dp0[j];
      dp1[k] -= dp0[j];
    }
    rep(j, m) {
      dp1[j+1] += dp1[j];
      dp1[j] *= cnt[j];
    }
    dp0 = dp1;
  }
  mint ans = 0;
  rep(j, m) {
    ans += dp0[j];
  }
  cout << ans << endl;
}


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

int main(){
    int a,b; cin>>a>>b;
    if(a+b==15) cout<<"+"<<endl;
    else if(a*b==15) cout<<"*"<<endl;
    else cout<<"x"<<endl;
	return 0;
}


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

int n;
int m;

#define MAX 100002

vector<long long int> x;
vector<long long int> y;

long long int sx;
long long int sy;
#define MOD 1000000007LL
int main(){
	cin >> n >> m;
	for (int i = 0; i < n; i++){
		int a;
		scanf("%d", &a);
		x.push_back(a);
	}
	sort(x.begin(), x.end());
	long long int im = 0;
	for (int i = 0; i < x.size(); i++){
		sx += ((long long int)(i)*x[i])%MOD+MOD-im;
		im += x[i];
		sx %= MOD;
		im %= MOD;
	}
	for (int i = 0; i < m; i++){
		int a;
		scanf("%d", &a);
		y.push_back(a);
	}
	sort(y.begin(), y.end());
	im = 0;
	for (int i = 0; i < y.size(); i++){
		sy += ((long long int)(i)*y[i])%MOD+MOD - im;
		im += y[i];
		sy %= MOD;
		im %= MOD;
	}
	sx *= sy;
	sx %= MOD;
	printf("%lld\n", sx);
	return 0;
}

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

int main()
{
    int n;
    cin>>n;
    int cntA=0,cntW=0,cntT=0,cntR=0;
    while(n--)
    {
         string s;
         cin>>s;
         if(s=="AC")
             cntA++;
         else if(s=="TLE")
             cntT++;
         else if(s=="WA")
             cntW++;
         else
             cntR++;
    }
    cout<<"AC x "<<cntA<<"\n";
    cout<<"WA x "<<cntW<<"\n";
    cout<<"TLE x "<<cntT<<"\n";
    cout<<"RE x "<<cntR<<"\n";

    

}


Measured memory_bytes: 3632
N=int(input())
from collections import defaultdict,deque
branch=defaultdict(set)
for i in range(N-1):
    a,b=map(int,input().split())
    a-=1
    b-=1
    branch[a]|={b}
    branch[b]|={a}
check={0}
bef=[-2]*N
bef[0]=-1
dist=[float('inf')]*N
dist[0]=0
while len(check)>0:
    now=check.pop()
    for nex in branch[now]:
        if bef[nex]==-2:
            bef[nex]=now
            check|={nex}
            dist[nex]=dist[now]+1
NG=set()
OK={0}
now=N-1
checked={0}
for i in range((1+dist[N-1])//2):
    NG|={now}
    now=bef[now]
checked|=NG
for i in range(N):
    if i in checked:
        continue
    else:
        visited={i}
        now=i
        while True:
            now=bef[now]
            visited|={now}
            if now in NG:
                NG|=visited
                checked|=visited
                break
            elif now in OK:
                OK|=visited
                checked|=visited
                break
if len(OK)>N//2:
    print("Fennec")
else:
    print("Snuke")

Measured memory_bytes: 56104
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define reps(i, n) for (int i=1; i < (int)(n); i++)
#define rrep(i, n) for (int i=((int)(n)-1); i>=0; i--)
#define rreps(i, n) for (int i=((int)(n)-1); i>0; i--)
#define ALL(x) (x).begin(), (x).end()
#define SZ(x) ((int)(x).size())
using namespace std;
using lint = long long;
using p = pair<int, int>;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

int main() {
  string s; cin >> s;
  int N = s.size();
  lint ans = 0;
  for (int i = 0; i < (lint)pow(2, N-1); i++) {
    lint tmp = s[N-1] - '0';
    lint rate = 10;
    for (int j = 0; j < N-1; j++) {
      if (1<<j & i) {
        tmp += (s[N-2-j] - '0');
        rate = 10;
      }else {
        tmp += (s[N-2-j] - '0') * rate;
        rate *= 10;
      }
    }
    // printf("%lld\n", tmp);
    ans += tmp;
  }

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


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

using namespace std;

#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define BIT(X, i) ((X>>i)&1)
#define REP(i, a, b) for(int i = (a); i < (b); ++i)
#define rep(i, n) for(int i = 0; i < (n); ++i)
#define all(a) (a).begin(), (a).end()
#define r_all(a) (a).rbegin(), (a).rend()
#define in(x) cin>>x
#define ina(x, n) rep(x_i,n) cin>>x[x_i]
#define outa(x, n) rep(x_i,n) cout<<x[x_i]<<" \n"[x_i==n-1]

typedef long long ll;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef pair<ll, ll> pll;
typedef vector<pll> vll;
typedef priority_queue<ll> pq;

const int MOD = 1e9+7;
const int INF = (1<<30);
const ll INFL = (1L<<62);

int main() {
  int n, m, c, ans = 0;
  cin >> n >> m >> c;
  vl b(m); ina(b,m);
  rep(i,n) {
    vl a(m); ina(a,m);
    int sum = c;
    rep(j,m) {
      sum += a[j] * b[j];
    }
    if (sum > 0) ans++;
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
    using namespace std;
     
    int main() {
    int k[105][105]={0};
    int n,l,a,b;
    cin>>n;
    for(int j=0;j<n;j++){
    cin>>l>>a;
    for(int i=0;i<a;i++){
    cin>>b;
    k[j][b-1]=1;
    }
    }
     
    for(int r=0;r<n;r++){
    for(int e=0;e<n-1;e++){
    cout<<k[r][e]<<" ";
    }
    cout<<k[r][n-1]<<endl;
    }
    return 0;
    }

Measured memory_bytes: 1208
{-# OPTIONS_GHC -O2 -funbox-strict-fields #-}
import qualified Data.ByteString.Char8 as BS
import           Data.List             (sortOn)
import           Data.Maybe            (fromJust)

main :: IO ()
main = do
  [n, m] <- map readInt . BS.words <$> BS.getLine
  abs <- map readInt2 . BS.lines <$> BS.getContents
  print $ solve n m abs

solve :: Int -> Int -> [(Int, Int)] -> Int
solve _ _ abs = fst $ foldl f (0, 0) abs' where
  abs' =  sortOn snd abs
  f (c, x) (a, b)
    | a < x     = (c, x)
    | otherwise = (c + 1, b)

readInt :: BS.ByteString -> Int
readInt = fst . fromJust . BS.readInt

readInt2 :: BS.ByteString -> (Int, Int)
readInt2 s = (a, b) where
  [a, b] = map readInt $ BS.words s


Measured memory_bytes: 46460
#include<stdio.h>
#include<string.h>
 
int main(){
	
	int num;
	char str[100];
	scanf("%d", &num);
	scanf("%s", str);
	
	if(num%2 != 0){
		printf("No\n");
		return 0;
	}
	for(int i=0;i<num/2;i++){
		if(str[i] != str[num/2+i]){
			printf("No\n");
			return 0;
		}
	}
	printf("Yes\n");
return 0;
}

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

import numpy as np

def main():
  n, k = map(int, input().split())
  A = np.array(sorted(list(map(int, input().split()))))
  F = np.array(sorted(list(map(int, input().split())), reverse=True))
  def is_time(x):
    c = np.maximum(A - x//F, 0).sum()
    if c <= k:
      return True
    return False
  ng = -1
  ok = max(A*F)
  while ok - ng > 1:
    m = (ng + ok)//2
    if is_time(m):
      ok = m
    else:
      ng = m
  print(ok)
  
if __name__ == "__main__":
  main()


Measured memory_bytes: 37312
#include <bits/stdc++.h>
#define SZ(X) ((int)(X).size())
#define ALL(X) (X).begin(), (X).end()
#define REP(I, N) for (int I = 0; I < (N); ++I)
#define REPP(I, A, B) for (int I = (A); I < (B); ++I)
#define RI(X) scanf("%d", &(X))
#define RII(X, Y) scanf("%d%d", &(X), &(Y))
#define RIII(X, Y, Z) scanf("%d%d%d", &(X), &(Y), &(Z))
#define DRI(X) int (X); scanf("%d", &X)
#define DRII(X, Y) int X, Y; scanf("%d%d", &X, &Y)
#define DRIII(X, Y, Z) int X, Y, Z; scanf("%d%d%d", &X, &Y, &Z)
#define RS(X) scanf("%s", (X))
#define CASET int ___T, case_n = 1; scanf("%d ", &___T); while (___T-- > 0)
#define MP make_pair
#define PB push_back
#define MS0(X) memset((X), 0, sizeof((X)))
#define MS1(X) memset((X), -1, sizeof((X)))
#define LEN(X) strlen(X)
#define PII pair<int,int>
#define VI vector<int>
#define VL vector<long long>
#define VPII vector<pair<int,int> >
#define PLL pair<long long,long long>
#define VPLL vector<pair<long long,long long> >
#define F first
#define S second
typedef long long LL;
using namespace std;
const int MOD = 1e9+7;
const int SIZE = 1e6+10;
int main(){
    VI a;
    DRI(n);
    REP(i,n){
        DRI(x);
        a.PB(x);
    }
    sort(ALL(a));
    if(a[0]==a.back()){
        if(a[0]==n-1)puts("Yes");
        else if(a[0]>=1&&a[0]<=n/2)puts("Yes");
        else puts("No");
    }
    else{
        if(a.back()-a[0]>1)puts("No");
        else{
            int r=0;
            REP(i,SZ(a)){
                if(a[i]==a[0])r=max(r,i+1);
            }
            int l=n-r;
            //printf("l:%d\n",l);
            if(l==1)return 0*puts("No");
            puts((a[0]>=r&&a[0]+1<=r+(l/2))?"Yes":"No");
        }
    }
    return 0;
}


Measured memory_bytes: 892
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <deque>
#include <list>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <cfloat>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <fstream>
#include <functional>
#include <bitset>

using namespace std;


#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define repr(i,n) for(int (i)=(n); (i)>=(0); (i)--)
#define SIZE(x) ((int)(x).size())
#define GCD(a, b) int gcd(int a,int b){return b?gcd(b,a%b):a;}
#define QP(a, b) int qp(int a,ll b){int ans=1;do{if(b&1)ans=1ll*ans*a%mo;a=1ll*a*a%mo;}while(b>>=1);return ans;}
#define pb(a) push_back(a)
#define mp(a,b) make_pair(a,b)
#define all(v) (v).begin(),(v).end()


template<typename T> void chmax(T &a, T b) {a = max(a, b);}
template<typename T> void chmin(T &a, T b) {a = min(a, b);}
template<typename T> void chadd(T &a, T b) {a = a + b;}
template<typename A, size_t N, typename T>
void FILL(A (&array)[N], const T &val){
    std::fill( (T*)array, (T*)(array+N), val );
}

typedef vector<int, int> vint;
typedef pair<int,int> pint;
typedef vector<pint>vpint;
typedef long long ll;

int dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};
const ll INF = 1LL << 60;
const ll MOD = 1000000007LL;


int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int a, b; cin >> a >> b;
    if(a+b>=10) cout << "error";
    else cout << a+b;
    return 0;
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
constexpr int di[] = { 0, 1, 0, -1 }, dj[] = { 1, 0, -1, 0 };
#define rep(i, n) for (int i = 1; i <= n; i++)
#define repr(i, n) for (int i = n; i >= 0; i--)
#define SORT(v) sort((v).begin(), (v).end())
#define SORTR(v) sort((v).rbegin(), (v).rend())
#define all(v) (v).begin(), (v).end()
#define vmax 10000
constexpr ll inf = 100000000000000;
/*cout<<fixed<<setprecision(20);cin.tie(0);ios::sync_with_stdio(false);*/

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

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

//素因数分解
map<int,int> prime_factor(ll n,map<int,int> &res){
    for(ll i=2;i*i<=n;i++){
        while(n%i==0){
            res[i]++;
            n/=i;
        }
    }
    if(n!=1){
        if(res[n]==0){
            res[n]=1;
        }else{
            res[n]++;
        }
    }
    return res;
}

//約数列挙
vector<ll> divisor(ll n){
    vector<ll> a;
    for(ll i=1;i*i<=n;i++){
        if(n%i==0){
            a.push_back(i);
            if(i*i!=n){
                a.push_back(n/i);
            }
        }
    }
    SORT(a);
    return a;
}

//拡張ユークリッドの互除法
int extgcd(ll a,ll b,ll &x,ll &y){
    if(b==0){
        x=1;
        y=0;
        return a;
    }else{
        int d=extgcd(b,a%b,y,x);
        y-=a/b*x;
        return d;
    }
}

//素数判定
void sieve(int n,vector<bool> &is_prime) {
	is_prime[0]=false;
	is_prime[1]=false;
	for (int i = 2; i * i <= n; i++) {
		if (is_prime[i]) {
			for (int j = i * i; j <= n; j += i) is_prime[j] = false;
		}
	}
	return;
}

//繰り返し2乗法
ll mod_pow(ll x,ll n,ll mod){
    x%=mod;
    ll res=1;
    while(n>0){
        if(n&1){
            res=res*x%mod;
        }
        x=x*x%mod;
        n>>=1;
    }
    return res;
}

//mod　m での a の逆元
int mod_inverse(ll a,ll m){
    ll x,y;
    extgcd(a,m,x,y);
    return (m+x%m)%m;
}

vector<ll> factrial, inverse;

//nCkの前計算
void init(ll n,ll m){
    factrial.resize(n+1);
    inverse.resize(n+1);
    factrial[0]=1;
    inverse[0]=1;
    for(ll i=1;i<=n;i++){
        factrial[i]=factrial[i-1]*i%m;
        inverse[i]=mod_inverse(factrial[i],m);
    }
}

//nCk
ll nCk(ll n,ll k,ll m){
    if(n<0||k<0||n<k){
        return 0;
    }
    return factrial[n]*inverse[k]%m*inverse[n-k]%m;
}

int mod=1e9+7;
vector<ll> a,b;

int main(){
    int n,k;
    cin>>n>>k;
    ll ans=0;
    init(n,mod);
    rep(i,k){
        cout<<(nCk(n-k+1,i,mod)*nCk(k-1,i-1,mod))%mod<<endl;
    }
    
}


Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;
int main()
{
	int asum=0,bsum=0,a,b;
	for(int i=0;i<4;i++)
	{
		cin>>a;
		asum+=a;
	}
	for(int i=0;i<4;i++)
	{
		cin>>b;
		bsum+=b;
	}
	if(asum>bsum)
		cout<<asum<<endl;
	else
		cout<<bsum<<endl;
	return 0;
}


Measured memory_bytes: 3092
#include <cstdio>

int K;

int min(int a, int b, int c) {
	if(a <= b && a <= c) return a;
	if(b <= a && b <= c) return b;
	// if(c <= a && c <= b) return c;
	return c;
}

int gcd(int a, int b, int c) {
	int minval;
	// printf("method in : a=%d, b=%d, c=%d\n", a, b, c);
	// printf("a == b && b == c = %d\n", !(a == b && b == c));
	while(!(a == b && b == c)) {
		minval = min(a, b, c);
		// printf("minval = %d\n", minval);
		if(a % minval == 0
		&& b % minval == 0
		&& c % minval == 0) {
			return minval;
		}
		
		if(a != minval) a -= minval;
		if(b != minval) b -= minval;
		if(c != minval) c -= minval;
	}
	// printf("a = %d\n", a);
	return a;
}


int main()
{
	scanf("%d", &K);

	long sum = 0;

	for(int i = 1; i <= K; i++) {
		for(int j = 1; j <= K; j++) {
			for(int m = 1; m <= K; m++) {
				sum += gcd(i, j, m);
			}
		}
	}
	printf("%ld", sum);

	return 0;
}

Measured memory_bytes: 1732
#include<bits/stdc++.h>
using namespace std;
#define all(a)  (a).begin(),(a).end()
typedef long long ll;
const ll mod=1000000007;
#define repi(i,a,b) for(int i=int(a);i<int(b);++i)

int main() {
  int n,h,w;cin >>n>>h>>w;
  int cnt =0;
  repi(i,0,n){
    int a,b;cin >>a>>b;
    if(a>=h&&b>=w) ++cnt;
  }
  cout << cnt << endl;
  return 0;
}


Measured memory_bytes: 256