akhauriyash/Code-Regression huggingface dataset:
listA = []
while True:
    try:
        listA.append(list(map(int,input().split())))
    except:
        break;

listB = []
listB = listA[:3]
n = listA[3][0]

listC = []
for i in range(0,n):
	listC.append(listA[i+4][0])


for i in range(0,n):
  for j in range(0,3):
    for k in range(0,3):
      if listB[j][k]==listC[i]:
        listB[j][k] = -1

kekka = 0
for i in range(0,3):
  if listB[i][0]==-1 and listB[i][1]==-1 and listB[i][2]==-1:
    kekka = 1
for i in range(0,3):
  if listB[0][i]==-1 and listB[1][i]==-1 and listB[2][i]==-1:
    kekka = 1
if listB[0][0]==-1 and listB[1][1]==-1 and listB[2][2]==-1:
  kekka = 1
if listB[0][2]==-1 and listB[1][1]==-1 and listB[2][0]==-1:
  kekka = 1

if kekka == 1:
  print("Yes")
else:
  print("No")

Measured memory_bytes: 3064
#include <stdio.h>

int fib(int);
int f[50];
int df[50];

int main(){
  int num;
  int i;

  scanf("%d",&num);
  for(i=1;i<=num;i++) df[i]=0;
  
  printf("%d\n",fib(num));
  
  return 0;
}

int fib(int k){
  int i;
  if(k==0||k==1){
    return f[k]=1;
  }
  if(df[k]==1) return f[k];
  df[k]=1;
  return f[k]=fib(k-2)+fib(k-1);
}



Measured memory_bytes: 2108
#include <iostream>
#include<vector>
#define rep(i,n) for(int i = 0; i < (n); i++)

using namespace std;

int main() {
    vector<int>antena(5);
    rep(i,5)cin>>antena[i];
    int k;
    cin>>k;
    bool communicate=true;
    
    rep(i,5){
        rep(j,i){
            if(antena[i]-antena[j]>k){
                communicate=false;
                break;
            }
            if(!communicate)break;
        }
    }
    if(communicate)cout<<"Yay!"<<endl;
    else cout<<":("<<endl;
    return 0;
}

Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
// #define USE_LLONG_AS_INT
#ifdef USE_LLONG_AS_INT
#define int long long
#define inf (1ll<<60)
#else
#define inf (1<<30)
#endif
#define rep(i,n) for(int i=0;i<n;i++)
#define Rep(i,a,b) for(int i=a;i<b;i++)
#define REP(i,a,b) for(int i=a;i<=b;i++)
#define rev(i,n) for(int i=(n)-1;i>=0;i--)
#define vi vector<int>
#define vvi vector<vi>
#define pb push_back
#define pi pair<int,int>
#define vp vector<pair<int,int>>
#define mp make_pair
#define all(v) (v).begin(),(v).end()
#define fi first
#define se second
#define MEMSET(a) memset(a,0,sizeof(a))
#define Yes(f) cout<<(f?"Yes":"No")<<endl
#define yes(f) cout<<(f?"yes":"no")<<endl
#define YES(f) cout<<(f?"YES":"NO")<<endl
#define SORT(v) sort(all(v))
#define RSORT(v) sort(all(v), greater<int>())

using namespace std;

const int mod=1e9+7;
const string sp=" ";

void run();

void init() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout<<fixed<<setprecision(12);
}

signed main(){
    init();
    run();
    return 0;
}

vvi b;
int h,w;

bool is_valid(int y,int x){
    return 0<=y&&y<h&&0<=x&&x<w;
}
    
int dfs(int y,int x,int d){
    if(d>10)return inf;
    int dy[]={0,1,0,-1},dx[]={1,0,-1,0};
    int ans=inf;
    rep(i,4){
        int ny=y+dy[i],nx=x+dx[i];
        if(is_valid(ny,nx)&&b[ny][nx]==1)continue;
        while(is_valid(ny,nx)){
            if(b[ny][nx]==3)return d;
            if(b[ny][nx]==1){
                b[ny][nx]=0;
                ans=min(ans,dfs(ny-dy[i],nx-dx[i],d+1));
                b[ny][nx]=1;
                break;
            }
            ny+=dy[i],nx+=dx[i];
        }
    }
    return ans;
}

void run(){
    cin>>w>>h;
    if(!w)return;
    b=vvi(h,vi(w));
    rep(i,h)rep(j,w)cin>>b[i][j];
    int sy,sx;
    rep(i,h)rep(j,w)if(b[i][j]==2)sy=i,sx=j;
    int ans;
    cout<<((ans=dfs(sy,sx,1))==inf?-1:ans)<<endl;
    run();
}


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

int main()
{
    int A[5], B[5];

    while ( cin >> A[0] >> B[0], A[0] || B[0] ) {
        int maxp = 0;
        for ( int i = 1; i < 5; i++ ) {
            cin >> A[i] >> B[i];
            if ( A[maxp] + B[maxp] < A[i] + B[i] ) {
                maxp = i;
            }
        }
        cout << (char)('A' + maxp) << " " << A[maxp] + B[maxp] << endl;
    }

    return ( 0 );
}


Measured memory_bytes: 3000
//2015
#include<iostream>
#include<algorithm>
#include<functional>
using namespace std;
int main(void){
	int i,ad[4]={0},e=0,f=0,sum=0;
	for(i=0;i<4;i++){
		cin>>ad[i];
	}
	cin>>e;
	cin>>f;
	sort(ad,ad+4,greater<int>());//降順,昇順＝＝sort(ad,ad+4);
	for(i=0;i<3;i++){
		sum+=ad[i];
	}
	if(e<f){
		sum+=f;
	}
	else{
		sum+=e;
	}
	cout<<sum<<endl;
	return 0;
}


Measured memory_bytes: 3076
#include<stdio.h>
int n,m,p,sx[343],sy[343],i,r;
int F()
{
	int a[9][9][9]={0},s[]={1,2},j,k,x,y,z;
	int dx[]={0,1,1,0,-1,1,1,0,-1,-1,-1, 0, 1},
		dy[]={0,0,1,1, 1,0,1,1, 1, 0,-1,-1,-1},
		dz[]={1,0,0,0, 0,1,1,1, 1, 1, 1, 1, 1};
	for(i=0;i<p;++i)
	{
		x=sx[i],y=sy[i];
		//zツ篠イツづ可可按づづ、ツ禿仰づ債楪づ慊つケツづゥ
		for(j=8;j>1&&!a[x][y][j-1];--j);
		z=j;
		a[x][y][z]=s[i&1];
		for(j=0;j<13;++j)
		{
			r=1;
			for(k=1;a[x+k*dx[j]][y+k*dy[j]][z+k*dz[j]]==s[i&1];++k)++r;
			for(k=1;a[x-k*dx[j]][y-k*dy[j]][z-k*dz[j]]==s[i&1];++k)++r;
			if(r>=m)return i+1;
		}
	}
	return 0;
}
int main()
{
	while(scanf("%d%d%d",&n,&m,&p),n)
	{
		for(i=0;i<p;++i)scanf("%d%d",&sx[i],&sy[i]);
		r=F();
		if(!r)puts("Draw");
		else printf("%s %d\n",r%2?"Black":"White",r);
	}
	return 0;
}

Measured memory_bytes: 0
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < n; ++i)
#define rrep(i, st, n) for (int i = st; i < n; ++i)
using pii = pair<int, int>;
#define chmax(a, b) a = max(a, b)
//#define chmin(a, b) a = min(a, b)
#define chmin(a, b, c) a = min(a, b, c)
#define inf (int)(1e9+7)
#define mod (ll)(1e9+7)
#define eb emplace_back

/*
 dp[i番目の店][お釣り] = {500円玉の数、払った金額}
 500円玉の数 -> 大きくしたい
 払った金額 -> 小さくしたい
 そういう比較関数作る
 
 1. i番目の店では買わない
 chmin(dp[i + 1][j], dp[i][j], comp);
 
 2. i番目の店で買う
 
 2-1. 1000円の倍数払って500円もらえる
 i番目の店の商品の金額piを1000で割った余りqi
 1 <= qi <= 500
 1000円の倍数払って500円もらえる
 1001 -> 2000払う
 
 このとき小銭払わなくていいことをいう
 商品の値段250円とする
 小銭120円持ってる
 1120円払う
 1120 - 250 = 870円帰ってくる
 870 = 500 + 250 + 120
 結局払った小銭返ってくる
 
 2-2. 小銭払って500円もらえるか
 pi = 750
 小銭250円いる
 

 
 
 */
bool comp(pii a, pii b) {
    if (a.first != b.first) return a.first > b.first;
    return a.second < b.second;
}
pii dp[107][501 * 101];
//各お店500未満のお釣り
void out(int a, int b) {cout << dp[a][b].first << " " << dp[a][b].second << endl;}
int main() {
    int n;
    while (cin >> n && n) {
        int pi[n]; rep(i, n) cin >> pi[i];
        rep(i, 107) rep(j, 501 * 101) dp[i][j] = {-1, inf}; //-1 for ただ小銭もらうとき
        dp[0][0] = {0, 0};
        rep(i, n) {
            rep(j, 501 * 101) {
                if (dp[i][j].second == inf) continue;
                //not buy
                chmin(dp[i + 1][j], dp[i][j], comp);
                //1000円の倍数払って500円もらえるか
                int qi = pi[i] % 1000;
                int df = dp[i][j].first;
                int ds = dp[i][j].second;
                pii tmp = {df + 1, ds + pi[i]};
                if (1 <= qi && qi <= 500) chmin(dp[i + 1][j + (1000 - 500 - qi)], tmp, comp);
                //小銭使って500円もらえるか
                tmp = {df + 1, ds + pi[i]};
                int need = (pi[i] + 500) % 1000;
                if (need <= j) chmin(dp[i + 1][j - need], tmp, comp);
                //ただ小銭もらう
                tmp = {df, ds + pi[i]};
                chmin(dp[i + 1][j + (1000 - pi[i]%1000) % 1000], tmp, comp);
            }
        }
        pii ans = {0, inf};
        rep(j, 501 * 101) {
            chmin(ans, dp[n][j], comp);
        }
        cout << ans.first << " " << ans.second << endl;
        
    }
}

/*
 corner case
 1
 1000
 */



Measured memory_bytes: 45368
n = int(input())
a = input()

a = a.split()


for i in range(n):
	a[i] = int(a[i])

a	= sorted(a)
a.reverse()

alice = a[0]
bob = 0
for i in range(1, n):
	if i%2 == 0:
		alice = alice + a[i]
	else:
		bob = bob + a[i]
	
print(alice - bob)

Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
typedef unsigned long long int ull;
typedef long long int ll;
typedef long double ld;
#define mod  200003//1000000007
#define pub(a) push_back(a)
#define mp(a,b) make_pair(a,b)

int main(){
   ios_base::sync_with_stdio(false);
   ll n;
   cin>>n;
   ll a[n];
   for(ll &x : a){
      cin>>x;
   }
   ll ans=0;
   for(ll i=0;i<n;i++){
      for(ll j =i+1;j<n;j++){
         ans+=(a[i]*a[j]);
      }
   }
   cout<<ans;
   return 0;
}

Measured memory_bytes: 3612
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using vll = vector<ll> ;
#define all(v) v.begin(),v.end()
 
 
int main(){
  ll N;cin>>N;
  string s = "";
  while(N){
    ll cnt = N%26;
    if(cnt==0)cnt+=26;
    cnt--;
    s += 'a'+cnt;
    N = (N-cnt)/26;
  }
  reverse(all(s));
  cout<<s<<endl;
}

Measured memory_bytes: 3632
#include<bits/stdc++.h>
//using namespace std;
#define rep(i,j,n) for(ll i=(ll)(j);i<(ll)(n);i++)
#define REP(i,j,n) for(ll i=(ll)(j);i<=(ll)(n);i++)
#define per(i,j,n) for(ll i=(ll)(j);(ll)(n)<=i;i--)
#define ll long long
#define ALL(a) (a).begin(),(a).end()
#define disup(A,key) distance(A.begin(),upper_bound(ALL(A),(ll)(key)))
#define dislow(A,key) distance(A.begin(),lower_bound(ALL(A),(ll)(key)))
#define pb push_back
#define mp std::make_pair
#define endl "\n"
using std::cin;
using std::cout;
using std::vector;
using std::string;
using std::upper_bound;
using std::lower_bound;
using vi=vector<ll>;
using vii=vector<vi>;
using pii=std::pair<ll,ll>;
const ll MOD=1e9+7;
//const ll MOD=998244353;
const ll MAX=500000;
const ll INF=(1ll<<62)-1;
template<class T>
class prique :public std::priority_queue<T, std::vector<T>, std::greater<T>> {};
struct Binary_indexed_tree{
    int N;
    vi bit;
    Binary_indexed_tree(int n):N(n){
        bit.resize(N+1,0);
    }
    void add(int x,int a){
        for(x;x<=N;x+=(x&-x)) bit[x]+=a;
    }
    ll sum(int x){
        ll ret=0;
        for(x;x>0;x-=(x&-x)) ret+=bit[x];
        return ret;
    }
};
ll modpow(ll X,ll Y){
    ll sum=X,cnt=1;
    vi A;
    while(cnt<=Y){
        A.pb(sum);
        sum*=sum;
        sum%=MOD;
        cnt*=2;
    }
    int M=A.size();
    ll ret=1;
    REP(i,1,M){
        if(Y>=(1ll<<M-i)){
            Y-=(1ll<<M-i);
            ret*=A[M-i];
            ret%=MOD;
        }
    }
    return ret;
}
ll fac[MAX],finv[MAX],inv[MAX];
void COMinit(){
    fac[0]=fac[1]=finv[1]=finv[0]=inv[0]=inv[1]=1;
    rep(i,2,MAX){
        fac[i]=fac[i-1]*i%MOD;
        inv[i]=modpow(i,MOD-2);
        finv[i]=finv[i-1]*inv[i]%MOD;
    }
}
ll COM(ll n,ll r){
    if(n<r||n<0||r<0) return 0;
    return fac[n]*finv[r]%MOD*finv[n-r]%MOD;
}
int ans[MAX];
void dfs(vi &A,vii &Edge,vector<bool> &F,vi &dp,int X){
    ll P=dislow(dp,A[X]);
    ll memo=dp[P];
    dp[P]=A[X];
    ans[X]=dislow(dp,INF)-1;
    rep(i,0,Edge[X].size()){
        int Y=Edge[X][i];
        if(F[Y]){
            F[Y]=0;
            dfs(A,Edge,F,dp,Y);
        }
    }
    dp[P]=memo;
}
signed main(){
    int N; cin>>N;
    vi A(N);
    rep(i,0,N) cin>>A[i];
    vii Edge(N);
    rep(i,1,N){
        int X,Y; cin>>X>>Y;
        Edge[X-1].pb(Y-1);
        Edge[Y-1].pb(X-1);
    }
    vector<bool> F(N,1);
    F[0]=0;
    vi dp(N+1,INF);
    dp[0]=0;
    dfs(A,Edge,F,dp,0);
    cout<<1<<endl;
    rep(i,1,N) cout<<ans[i]<<endl;
}


Measured memory_bytes: 35432
import java.util.Scanner;




public class Main {

    public static void main(String[] args) {

    	Main main=new Main();

    	main.run();

    }

    void run() {
    	Scanner sc=new Scanner(System.in);

    	int N=sc.nextInt();
    	int K=sc.nextInt();

    	int result=1;

    	for(int i=0;i<N;i++) {

    		if(result<=K) {
    			result+=result;
    		}else {
    			result+=K;
    		}

    	}

    	System.out.println(result);
    }







}



Measured memory_bytes: 21844
#include <iostream>
#include <fstream>
#include <string>
#include <cmath>
#include <cstdio>
#include <algorithm>
#include <iomanip>
#include <vector>
#include <utility>
#include <numeric>
#include <stack>
#include <queue>
#define MOD 1000000007
#define int long long
using namespace std;
using P = pair<int, int>;
using ll = long long;

signed main(){
    int k,x;
    cin>>k>>x;
    int mi=max(x-k+1,(int)-1000000);
    int ma=min(x+k-1,(int)1000000);
    for(int i=mi;i<=ma;i++)cout<<i<<" ";
    cout<<endl;
    return 0;
}



Measured memory_bytes: 256
#include <cmath>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
int main() {
	int N;
	while (cin >> N, N) {
		vector<double> X(N), R(N);
		for (int i = 0; i < N; ++i) {
			cin >> X[i] >> R[i];
		}
		double l = 0.0, r = 2.0e+5;
		for (int rep = 0; rep < 40; ++rep) {
			double m = (l + r) / 2;
			vector<double> sl, sr, plist;
			for (int i = 0; i < N; ++i) {
				if (R[i] >= m / 2) {
					double delta = sqrt(double(R[i]) * R[i] - m * m / 4);
					sl.push_back(X[i] - delta);
					sr.push_back(X[i] + delta);
				}
			}
			plist.insert(plist.end(), sl.begin(), sl.end());
			plist.insert(plist.end(), sr.begin(), sr.end());
			sort(plist.begin(), plist.end());
			int SN = sl.size();
			vector<int> imos(2 * SN);
			for (int i = 0; i < SN; ++i) {
				int idl = lower_bound(plist.begin(), plist.end(), sl[i]) - plist.begin();
				int idr = lower_bound(plist.begin(), plist.end(), sr[i]) - plist.begin();
				++imos[idl];
				--imos[idr];
			}
			int pre = 0, sum = 0;
			bool ok = false;
			for (int i = 0; i < 2 * SN; ++i) {
				sum += imos[i];
				if (sum == 0) {
					double len = plist[i] - plist[pre];
					if (len >= m) ok = true;
					pre = i + 1;
				}
			}
			if (ok) l = m;
			else r = m;
		}
		cout.precision(15);
		cout << r << '\n';
	}
	return 0;
}


Measured memory_bytes: 6156
#include <cstdio>
#include <iostream>
#include <string>
#include <algorithm>

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

using namespace std;

//algorithm
//string
class BigInteger{
private:
public:
	string number;
	
	BigInteger(string number):number(number){}
	
	BigInteger operator+(BigInteger integer){
		reverse(number.begin(), number.end());
		reverse(integer.number.begin(), integer.number.end());
		
		int length = max(	integer.number.length(),
							number.length());
	
		int up=0;
	
		string sum="";
	
		for(int i=0;i<length;i++){
			int num1 = 0;
			if(i<integer.number.length()){
				num1 = integer.number[i]-'0';
			}
			int num2 = 0;
			if(i<number.length()){
				num2 = number[i]-'0';
			}
			int n = num1+num2+up;
			if(n<10){
				up=0;
			}else{
				up=1;
				n-=10;
			}
			sum += (char)('0'+n);
		}
		if(up){
			sum += '1';
		}
		reverse(sum.begin(), sum.end());
		return sum;
	}
};

int main(){
	int N;
	cin >> N;
	while(N--){
		string num1,num2;
		cin >> num1 >> num2;
		BigInteger integer = BigInteger(num1) + BigInteger(num2);
		if(integer.number.length()>80){
			puts("overflow");
		}else{
			cout << integer.number << endl;
		}
	}
}

Measured memory_bytes: 1220
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii =  pair<int, int>;
using pll =  pair<long long, long long>;
constexpr char ln =  '\n';
constexpr long long MOD = 1000000007LL;
#define all(x) (x).begin(),(x).end()

//Nは桁数が大きい場合があるので文字列として受け取る
string N;
vector<int> n;  //Nの各桁の数字を格納するベクター
int dp[120][2][5];

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

  //ベクターnを構成
  for(auto a : N){
    n.push_back(a-'0');
  }
  int l = N.size();  //nの長さ

  dp[0][0][0] = 1;  //初期条件。他は0で初期化されている
  for(int i = 0; i < l; i++){
    for(int smaller = 0; smaller < 2; smaller++){
      for(int j = 0; j < 4; j++){
            for(int x = 0; x <= (smaller ? 9 : n[i]); x++){

              dp[i + 1][smaller || x < n[i]][x > 0 ? j + 1 : j] += dp[i][smaller][j];          
        }
      }
    }
  }

  cout << dp[l][0][k] + dp[l][1][k] << endl;

  return 0;
}

Measured memory_bytes: 256
/*
 * 17-07-01_ARC077_C.cpp
 *
 *  Created on: 2017/07/01
 *      Author: ryoma
 */

#include<iostream>
#include<algorithm>
#include<vector>

using namespace std;

int n;
int a[2*100000+10];
vector<int> b;
int main(){
	cin >> n;
	for(int i=0;i<n;i++){
		cin >> a[i];
	}
	int i;
	for(i=n-1;i>=0;i-=2){
		b.push_back(a[i]);
	}
	i+=2;
	i=!i;
	for(;i<n;i+=2){
		b.push_back(a[i]);
	}
	for(int i=0;i<n;i++){
		cout << b[i];
		if(i+1<n){
			cout << " ";
		}
	}
	cout << endl;
	return 0;
}





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

int main() {
    int n, m;
    cin >> n >> m;
    vector<int> L(m);
    vector<int> R(m);
    for(int i=0; i<m; i++){
        cin >> L[i];
        cin >> R[i];
    }
    int max_l = *max_element(L.begin(), L.end());
    int min_r = *min_element(R.begin(), R.end());

    int difference = min_r - max_l + 1;
    if(difference <= 0){
        cout << 0 << endl;
    }else{
        cout << difference << endl;
    }
    return 0;
}

Measured memory_bytes: 1024
A = input()
B = input()
max_len = max(len(A), len(B))
A = A.zfill(max_len)
B = B.zfill(max_len)

for a, b in zip(A, B):
  if int(a) > int(b):
    print("GREATER")
    exit()
  elif int(a) < int(b):
    print("LESS")
    exit()
  else:
    pass

print("EQUAL")

Measured memory_bytes: 3188
#include <iostream>
#include <string>
#include <sstream>
#include <cmath>
#include <vector>
#include <map>
#include <set>
#include <algorithm>
#include <numeric>
using namespace std;
typedef long long LL;
LL i,j,k,n,m;
LL mod=1000000007;
string s;

int main() {
  int c11,c12,c13,c21,c22,c23,c31,c32,c33;
  cin >>c11>>c12>>c13;
  cin >>c21>>c22>>c23;
  cin >>c31>>c32>>c33;
  int d1,e1,d2,e2,d3,e3;
  d1 = c12 + c21; e1= c11+c22;
  d2 = c23 + c32; e2= c22+c33;
  d3 = c31 + c13; e3= c11+c33;
  if(d1==e1 &&d2==e2 &&d3==e3) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}

Measured memory_bytes: 256
// inputに入力データ全体が入る
function Main(input) {
  // 1行目がinput[0], 2行目がinput[1], …に入る
  input = input.split(" ");
  var N = Number(input[0]);
  var R = Number(input[1]);

  var answer = N >= 10 ? R : R + (100 * (10 - N));

  console.log(answer);
}
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));


Measured memory_bytes: 21956
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define rep(i,a,b) for(ll i=a;i<b;i++)
#define rrep(i,a,b) for(ll i=a;i>=b;i--)
#define fore(i,a) for(auto &i:a)
#define all(x) (x).begin(),(x).end()

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

    pair<ll, ll> x[n];
    rep(i, 0, n){
        cin >> x[i].first >> x[i].second;
    }

    sort(x, x + n);

    ll num = 0;
    rep(i, 0, n - 1){
        pair<ll, ll> dif;
        dif.first = x[i+1].first - x[i].first;
        dif.second = x[i+1].second - x[i].second;
        ll count = 0;
        rep(j, 0, n - 1){
            if(x[j+1].first - x[j].first == dif.first && x[j+1].second - x[j].second == dif.second){
                count++;
            }
        }
        num = max(num, count);
    }

    ll ma = 0;
    rep(i, 0, n){
        rep(j, 0, n){
            if(x[i].first - x[j].first == 0 && x[i].second - x[j].second == 0) continue;
            pair<ll, ll> dif;
            dif.first = x[i].first - x[j].first;
            dif.second = x[i].second - x[j].second;

            ll count = 0;
            rep(k, 0, n){
                rep(l, 0, n){
                    if(x[k].first - x[l].first == dif.first && x[k].second - x[l].second == dif.second) count++;
                }
            }
            ma = max(ma, count);
        }
    }


    cout << n - ma << endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define MOD 1000000007LL
using namespace std;
typedef long long ll;
typedef pair<int,int> P;

ll a;
string b;

int main(void){
	cin >> a >> b;
	ll bb=0;
	bb=(b[0]-'0')*100+(b[2]-'0')*10+(b[3]-'0');
	ll c=a*bb;
	printf("%lld\n",c/100LL);
	return 0;
}


Measured memory_bytes: 3564
#include <algorithm>
#include <bitset>
#include <cmath>
#include <complex>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <regex>
#include <set>
#include <stack>
#include <string>
#include <vector>

const int MOD = 1e9 + 7;
const int iINF = 2147483647 / 2;
const long long int llINF = 9223372036854775807 / 2;

using namespace std;
using ll = long long int;
using vl = vector<ll>;
using vvl = vector<vector<ll>>;
using vvvl = vector<vector<vector<ll>>>;

typedef pair<ll, ll> pll;
bool paircomp(const pll &a, const pll &b) {
  if (a.first == b.first)
    return a.second < b.second;
  return a.first < b.first;
}

#define REP(i, n) for (ll i = 0; i < (n); i++)
#define RREP(i, n) for (ll i = (n)-1; i >= 0; i--)
#define FOR(i, a, b) for (ll i = (a); i < (b); i++)
#define AUTO(i, m) for (auto &i : m)
#define ALL(a) (a).begin(), (a).end()
#define MAX(vec) *std::max_element(vec.begin(), vec.end())
#define MIN(vec) *std::min_element(vec.begin(), vec.end())
#define ARGMAX(vec)                                                            \
  std::distance(vec.begin(), std::max_element(vec.begin(), vec.end()))
#define ARGMIN(vec)                                                            \
  std::distance(vec.begin(), std::min_element(vec.begin(), vec.end()))
#define REV(T) greater<T>()
#define PQ(T) priority_queue<T, vector<T>, greater<T>>
#define VVL(a, b, c) vector<vector<ll>>(a, vector<ll>(b, c))
#define VV(T, a, b, c) vector<vector<T>>(a, vector<T>(b, c))
#define VVVL(a, b, c, d)                                                       \
  vector<vector<vector<ll>>>(a, vector<vector<ll>>(b, vector<ll>(c, d)))
#define VVV(T, a, b, c, d)                                                     \
  vector<vector<vector<T>>>(a, vector<vector<T>>(b, vector<T>(c, d)))
#define SP(a) setprecision(a)
#define SQRT(a) sqrt((long double)(a))
#define DPOW(a, b) pow((long double)(a), (long double)(b))
#define UNIQUE(vec)                                                            \
  do {                                                                         \
    sort(ALL((vec)));                                                          \
    (vec).erase(std::unique(ALL((vec))), (vec).end());                         \
  } while (0)

ll POW(ll n, ll m) {
  if (m == 0) {
    return 1;
  } else if (m % 2 == 0) {
    ll tmp = POW(n, m / 2);
    return (tmp * tmp);
  } else {
    return (n * POW(n, m - 1));
  }
}

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

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ll N;
  cin >> N;
  cout << ((N + 1) / 2) << endl;
  vl A;
  return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<cstring>
#include <cstdlib>  
#include <cmath>   
#include<cctype>
#include<string>
#include<set>
#include <map>
#include<algorithm>
#include <functional>
#include<vector>
#include<climits>
#include<stack>
#include<queue>
#include <deque>
#include <climits>
#include <typeinfo>
#include <utility>
using namespace std;

int main() {
	int x;
	cin >> x;
	cout << x*x*x << endl;
	return 0;
}


Measured memory_bytes: 3088
ref = [6, 36, 216, 1296, 7776, 46656, 9, 81, 729, 6561, 59049]
N = int(input())
dp = list(range(N+1))
for x in ref:
	for i in range(x, N+1):
		y = dp[i-x] + 1
		if y < dp[i]:
			dp[i] = y
print(dp[N])

Measured memory_bytes: 6900
#include<bits/stdc++.h>
using namespace std;
#define N (int)(1e5+7)
#define inf (int)(1e9+7)
#define INF (long long) (1e18+7)
#define fastio ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
const int M = (int)(2e6 + 239);


void solve(){
    string s;
    cin>>s;
    int n=(int)s.size();
    for(int i=0;i<n-1;i++){
        if(s[i] == s[i+1]){
            cout<<i+1<<" "<<i+2<<'\n';
            return;
        }
    }
    for(int i=0;i<n-2;i++){
        if(s[i] == s[i+2]){
            cout<<i+1<<' '<<i+3<<'\n';
            return;
        }
    }
    cout<<"-1 -1\n";
    return;
}
int main(){
    fastio;
    solve();
    return 0;
}

Measured memory_bytes: 3752
#include <bits/stdc++.h>
#define ll long long

using namespace std;

int main() {
  ll n, a, x[50], dp[51][51][2501] = {};
  scanf("%lld %lld", &n, &a);
  for(int i = 0; i < n; i++) {
    scanf("%lld", &x[i]);
    dp[i + 1][1][x[i]] = 1;
  }
  for(int i = 0; i < n; i++) {
    for(int j = 0; j < n; j++) {
      for(int k = 0; k < 2501 - x[i]; k++) {
        dp[i + 1][j][k] += dp[i][j][k];
        dp[i + 1][j + 1][k + x[i]] += dp[i][j][k];
      }
    }
  }
  ll o = 0;
  for(int i = 0; i <= n; i++) o += dp[n][i][a * i];
  printf("%lld\n", o);
}

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

int main() {
  vector<int> n(3);
  for(int i=0;i<3;i++){
    cin >> n.at(i);
  }
  sort(n.begin(),n.end());
  reverse(n.begin(),n.end());
  cout << 10*n.at(0) + n.at(1) + n.at(2) << endl;
  
  
  return 0;
}

Measured memory_bytes: 256
#include <time.h>

#include <stdlib.h>
#include <cstdint>
#include <cassert>
#include <algorithm>
#include <functional>
#include <iostream>
#include <limits>
#include <cstdint>
#include <cassert>
#include <algorithm>
#include <functional>
#include <iostream>
#include <limits>
#include <vector>
#include <map>
#include <set>
#include <iomanip>
#include <numeric>
#include <cmath>
#include <bitset>
#include <iterator>
#include <deque>
#include <string>
#include <queue>
#include <omp.h>
#include <fstream>   // ifstream, ofstream
typedef int64_t ll;
using namespace std;
const ll INF=1e10;
const double EPS=1e-8;

int main(){
	ll n,d;
	cin>>n>>d;
	vector<vector<ll> > points;
	for(ll i1=0;i1<n;i1++){
		points.push_back(vector<ll>());
		for(ll i2=0;i2<d;i2++){
			ll temp;
			cin>>temp;
			points[i1].push_back(temp);
		}
	}
	ll ans=0;
	for(ll i1=0;i1<n-1;i1++){
		for(ll i2=i1+1;i2<n;i2++){
			ll d2 =0;
			for(ll i3=0;i3<d;i3++){
				d2+=(points[i1][i3]-points[i2][i3])*(points[i1][i3]-points[i2][i3]);
			}
			ll candidate = round(sqrt((double) d2));
			if(candidate*candidate == d2){
				ans++;
			}
		}
	}
	cout<<ans<<endl;
}


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

const int INF = 0x3f3f3f3f;
const double pi = acos(-1.0);

LL up[100123]{1}, a[100123], b[100123];

int main()
{
    Rep(i, 59) up[i] = up[i-1] * 2;
    int n;
    cin >> n;
    rep(i, n+1) scanf("%lld", a+i);
    b[n] = a[n];
    for(int i = n; i > 60; --i) b[i-1] = a[i-1] + (b[i] + 1 >> 1);
    for(int i = 59; i >= 0; --i) {
        b[i] = a[i] + (b[i+1] + 1 >> 1);
        if(b[i] > up[i]) {
            puts("-1");
            return 0;
        }
    }
    int p = n;
    LL cur = 1 - a[0];
    Rep(i, n) {
        up[i] = cur * 2;
        cur = up[i] - a[i];
        if(up[i] > 1e18) {
            p = i;
            break;
        }
    }
    for(int i = n; i > p; --i) b[i-1] = a[i-1] + b[i];
    for(int i = p-1; i >= 0; --i) {
        b[i] = min(a[i] + b[i+1], up[i]);
    }
    cout << accumulate(b, b+n+1, 0ll) << endl;
    return 0;
}



Measured memory_bytes: 5960
H, W = map(int,input().split())
s = []*H
flag = 0
tmp = 0
for i in range(H):
    s.append(input())

for i in range(H):
    for j in range(W):
        tmp = 0
        if s[i][j] == '#':
            try:
                if s[i-1][j] == '#':
                    tmp += 1
            except IndexError:
                pass
            try:
                if s[i+1][j] == '#':
                    tmp += 1
            except IndexError:
                pass
            try:
                if s[i][j-1] == '#':
                    tmp += 1
            except IndexError:
                pass
            try:
                if s[i][j+1] == '#':
                    tmp += 1
            except IndexError:
                pass
            if tmp == 0:
                flag = 1

if flag == 0:
    print('Yes')
else:
    print('No')


Measured memory_bytes: 3064
N = int(input())
S = input()

c,L,R = 0,0,0
for i in range(N):
    if S[i] == "(":
        c += 1
    else:
        c -= 1
    if c < 0:
        L += 1
        c = 0

c = 0
for i in range(N-1,-1,-1):
    if S[i] == ")":
        c += 1
    else:
        c -= 1
    if c < 0:
        R += 1
        c = 0

print(L*"(" + S + R*")")


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

template<typename T> void chmin(T &a, T b) { if (a > b) a = b; }
template<typename T> void chmax(T &a, T b) { if (a < b) a = b; }

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

int main() {
    int a, b;
    cin >> a >> b;
    cout << max(0, a - 2 * b) << endl;
    return 0;
}


Measured memory_bytes: 256
//38
#include<iostream>
#include<algorithm>

using namespace std;

int main(){
  for(int n;cin>>n;){
    int t[100];
    for(int i=0;i<n;i++){
      cin>>t[i];
    }
    sort(t,t+n);
    int sum=0;
    for(int i=0;i<n;i++){
      sum+=t[i]*(n-i);
    }
    cout<<sum<<endl;
  }
  return 0;
}

Measured memory_bytes: 1176
unittest
{
	assert( [ "4 1", "5 4 2 1" ].parse.expand.solve == "Yes" );
	assert( [ "3 2", "380 19 1" ].parse.expand.solve == "No" );
	assert( [ "12 3", "4 56 78 901 2 345 67 890 123 45 6 789" ].parse.expand.solve == "Yes" );
}



import std.algorithm;
import std.conv;
import std.range;
import std.stdio;
import std.typecons;

void main()
{
	stdin.byLineCopy.parse.expand.solve.writeln;
}

auto parse( Range )( Range input )
if( isInputRange!Range && is( ElementType!Range == string ) )
{
	auto nm = input.front.split.to!( long[] );
	input.popFront;
	auto as = input.front.split.to!( long[] );
	return tuple( nm[ 1 ], as );
}

auto solve( long m, long[] as )
{
	auto as_s = as.sort();
	auto t = as.sum;
	auto d = t / ( 4 * m ) + ( 0 < t % ( 4 * m ) );
	auto ans = m <= ( as.length.signed - as_s.lowerBound( d ).length.signed );
	return ans ? "Yes" : "No";
}


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

using namespace std;

template <typename T> T gcd(T x, T y) {
  if (y == 0)
    return x;
  return gcd(y, x % y);
}

template <typename T> T lcm(T x, T y) {
  if (x == 0 || y == 0)
    return 0;
  return x / gcd(x, y) * y;
}

int main() {
  int N;
  cin >> N;
  const int m = 100001;
  vector<int> v(m + 1, 0);
  long ans = 0;
  for (int i = 0; i < N; i++) {
    int a;
    cin >> a;
    if (a > m - 1)
      ans++;
    else
      v[a]++;
  }
  for (int i = 0; i < m; i++) {
    if (v[i] == 0)
      continue;
    if (i > v[i])
      ans += v[i];
    else
      ans += abs(i - v[i]);
  }
  cout << ans << endl;
}

Measured memory_bytes: 640
#include<iostream>
#include<cstdio>
#include<string>
#include<map>
#include<algorithm>
#include<queue>
#include <functional>
#define MAX_V 1001
#define INF 100000
using namespace std;

int cost[MAX_V][MAX_V];
int mincost[MAX_V];
bool used[MAX_V];
int n,m;

int prim(){
  for(int i=0;i<n;i++){
    mincost[i]=INF;
    used[i]=false;
  }
  mincost[0]=0;
  int res=0;
  while(true){
    int v=-1;
    for(int u=0;u<n;u++){
      if(!used[u] && (v==-1 || mincost[u]<mincost[v]))v=u;
    }
    if(v==-1)break;
    used[v]=true;
    res+=mincost[v];
    for(int u=0;u<n;u++){
      mincost[u]=min(mincost[u],cost[v][u]);
    }
  }
  return res;
}

int main(){
  int a,b,c,ans;
  while(1){
    cin >> n;
    if(n == 0)break;
    cin >> m;
    for(int i=0;i<n;i++){
      for(int j=0;j<n;j++){
	cost[i][j]=INF;
      }
    }
    for(int i=0;i<m;i++){
      scanf("%d,%d,%d",&a,&b,&c);
      cost[a][b]=c/100-1;
      cost[b][a]=c/100-1;
    }
    ans = prim();
    cout << ans << endl;
  }
}

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

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
	int n;
	int x;
	cin>>x>>n;
	map<int,int> m;
	int i;
	for(i=0;i<n;i++)
	{
		int p;
		cin>>p;
		m[p]=1;
	}
	if(m[x]==0)
	{
		cout<<x<<endl;
		return 0;
	}
	int a=x-1;
	int b=x+1;
	while(1)
	{
		if(m[a]==0)
		{
			cout<<a<<endl;
			break;
		}
		if(m[b]==0)
		{
			cout<<b<<endl;
			break;
		}
		b++;
		a--;
	}
	return 0;
}



Measured memory_bytes: 3652
function Main(input) {
    var result;
    const X = parseInt(input[0])
    const A = parseInt(input[1])
    
    result = X < A ? 0 : 10;
    console.log(result);
}

// 1行入力の場合
// Main(require("fs").readFileSync("/dev/stdin", "utf8").trim());

// 改行で分割
// Main(require("fs").readFileSync("/dev/stdin", "utf8").trim().split(/\n/));

// 改行・空白で分割
Main(require("fs").readFileSync("/dev/stdin", "utf8").trim().split(/\n|\s/));

Measured memory_bytes: 9420
#include <stdio.h>

int main(void){
  int a[3];
  int temp;
  for(int i = 0; i < 3; i++) scanf("%d", &a[i]);
  for(int i = 0; i < 3; i++){
    for(int j = i + 1; j < 3; j++){
      if(a[i] < a[j]){
	temp = a[i];
	a[i] = a[j];
	a[j] = temp;
      }
    }
  }
  int s = a[1] * a[2] / 2;
  printf("%d\n", s);
  return 0;
}

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

namespace ABC115A
{
    class Program
    {
        static void Main(string[] args)
        {
            int D,E;
            D = int.Parse(Console.ReadLine());
            if (D == 25)
                Console.WriteLine("Christmas");
            else if (D == 24)
                Console.WriteLine("Christmas Eve");
            else if (D == 23)
                Console.WriteLine("Christmas Eve Eve");
            else if (D == 22)
                Console.WriteLine("Christmas Eve Eve Eve");
            Console.ReadKey();



        }
    }
}

Measured memory_bytes: 11092
a,b,k=map(int,input().split())

for i in range(k):
    if i%2==0:
        if a%2==1:
            a=max(a-1,0)
        b+=(a//2)
        a//=2
    else:
        if b%2==1:
            b=max(b-1,0)
        a+=(b//2)
        b//=2
print(a,b)

Measured memory_bytes: 3060
#include <iostream>
#include<string>
using namespace std;
int main(){
	int l=700;
	string S;
	char D='o';
	cin>>S;
	if(S[0]==D){
		l=l+100;
	}
	if(S[1]==D){
		l=l+100;
	}
	if(S[2]==D){
		l=l+100;
	}
	cout<<l<<endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>//sort,reverse
using namespace std;
typedef long long LL;

int main()
{ 
    string s;
    cin>>s;
    if(s[2]==s[3]&&s[4]==s[5]){cout<<"Yes";}
    else{cout<<"No";}
    cout<<endl;
    return 0;
}

Measured memory_bytes: 256
#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <cinttypes>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iostream>
#include <limits>
#include <list>
#include <map>
#include <memory>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <vector>
using namespace std;

using ll = long long;

ll FirstPositive(vector<ll> A) {
  ll result = 0;
  
  if (A[0] <= 0) {
    result = -A[0] + 1;
    A[0] = 1;
  }
  
  ll sum = A[0];
  for (int i = 1; i < A.size(); ++i) {
    ll next_sum = sum + A[i];
    
    if (i % 2 != 0) {
      if (next_sum >= 0) {
        result += (next_sum + 1);
        A[i] -= (next_sum + 1);
      }
    } else {
      if (next_sum <= 0) {
        result += (-next_sum + 1);
        A[i] += (-next_sum + 1);
      }
    }
    
    sum += A[i];
  }
  
  return result;
}

ll FirstNegative(vector<ll> A) {
  ll result = 0;
  
  if (A[0] >= 0) {
    result = A[0] + 1;
    A[0] = -1;
  }
  
  ll sum = A[0];
  for (int i = 1; i < A.size(); ++i) {
    ll next_sum = sum + A[i];
    
    if (i % 2 == 0) {
      if (next_sum >= 0) {
        result += (next_sum + 1);
        A[i] -= (next_sum + 1);
      }
    } else {
      if (next_sum <= 0) {
        result += (-next_sum + 1);
        A[i] += (-next_sum + 1);
      }
    }
    
    sum += A[i];
  }
  
  return result;
}

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  
  int N;
  cin >> N;
  
  vector<ll> A(N);
  for (ll& a : A) {
    cin >> a;
  }
  
  cout << min(FirstPositive(A), FirstNegative(A)) << '\n';
  
  return 0;
}



Measured memory_bytes: 2560
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
#define REP(i,n) for (ll i = 0; i < (n); ++i)
#define RREP(i, n) for (ll i = (n) - 1; i >= 0; --i)
#define ALL(v) (v).begin(), (v).end()

ll num_same_pairs(vector<ll>& x){
    sort(ALL(x));
    ll ret = 0;
    for(ll i = 0; i + 1 < x.size();){
        if(x.at(i) == x.at(i + 1)){
            ret++;
            i += 2;
        }else{
            i++;
        }
    }
    return ret;
}

int main(){
    ll n, m;
    cin >> n >> m;

    vector<vector<ll>> modm(m);
    REP(i, n){
        ll xi;
        cin >> xi;
        const ll mx = xi % m;
        modm.at(mx).push_back(xi);
    }

    ll ans = 0;
    for(ll mx = 0; mx <= m / 2; ++mx){
        const ll my = (m - mx) % m;
        if(mx == my){
            ans += modm.at(mx).size() / 2;
        }else{
            ll xi = mx, yi = my;
            if(modm.at(mx).size() > modm.at(my).size()){
                swap(xi, yi);
            }

            const ll ns = num_same_pairs(modm.at(yi));
            const ll sx = modm.at(xi).size();
            ans += sx + min(((ll)modm.at(yi).size() - sx) / 2, ns);
        }
    }
    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 5760
#include <stdio.h>
#include <algorithm>
#include <iostream>
#include <string>
#include <vector>
#include <functional>
#include <map>
#include <iomanip>

using namespace std;

int main() {
	string N;

	cin >> N;

	if (N[0] == '9' || N[1] == '9') {
		cout << "Yes" << endl;
	}
	else {
		cout << "No" << endl;
	}




	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,a,b) for(ll i=ll(a);i<ll(b);i++)
#define irep(i,a,b) for(ll i=ll(a);i>=ll(b);i--)
#define pb push_back
#define mp make_pair
#define pll pair<ll,ll>
#define endl "\n"
using ll=long long;
using ld=long double;
using namespace std;
const ll mod= 1e9+7;
const ll INF = 1LL<<40;
ll GCD(ll a, ll b) { return b ? GCD(b, a%b) : a; }

int main(){
  ll n,a,b,ans=0;
  cin>>n>>a>>b;
  cout<<a*(n/(a+b))+min(a,n%(a+b));
}

Measured memory_bytes: 256
double x,r,z,s,u;n,m,v;f(t){for(x=0;t--;x<s/u?x=s/u:x)for(u=s=!scanf("%d%d",&n,&m);m--;s+=v*r)scanf("%d%lf",&v,&r),u+=r;}main(t){scanf("%d",&t);f(t);z=x;f(1);m=!puts(z>x+1e-7?"YES":"NO");}

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

int main() {
  int n; cin >> n;
  while (n > 0) {
    if (n % 10 == 7) {
      cout << "Yes";
      return 0;
    }
    else n /= 10;
  }
  cout << "No";
}

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

static class Extensions
{
    public static int ToInt(this string s) => int.Parse(s);
    public static long ToLong(this string s) => long.Parse(s);
    public static char ToChar(this string s) => char.Parse(s);
    public static double ToDouble(this string s) => double.Parse(s);
    public static int[] ToIntArray(this string s) => s.Replace(',', ' ').Split(' ').Select(x => x.ToInt()).ToArray();
    public static long[] ToLongArray(this string s) => s.Replace(',', ' ').Split(' ').Select(x => x.ToLong()).ToArray();
    public static double[] ToDoubleArray(this string s) => s.Replace(',', ' ').Split(' ').Select(x => x.ToDouble()).ToArray();
    public static Queue<T> ToQueue<T>(this IEnumerable<T> seq) => new Queue<T>(seq);
    public static Stack<T> ToStack<T>(this IEnumerable<T> seq) => new Stack<T>(seq);
    public static HashSet<T> ToHashSet<T>(this IEnumerable<T> seq) => new HashSet<T>(seq);
}
static class MyMath
{
    static public long GCD(long a, long b) => (a < b) ? GCD(b, a) : ((b == 0) ? a : GCD(b, a % b));
    static public long LCM(long a, long b) => (a > b) ? (a / GCD(a, b) * b) : (b / GCD(a, b) * a);
    static private readonly long _m = 1000000000 + 7;
    static public long Mod(long val) => (val % _m + _m) % _m;
    static private long ExtGCD(long a, long b, ref long x, ref long y) => (b == 0) ? (a + (x = 1) * 0 + (y = 0) * 0) : (ExtGCD(b, a % b, ref y, ref x) + (y -= a / b * x) * 0);
    static private long ModInverseInner(long a, long dummy1 = 0, long dummy2 = 0) => ExtGCD(a, _m, ref dummy1, ref dummy2) * 0 + Mod(dummy1);
    static public long ModInverse(long a) => ModInverseInner(a, 0, 0);
}

class Program
{
    static string[] ReadLines(int n) => Enumerable.Range(0, n).Select(s => Console.ReadLine()).ToArray();

    static void Main()
    {
        var nab = Console.ReadLine().ToIntArray();
        
        int N = nab[0];
        int A = nab[1];
        int B = nab[2];

        Console.WriteLine(Math.Min(A * N, B));
    }
    
}

Measured memory_bytes: 13268
#include <bits/stdc++.h>
using namespace std;
int main(){
  int a,b,c,d;
  string ans;
  cin >> a >> b >> c >> d;
  if(abs(c-a) <= d){
    ans = "Yes";
  }
  else if (abs(b-a)<=d && abs(c-b)<=d){
    ans ="Yes";
  }
  else{
    ans = "No";
  }
  cout << ans << endl;
}
  

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <iostream>
#include <map>
#include <vector>
#include <cmath>
#include <ios>
#include <iomanip>
#include <algorithm>
#define REP(i, n) for (int i = 0; i < (int)(n); ++i)
#define REP2(i, m, n) for (int i = (m); i < (int)(n); ++i)
#define REPR(i, n) for (int i = (n)-1; i >= 0; --i)
#define REPR2(i, m, n) for (int i = (n)-1; i >= (m); --i)
#define REPx(x, a) for(auto x : a)
#define ALL(a) a.begin(), a.end()
#define SORT(a) sort(ALL(a))
#define SORTR(a) sort(ALL(a), greater<int>())
#define REVERSE(a) reverse(ALL(a))
#define bit_search(bit, n) REP(bit, 1<<(n))
#define bit_check(bit, i) ((bit>>(i)) & 1)
#define setpre(n) fixed << setprecision((n))
#define UNIQUE(a) do {SORT(a); (a).erase(unique(ALL(a)), (a).end());} while(0)
#define MAX(a) *max_element(ALL(a))
#define MIN(a) *min_element(ALL(a))
#define bisect_left(a, x) lower_bound(ALL(a), (x)) - a.begin()
#define bisect_right(a, x) upper_bound(ALL(a), (x)) - a.begin()
#define INPUT(a) REP(i, a.size()) cin >> a[i];
#define INPUTP(a) REP(i, a.size()) cin >> a[i].first >> a[i].second;
#define OUTPUT_PERMUTATION(n) do{VI v(n); iota(ALL(v), 1); do{REPx(x, v) cout << x << " "; ENDL} while(next_permutation(ALL(v)));} while(0);
#define MAKE_PERMUTATION(n) do{VVI a(fact(n), VI(n)); int idx = 0; VI v(n); iota(ALL(v), 1); do{REP(i, n) a[idx][i] = v[i]; idx++; PER = a;} while(next_permutation(ALL(v)));} while(0); // int fact(), VVI PERを宣言しておく
#define ENDL cout << endl;
using namespace std;
using LL = long long;
using LD = long double;
using PII = pair<int, int>;
using VPII = vector<PII>;
using PLL = pair<LL, LL>;
using VPLL = vector<PLL>;
using VI = vector<int>;
using VVI = vector<VI>;
using VLL = vector<LL>;
using VVLL = vector<VLL>;
using VC = vector<char>;
using VS = vector<string>;
using VB = vector<bool>;
using VD = vector<double>;
const int INF = 1e9;
const LL MOD = 1e9 + 7;

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

void END(){cout << 1 << endl; exit(0);}

int h, w, sy, sx, gy, gx;
VI px = {0, 0, 1, -1}, py = {1, -1, 0, 0};

int bfs(vector<VC>& M)
{
  VVI dis(h, VI(w, -1));
  queue<PII> q;
  q.push({sx, sy});
  dis[sy][sx] = 0;
  while(q.size())
  {
    int y = q.front().second, x = q.front().first;
    q.pop();
    REP(i, 4)
    {
      int yy = y + py[i], xx = x + px[i];
      if (0 <= xx && xx < w && 0 <= yy && yy < h && M[yy][xx] != '#' && dis[yy][xx] == -1)
      {
        if (yy == gy && xx == gx) return dis[y][x] + 1;
        dis[yy][xx] = dis[y][x] + 1;
        q.push({xx, yy});
      }
    }
  }
  return -1;
}

int main()
{
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin >> h >> w;
  vector<VC> M(h, VC(w));
  int black = 0;
  REP(y, h) REP(x, w)
  {
    cin >> M[y][x];
    if (M[y][x] == '#') black++;
  }
  sy = 0, sx = 0, gy = h-1, gx = w-1;
  int ans = bfs(M);
  if (ans != -1) ans = h*w-black-ans-1;
  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
#define N 100000
#define M 50000
int binarySearch(int,int[],int);
int main(){
  int a[N],b[M];
  int x,y,i,j,s=0;
  scanf("%d",&x);
  for(i=0;i<x;i++){
    scanf("%d",&a[i]);
  }
  scanf("%d",&y);
  for(i=0;i<y;i++){
    scanf("%d",&b[i]);
  }
  for(i=0;i<y;i++){
    if(binarySearch(b[i],a,x)==1){
      s++;
    }
  }
  printf("%d\n",s);
  return 0;
}

int binarySearch(int d,int a[],int x){
  int left = 0;
  int right,mid;
  right = x;
  while(left < right){
    mid = (left + right)/2;
    if(a[mid]==d){
      return 1;
    }else if(d<a[mid]){
      right=mid;
    }else{
      left = mid +1;
    }
  }
  return 0;
}


Measured memory_bytes: 2324
#![allow(unused_imports, unused_macros, dead_code)]

macro_rules! min {
    (.. $x:expr) => {{
        let mut it = $x.iter();
        it.next().map(|z| it.fold(z, |x, y| min!(x, y)))
    }};
    ($x:expr) => ($x);
    ($x:expr, $($ys:expr),*) => {{
        let t = min!($($ys),*);
        if $x < t { $x } else { t }
    }}
}
macro_rules! max {
    (.. $x:expr) => {{
        let mut it = $x.iter();
        it.next().map(|z| it.fold(z, |x, y| max!(x, y)))
    }};
    ($x:expr) => ($x);
    ($x:expr, $($ys:expr),*) => {{
        let t = max!($($ys),*);
        if $x > t { $x } else { t }
    }}
}
macro_rules! ewriteln {
    ($($args:expr),*) => { let _ = writeln!(&mut std::io::stderr(), $($args),*); };
}
macro_rules! trace {
    ($x:expr) => { ewriteln!(">>> {} = {:?}", stringify!($x), $x) };
    ($($xs:expr),*) => { trace!(($($xs),*)) }
}
macro_rules! put {
    (.. $x:expr) => {{
        let mut it = $x.iter();
        if let Some(x) = it.next() { print!("{}", x); }
        for x in it { print!(" {}", x); }
        println!("");
    }};
    ($x:expr) => { println!("{}", $x) };
    ($x:expr, $($xs:expr),*) => { print!("{} ", $x); put!($($xs),*) }
}

const M: i64 = 1_000_000_007;

fn main() {
    let mut sc = Scanner::new();
    let n: i64 = sc.cin();
    let k: i64 = sc.cin();

    let mut ans = 0;

    for b in 1..n+1 {
        let m = n / b;
        ans += min!(max!(b - k, 0), b) * m;
        let r = n - b * m;
        ans += min!(max!(r + 1 - k, 0), r);
        // trace!(b,((max!(b-k,0), m), (r, max!(r+1-k,0))));
    }

    put!(ans);
}

use std::io::{self, Write};
use std::str::FromStr;
use std::collections::VecDeque;

struct Scanner { stdin: io::Stdin, buffer: VecDeque<String>, }
impl Scanner {
    fn new() -> Self { Scanner { stdin: io::stdin(), buffer: VecDeque::new() } }
    fn cin<T: FromStr>(&mut self) -> T {
        while self.buffer.len() == 0 {
            let mut line = String::new();
            let _ = self.stdin.read_line(&mut line);
            for w in line.split_whitespace() {
                self.buffer.push_back(String::from(w));
            }
        }
        self.buffer.pop_front().unwrap().parse::<T>().ok().unwrap()
    }
    fn chars(&mut self) -> Vec<char> { self.cin::<String>().chars().collect() }
    fn vec<T: FromStr>(&mut self, n: usize) -> Vec<T> { (0..n).map(|_| self.cin()).collect() }
}


Measured memory_bytes: 4352