akhauriyash/Code-Regression huggingface dataset:
import sys
# sys.setrecursionlimit(100000)


def input():
    return sys.stdin.readline().strip()


def input_int():
    return int(input())


def input_int_list():
    return [int(i) for i in input().split()]


def main():
    h, w = input_int_list()
    grid = []
    grid.append(["."] * (w + 2))
    for _ in range(h):
        grid.append(["."] + list(input()) + ["."])
    grid.append(["."] * (w + 2))

    directions = ((1, 0), (0, 1), (-1, 0), (0, -1))

    for i in range(1, h + 1):
        for j in range(1 + w + 1):
            # "#"の周りに１つでも"#"がつながっていないか調べる
            if grid[i][j] == "#":
                cnt = 0
                for x, y in directions:
                    if grid[i + x][j + y] == "#":
                        cnt += 1
                if cnt == 0:
                    print("No")
                    return
    print("Yes")
    return


if __name__ == "__main__":
    main()


Measured memory_bytes: 67212
#include<iostream>
#include<algorithm>
#define INF 1<<28
using namespace std;

int memo[10000];

int solve(int n){
  int res = INF;
  if(!n) return 0;
  if(n < 0) return INF;
  if(memo[n]) return memo[n];
  return memo[n] = res = min(res, min(solve(n-1000)+1520, min(solve(n-1200)+1870, min(solve(n-1500)+2244, min(solve(n-200)+380, min(solve(n-300)+550, solve(n-500)+850))))));
}

int main(){ 
  int n;
  for(int i=0;i<5001;i++) solve(i);
  while(cin >> n, n) cout << memo[n] << endl; 
}

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

using Int = long long;
const char newl = '\n';

template<typename T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b) a=b;}
template<typename T1,typename T2> inline void chmax(T1 &a,T2 b){if(a<b) a=b;}
template<typename T> void drop(const T &x){cout<<x<<endl;exit(0);}
template<typename T=int>
vector<T> read(size_t n){
  vector<T> ts(n);
  for(size_t i=0;i<n;i++) cin>>ts[i];
  return ts;
}

//INSERT ABOVE HERE
signed main(){
  cin.tie(0);
  ios::sync_with_stdio(0);
  int x;
  cin>>x;
  cout<<!x<<newl;
  return 0;
}


Measured memory_bytes: 3652
import math
L=int(input())

N=int(math.log(L,2))

print(N+1,bin(L)[3:].count("1")+2*N)


for i in range(1,N+1):
    print(i,i+1,0)
    print( i, i+1 , 2**(i-1) )


tmp=2**N
for i in range(N,0,-1):
    if tmp+2**(i-1)-1<=L-1:
        print(i,N+1,tmp)
        tmp=tmp+2**(i-1)

Measured memory_bytes: 3064
#include<bits/stdc++.h>
#define ll long long
using namespace std;
string s;
ll gcd(ll a, ll b){
	return a == 0 ? b : gcd(b % a, a);
}
void solve(){
	ll a, b;
	while(1){
		cin >> s;
		int count = 0;
		if(s[0] == '#') break;
			int sz = s.size();
			if(sz == 5){
				cout << "0" << endl;
				continue;
			}else if(sz == 4){
				cout << "90" << endl;
				continue;
			}
			ll a = 0, b = 1;
			if(s[sz - 5] == 'n'){
				a = 0; b = 1;
				int i = sz - 5, cnt = 1;
				while(i >= 0){
					if(i - 5 >= 0 && s[i - 5] == 'n'){
						a = a * (1 << cnt) - 90 * b;
						b = b * (1 << cnt);
						ll gcd_ = gcd(a, b); a /= gcd_; b /= gcd_;
						i -= 5;
					}else if(i - 4 >= 0 && s[i - 4] == 'w'){
						a = a * (1 << cnt) + 90 * b;
						b = b * (1 << cnt);
						ll gcd_ = gcd(a, b); a /= gcd_; b /= gcd_;
						i -= 4;
					}else break;
					cnt++;
				}
			}else{
				a = 90; b = 1;
				int i = sz - 4, cnt = 1;
				while(i >= 0){
					if(i - 5 >= 0 && s[i - 5] == 'n'){
						a = a * (1 << cnt) - 90 * b;
						b = b * (1 << cnt);
						ll gcd_ = gcd(a, b); a /= gcd_; b /= gcd_;
						i -= 5;
					}else if(i - 4 >= 0 && s[i - 4] == 'w'){
						a = a * (1 << cnt) + 90 * b;
						b = b * (1 << cnt);
						ll gcd_ = gcd(a, b); a /= gcd_; b /= gcd_;
						i -= 4;
					}else break;
					cnt++;
				}
			}
			if(b != 1) cout << a << "/" << b << endl;
			else 	cout << a << endl;
			
		}
}
int main(void){
	solve();
	
	return 0;
}


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

using namespace std;

void Main() {
    int X, t;
    cin >> X >> t;

    if (t < X) {
        cout << X - t << endl;
    }
    else {
        cout << 0 << endl;
    }
}

int main() {
    std::cout << std::fixed << std::setprecision(15);
    Main();
    return 0;
}


Measured memory_bytes: 3636
#include <iostream>
#include <vector>
#include <algorithm>

int main(int argc, char **argv)
{
    int N, M;
    std::cin >> N >> M;

    int b = 1;
    int e = N;
    bool flag = false;
    for(int i = 0; i < M; i++){
        std::cout << b << " " << e << std::endl;
        b += 1;
        e -= 1;
        if((N % 2 == 0) && ((e - b) <= (N / 2)) && !flag){
            e -= 1;
            flag = true;
        }
    }
}


Measured memory_bytes: 3580
A, B = map(int, input().split())
strength = [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 1]

alice = strength.index(A)
bob = strength.index(B)

if alice > bob:
    print('Alice')
elif alice < bob:
    print('Bob')
else:
    print('Draw')


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

int main(void){
    int n,num2=0,num4=0;
    cin>>n;
    for(int i=0;i<n;i++){
        int a;
        cin>>a;
        if(a%4==0) num4 ++;
        else if(a%2==0) num2 ++;
    }

    if(num4*2+(num4>0)>=n){
        cout<<"Yes"<<endl;
    }else if(num2>1&&num4*2+num2>=n){
        cout<<"Yes"<<endl;
    }else{
        cout<<"No"<<endl;
    }
}

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

int main(void){
    char N[200000];
    scanf("%s",N);
    long sum = 0;
    char t[1]; 
    for(int i = 0; i < strlen(N); i++){
        if(N[i] == '9'){
            continue;
        }
        strncpy(t, N+i, 1);
        //printf("/%c\n",t[0]);
        sum += t[0]-'0';
    }
    if(sum%9 == 0){
        printf("Yes\n");
    }
    else{
        printf("No\n");
    }
    return 0;
}

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

using namespace std;

#define PB push_back
#define f first
#define s second

typedef long long ll;
typedef pair<ll, ll> pll;
typedef pair<int, int> pii;

const int MOD = 1000000007;
const int INF = 1000000007;

int main()
{
    ios_base::sync_with_stdio(0); cin.tie(0);
    ll x;
    cin >> x;
    ll start = 100;
    ll ans = 0;
    while(start < x)
    {
        start = floor(start * 1.01);
        ans++;
    }
    cout << ans;
    return 0;
}


Measured memory_bytes: 3756
SA = input()
SB = input()
SC = input()

turn = 'a'

while True:
    if turn == 'a':
        if SA != '':
            turn = SA[0]
            SA = SA[1:]
        else:
            print('A')
            exit()
    elif turn == 'b':
        if SB != '':
            turn = SB[0]
            SB = SB[1:]
        else:
            print('B')
            exit()
    elif turn == 'c':
        if SC != '':
            turn = SC[0]
            SC = SC[1:]
        else:
            print('C')
            exit()


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

using namespace std;

const int N = 100100;

int a[N];

//6

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

	for (int i = 0; i < n; ++i) {
		scanf("%d", &a[i]);
	} 
	n = unique(a, a+n) - a;
	int qtd = 0;
	for (int i = 0; i < n; ++i) {
		int at = i;
		if(at < n && a[at] < a[at+1]) {
			while(at < n && a[at] < a[at+1]){
				at = at+1;
			}
		} 
		else if(at < n && a[at] > a[at+1]) {
			while(at < n && a[at] > a[at+1]) {
				at = at+1;
			}
		}
		i = at;
		qtd++;
	} 

	printf("%d\n", qtd);

}

Measured memory_bytes: 640
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        int[] arr = new int[s.length()];
        int k = 0;
        for (char c : s.toCharArray()) {
            arr[k++] = Character.getNumericValue(c);
          //System.out.println(Character.getNumericValue(c));
        }
        
        int res = Integer.MAX_VALUE;
        for (int i =0; i< s.length() - 2;i++) {
            int val = arr[i] * 100 +arr[i+1] * 10 +arr[i+2];
            res = Math.min(Math.abs(753-val), res);
        }
        System.out.println(res);
    }
}


Measured memory_bytes: 22608
#include <bits/stdc++.h>
#ifdef __DEBUG__
    #define DBG(X) cout << #X << " = " << (X) << endl;
    #define SAY(X) cout << (X) << endl;
#else
    #define DBG(X)
    #define SAY(X)
#endif

using namespace std;

using ll = long long int;
using ull = unsigned long long int;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;

int dx[]={1, 0, -1, 0, 1,-1, 1,-1};
int dy[]={0, 1, 0, -1, 1, 1,-1,-1};
const int INT_INF = (int)(2e9);
const ll  LL_INF = (ll)(2e18);

inline void fast_io() { ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); };
template<typename T, typename S> inline ostream& operator<<(ostream& os, const pair<T, S> p) { cout << "[" << p.first << ";" << p.second << "]"; return os; }
template<typename T, typename S> inline ostream& operator<<(ostream& os, const map<T, S> p) { for (auto el : p) cout << "[" << el.first << ";" << el.second << "]"; return os; }
template<typename T> inline ostream& operator<<(ostream& os, const vector<T>& v) { for (auto el : v) cout << el << " "; return os; }
template<typename T> inline ostream& operator<<(ostream& os, const deque<T>& v) { for (auto el : v) cout << el << " "; return os; }
template<typename T> inline ostream& operator<<(ostream& os, const set<T>& v) { for (auto el : v) cout << el << " "; return os; }
template<typename T> inline vector<T> fetch_vec(int sz) { vector<T> ret(sz); for (auto& elem : ret) cin >> elem; return ret; }

int N;
vector<ll> A;
void input(){
    fast_io();
    cin >> N;
    A = fetch_vec<ll>(N);
}

vector<int> pfnum(1e6+10,0);
// map< int64_t, int > prime_factor(int64_t n) {
void prime_factor(int64_t n) {
//   map< int64_t, int > ret;
  for(int64_t i = 2; i * i <= n; i++) {
    while(n % i == 0) {
    //   ret[i]++;
      pfnum[i]++;
      while(n % i == 0) n /= i;
    }
  }
  if(n != 1) {
    //   ret[n] = 1;
    pfnum[n]++;
    }
  return ;
}


int solve(){
    int nc = A[0];
    for (int i = 0; i < N; i++)
    {
        nc = gcd(nc,A[i]);
    }
    if(nc!=1){
        cout << "not coprime" << endl;
    }
    else{
        
        for (int i = 0; i < N; i++)
        {
            prime_factor(A[i]);
        }
        for (int i = 1; i <= 1e6; i++)
        {
            if(pfnum[i]>1){
                cout << "setwise coprime" << endl;
                return 0;
            }
        }
        cout << "pairwise coprime" << endl;
    }
    
    return 0;
}   

int main()
{
    input();
    solve();
    return 0;
}

Measured memory_bytes: 14988
#include<cstdio>
#include<algorithm>
using namespace std;
int main(){
	int c[6] = {0};
	while(scanf("%d,%d,%d,%d,%d",&c[0],&c[1],&c[2],&c[3],&c[4]) != EOF){
		sort(c,c+5);
		if((c[0] == c[1] && c[1] == c[2] && c[2] == c[3]) || (c[1] == c[2] && c[2] == c[3] && c[3] == c[4]))puts("four card");
		else if((c[0] == c[1] && c[2] == c[3] && c[3] == c[4])||(c[0] == c[1] && c[1] == c[2] && c[3] == c[4]))puts("full house");
		else if((c[1] == c[0]+1 && c[2] == c[1]+1 && c[3] == c[2]+1 && c[4] == c[3]+1) || (c[0] == 1 && c[1] == 10 && c[2] == 11 && c[3] == 12 && c[4] == 13))puts("straight");
		else if((c[0] == c[1] && c[1] == c[2]) || (c[1] == c[2] && c[2] == c[3]) || (c[2] == c[3] && c[3] == c[4]))puts("three card");
		else if((c[0] == c[1] && (c[2] == c[3])||(c[3] == c[4])) || (c[1] == c[2] && c[3] == c[4]))puts("two pair");
		else if((c[0] == c[1]) || (c[1] == c[2]) || (c[2] == c[3]) || (c[3] == c[4]))puts("one pair");
		else puts("null");
	}
	return 0;
}

Measured memory_bytes: 1024
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define fi first
#define se second
typedef pair<ll,pair<array<ll,3>,int> > pit;
int x,y,z,k;
priority_queue<pit>pq;
ll a[1001],b[1001],c[1001];
void upd(array<ll,3> w,int j){
	if(w[0]>x || w[1]>y || w[2]>z) return;
	pq.push({a[w[0]]+b[w[1]]+c[w[2]],{w,j}});
}
int main(){
	ios::sync_with_stdio(false);
	cin >> x >> y >> z >> k;
	for(int i=1; i<=x ;i++) cin >> a[i];
	for(int j=1; j<=y ;j++) cin >> b[j];
	for(int i=1; i<=z ;i++) cin >> c[i];
	sort(a+1,a+x+1);
	sort(b+1,b+y+1);
	sort(c+1,c+z+1);
	reverse(a+1,a+x+1);
	reverse(b+1,b+y+1);
	reverse(c+1,c+z+1);
	array<ll,3>w={1,1,1};
	pq.push({a[1]+b[1]+c[1],{w,1}});
	for(int i=1; i<=k ;i++){
		cout << pq.top().fi << '\n';
		auto cur=pq.top().se.fi;
		int duh=pq.top().se.se;
		pq.pop();
		cur[0]++;
		if(duh<=1) upd(cur,1);
		cur[0]--;cur[1]++;
		if(duh<=2) upd(cur,2);
		cur[1]--;cur[2]++;
		if(duh<=3) upd(cur,3);
	}
}

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

void slove(){
    int a[3];
    cin >> a[0]>>a[1]>>a[2];
    sort(a,a+3);
    int ans = 0;
    if((a[1] - a[0])%2){
        a[2]++;
        a[0]++;
        ans++;
    }
    ans += (a[1] - a[0])/2;
    int x = a[2] - a[1];
    if(x%2) ans++;
    ans+=(x/2)*2;
    cout<<ans<<endl;
}

int main(){
    cin.tie(0);
    slove();
    return 0;
}

Measured memory_bytes: 3604
#include <iostream>
#include <iomanip>
#include <string>
#include <algorithm>
using namespace std;
 
 
int main()
{
	int N, K;
	double p[200000];
	double tmpSum = 0, maxSum = 0;
	double expValue;

	cin >> N >> K;
	
	for(int i=0; i<N; i++){
		cin >> p[i];
		p[i] = (p[i] + 1)/2;
	}

	for(int i=0; i<K; i++){
		tmpSum += p[i];
	}

	maxSum = tmpSum;

	for(int i=0; i<N-K; i++){
		tmpSum = tmpSum - p[i] + p[i+K];
		if(maxSum < tmpSum){
			maxSum = tmpSum;
		}
	}

	cout << setprecision(10) << maxSum;

	return 0;
}

Measured memory_bytes: 1792
#include <bits/stdc++.h>
 
using namespace std;
 
#define send {ios_base::sync_with_stdio(false);}
#define help {cin.tie(NULL); cout.tie(NULL);}
#define f first
#define s second
#define getunique(v) {sort(v.begin(), v.end()); v.erase(unique(v.begin(), v.end()), v.end());}
typedef long long ll;
typedef long double lld;
typedef unsigned long long ull;
 
template<typename A> ostream& operator<<(ostream &cout, vector<A> const &v);
template<typename A, typename B> ostream& operator<<(ostream &cout, pair<A, B> const &p) { return cout << "(" << p.f << ", " << p.s << ")"; }
template<typename A> ostream& operator<<(ostream &cout, vector<A> const &v) {
	cout << "["; for(int i = 0; i < v.size(); i++) {if (i) cout << ", "; cout << v[i];} return cout << "]";
}
template<typename A, typename B> istream& operator>>(istream& cin, pair<A, B> &p) {
	cin >> p.first;
	return cin >> p.second;
}
 
mt19937 rng(std::chrono::steady_clock::now().time_since_epoch().count());
// mt19937 rng(61378913);
/* usage - just do rng() */
 
void usaco(string filename) {
  // #pragma message("be careful, freopen may be wrong")
	freopen((filename + ".in").c_str(), "r", stdin);
	freopen((filename + ".out").c_str(), "w", stdout);
}
 
const lld pi = 3.14159265358979323846;
// const ll mod = 1000000007;
// const ll mod = 998244353;
// ll mod;
 


ll n, m, k, q, l, r, x, y, z;
const ll template_array_size = 1000625;
ll a[template_array_size];
ll b[template_array_size];
ll c[template_array_size];
string s, t;
ll ans = 0;



void solve(int tc = 0) {
	cin >> n;
	for (ll i = 0; i < n; i++) cin >> a[i];
	
	ll worst = 0;
	for (ll i = 0; i < n; i++) {
		if (a[i] < worst) {
			ans += worst - a[i];
			a[i] = worst;
		}
		worst = max(worst, a[i]);
	}
	
	cout << ans << '\n';
}
 
int main() {
	#ifdef galen_colin_local
		auto begin = std::chrono::high_resolution_clock::now();
	#endif
	
	send help
 
	#ifndef galen_colin_local
		// usaco("cowland");
	#endif
	
	// usaco("cowland");
 
	int tc = 1;
	// cin >> tc;
	for (int t = 0; t < tc; t++) solve(t);
	
	#ifdef galen_colin_local
		auto end = std::chrono::high_resolution_clock::now();
		cout << setprecision(4) << fixed;
		// cout << "Execution time: " << std::chrono::duration_cast<std::chrono::duration<double>>(end - begin).count() << " seconds" << endl;
	#endif
} 

Measured memory_bytes: 5232
import sys
sys.setrecursionlimit(10**9)

read=sys.stdin.read
    
def main():
    class Unionfind():
        def __init__(self,n):
            self.parents=[-1]*n
            self.dist=[0]*n 
        
        def find(self,x):
            if self.parents[x]<0:
                return self.dist[x],x
            else:
                tmp=self.find(self.parents[x])
                self.dist[x]+=tmp[0]
                self.parents[x]=tmp[1]
            return self.dist[x], self.parents[x]
        
        def union(self,x,y,d):
            rx=self.find(x)[1]
            ry=self.find(y)[1]
            diff=self.dist[y]-self.dist[x]-d
            if rx==ry:
                if diff!=0:
                    return True
                return False
            if diff<0:
                rx,ry=ry,rx
                diff=-diff
            self.parents[ry]=min(self.parents[ry],self.parents[rx]-diff)
            self.parents[rx]=ry
            self.dist[rx]=diff
            return False
    n,m,*lrd=map(int,read().split())
    edg=[]
    v=Unionfind(n)
    for l,r,d in zip(*[iter(lrd)]*3):
        if v.union(l-1,r-1,d):
            print('No')
            break
    else:
        if max(-d-1 for d in v.parents if d<0) >10**9:
            print('No')
        else:
            print('Yes')
if __name__=='__main__':
    main()


Measured memory_bytes: 73136
import sys
N = int(input())
if N == 0:
    print(0)
    sys.exit()
ans = []
tmp = 0

def algo(n):
    if n == 0:
        return 
    
    if n%2 == 0:
        tmp = 0 #tmpは毎回のa0に値する
    else:
        tmp = 1
    ans.append(tmp)
    algo((n-tmp)//(-2))

algo(N)
Str = ''
ans.reverse()
for i in range(len(ans)):
    Str=Str+str(ans[i])
print(Str)



Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<ll, ll>;
using vi = vector<ll>;
using vvi = vector<vi>;
using vb = vector<bool>;
using vs = vector<string>;
using vp = vector<pii>;

#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define sz(x) (ll)((x).size())
#define all(x) (x).begin(), (x).end()
#define each(a, x) for (auto&& a : (x))
#define _overload3(_1,_2,_3,name,...) name
#define rep1(n) rep2(_, n)
#define rep2(i, n) rep3(i, 0, n)
#define rep3(i, a, n) for (ll i=(a); i<(n); ++i)
#define rep(...) _overload3(__VA_ARGS__,rep3,rep2,rep1)(__VA_ARGS__)
const int INF = 1e9;
const int MOD = 1e9 + 7;
const double EPS = 1e-9;
const int dx[] = {1, 0, -1, 0, 1, 1, -1, -1};
const int dy[] = {0, 1, 0, -1, 1, -1, 1, -1};
template<class T> inline void print(const T& x) {cout << x << "\n";}
template<class T> inline bool chmax(T& a, const T& b) {if (a < b) a = b; return a < b;}
template<class T> inline bool chmin(T& a, const T& b) {if (a > b) a = b; return a > b;}
struct Init {Init() {cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(10);}} init;

int main() {
    string s, t; cin >> s >> t;
    ll lens = sz(s), lent = sz(t);
    vs pq;
    rep(i, lens - lent + 1) {
        string subs = s.substr(i, lent);
        bool isOk = true;
        rep(j, lent) {
            if (subs[j] != '?' && subs[j] != t[j]) isOk = false;
        }
        if (isOk) {
            string news = s.substr(0, i) + t + s.substr(i + lent);
            rep(j, lens) {
                if (news[j] == '?') news = news.substr(0, j) + "a"s + news.substr(j + 1);
            }
            pq.pb(news);
        }
    }
    sort(all(pq));
    if (not pq.empty()) print(pq[0]);
    else print("UNRESTORABLE");
}

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

int main(void){
  string S; cin >> S;
  if(S == "Sunny") cout << "Cloudy" << endl;
  else if(S == "Cloudy") cout << "Rainy" << endl;
  else cout << "Sunny" << endl;
  return 0;

}


Measured memory_bytes: 256
import java.util.Scanner;


public class Main { //クラス名はMain
    public static void main(String[] args) {
    Scanner scan = new Scanner(System.in);
    String rStr = scan.next();
    int r = Integer.parseInt(rStr);
     
    int S = 3*r*r;
    System.out.println(S);


    }
}

Measured memory_bytes: 21840
# coding: utf-8
import sys

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

N, M = lr()
AB = [lr() for _ in range(M)]
AB.sort(key=lambda x: [x[0], x[1]])
cur = 0
answer = 0
for a, b in AB:
    if a >= cur:
        answer += 1
        cur = b
    if b < cur:
        cur = b

print(answer)


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

int main(void) {
  int n, a, b;
  cin >> n >> a >> b;
  cout << min(n * a, b) << endl;
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for (int i=0; i<(n); ++i)
using namespace std;
using ll=long long;
int main(){
    double w,h,x,y;
    cin>>w>>h>>x>>y;
    double ans=h*w/2;
    int ans2;
    if(w==x*2&&h==y*2)ans2=1;
    else ans2=0;
    printf("%.10f %d\n",ans,ans2);
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
string s;
 
int main() {
  cin>>s;
  if(s[0]==s[1]&&s[1]==s[2]){
    cout << "Yes" << endl;
  } else if(s[1]==s[2]&&s[2]==s[3]){
     cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}

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

namespace OJcsharp
{
    class Program
    {
        static void Main(string[] args)
        {
            long[] ans = new long[10000];
            int count=0;
            string str = Console.ReadLine();
            do
            {
                int d = int.Parse(str);
                ans[count] = 0;
                for (int n = 1; n * d < 600; n++)
                {
                    ans[count] += (n * d * n * d) * d;
                }
                count++;
                str = Console.ReadLine();
            } while (String.IsNullOrEmpty(str) == false);
            for (int n = 0; n < count; n++)
                Console.WriteLine(ans[n]);
        }
    }
}

Measured memory_bytes: 5632
//#include <bits/stdc++.h>
 
#include <iostream>
#include <algorithm>
 
#include <bitset>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <stack>
#include <queue>
#include <deque>
#include <cstring>
#include <string>
#include <utility>
#include <array>
#include <complex>
#include <valarray>
 
#include <cassert>
#include <cmath>
#include <functional>
#include <iomanip>
#include <chrono>
#include <random>
#include <numeric>
 
 
using namespace std;
#define int long long
 
typedef long long ll;
typedef unsigned long long ull;
//typedef unsigned __int128 HASH;
typedef pair<int,int> pii;
typedef pair<ll, ll> pll;
typedef pair<ull, ull> pullull;
typedef pair<ll,int> plli;
typedef pair<double, int> pdbi;
typedef pair<int,pii> pipii;
typedef pair<ll,pll> plpll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vi> vvi;
typedef vector<vvi> vvvi;
typedef vector<pii> vpii;
typedef vector<vector<int>> mat;
 
#define rep(i,n) for (int i=0;i<(n);i++)
#define rep2(i,a,b) for (int i=(a);i<(b);i++)
#define rrep(i,n) for (int i=(n);i>0;i--)
#define rrep2(i,a,b) for (int i=(a);i>b;i--)
#define pb push_back
#define fi first
#define se second
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
 
const ll hmod1 = 999999937;
const ll hmod2 = 1000000000 + 9;
const int INF = 1<<30;
const ll INFLL = 1LL<<62;
const double EPS = 1e-12;
const ll mod = 1000000000 + 7;
const int dx4[4] = {1, 0, -1, 0};
const int dy4[4] = {0, 1, 0, -1};
const int dx8[8] = {1, 1, 1, 0, 0, -1, -1, -1};
const int dy8[8] = {0, 1, -1, 1, -1, 0, 1, -1};
const double pi = 3.141592653589793;
 
#define addm(X, Y) (X) = ((X) + ((Y) % mod) + mod) % mod
#define inside(y, x, h, w) (0 <= (y) && (y) < (h) && 0 <= (x) && (x) < (w)) ? true : false

struct UnionFind {
	vector<int> par, size;
	//int cmps;    ??£??????????????°
	//vector<int> cmp_size;    cmp_size[i]:=??????i???root????±?????????£???????????????????´???°    
	
	UnionFind() {}

	UnionFind(int n) : par(n), size(n, 1) {
		//cmps = n;
		for (int i = 0; i < n; i++) {
			par[i] = i;
			//cmp_size[i] = 1;
		}
	}

	int find_root(int now) {
		if (par[now] == now) return now;
		return par[now] = find_root(par[now]);
	}

	void unite(int u, int v) {
		int x = find_root(u);
		int y = find_root(v);
		if (x == y) return;

		if (size[x] < size[y]) swap(x, y);
		par[y] = x;
		if (size[x] == size[y]) size[x]++;
		//cmps--;
		//cmp_size[x] += cmp_size[y];
	}

	bool same(int u, int v) {
		return find_root(u) == find_root(v);
	}

	
	/*??????x????±?????????£??????????????°????±???????
	int count_same(int x) {
		return cmp_size[find_root(x)];
	}
	*/

};

int n, q;

signed main() {	
    cin.tie(0);
    ios::sync_with_stdio(false);
	cin >> n >> q;
	UnionFind uf(n);
	rep(i, q) {
		int com, u, v;
		cin >> com >> u >> v;
		if (com == 0) {
			uf.unite(u, v);
		}
		else {
			cout << uf.same(u, v) << endl;
		}
	}
}

Measured memory_bytes: 3352
/* 
	Author: ankrypt
*/


#include <bits/stdc++.h>

using namespace std;

#define MOD 1000000007
#define ll long long int
#define u64 unsigned long long int

ll N, K, Q;
ll val;
map<ll, ll> mp;

int main() {
	scanf("%lld %lld %lld", &N, &K, &Q);
	for(int i = 0; i < Q; i++) {
		scanf("%lld", &val);
		mp[val]++;
	}
	for(int i = 1; i <= N; i++) {
		ll sum = K;
		sum -= Q;
		sum += mp[i];
		if(sum > 0) {
			printf("Yes\n");
		}
		else {
			printf("No\n");
		}
	}
	return 0;
}
/*
	Powered by Buggy Plugin
*/


Measured memory_bytes: 6912
#include <iostream>
#include <queue>
#include <vector>
using namespace std;

int h, w, n;
int gy[10], gx[10];
char field[1000][1001];

//????????????
const int dy[4] = {-1, 0, 1, 0};	//?????°
const int dx[4] = {0, 1, 0, -1};	//?????°

//???????????°????±???????
int bfs( int starty, int startx, int goaly, int goalx ){
	//static(??????)???????????¨????¨???¶??????????¨???¶????????¶????????°?????????????????°??¨?????????????????§
	//????????????????????°????????????????????????bfs??¢??°?????§??????????????????????????°???????????\???
	static int minDist[1000][1000];		//minDist[y][x] = y(>=0)???x(>=0)???????????§??????????????°
	static queue<pair<int, int> > que;	//?????°, ??´???
	int i, j;
	
	for( i = 0; i < h; i++ )
		for( j = 0; j < w; j++ )
			minDist[i][j] = 100000000;	//???????????§??????????????\????????????
			
	que.push(pair<int, int>(0, starty * w + startx) );
	while( !que.empty() ){
		int cost = que.front().first;
		int nowy = que.front().second / w;
		int nowx = que.front().second % w;
		que.pop();
		
		if( minDist[nowy][nowx] <= cost )	//??´???????????????????????°????°???????????????????
			continue;
		minDist[nowy][nowx] = cost;			//???????????°?????´??°
		
		for( i = 0; i < 4; i++ ){
			int nexty = nowy + dy[i];
			int nextx = nowx + dx[i];
			if( 0 <= nexty && nexty < h && 0 <= nextx && nextx < w ){	//?????????????£?????????????
				if( field[nexty][nextx] != 'X' ){						//???????£???§???????????°
					que.push( pair<int, int>(cost + 1, nexty * w + nextx) );	//?§??????????
				}
			}
		}
	}
	
	return minDist[goaly][goalx];
}

int main()
{
	int i, j;
	cin >> h >> w >> n;
	for( i = 0; i < h; i++ ){
		cin >> field[i];
		for( j = 0; j < w; j++ ){
			if( field[i][j] == 'S' ){
				gy[0] = i;
				gx[0] = j;
			}
			else if( '1' <= field[i][j] && field[i][j] <= '9' ){
				gy[field[i][j] - '0'] = i;
				gx[field[i][j] - '0'] = j;
			}
		}
	}
	
	int ans = 0;
	for( i = 0; i < n; i++ ){
		//???????????\??´i(i = 0?????????S)?????????????????\??´i + 1?????????????????°????¶????
		ans += bfs(gy[i], gx[i], gy[i+1], gx[i+1]);
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 6104
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(int i=0;i<n;i++)
int main(){
    int n,k,q,tmp;
    cin >> n >> k >>q;
    vector<int> vec(n,0);
    rep(i,q){
        cin >> tmp;
        vec.at(tmp-1)++;
    }
    rep(i,n){
        cout << ((vec.at(i)>(q-k))?"Yes":"No") << endl;
    }
}

Measured memory_bytes: 1024
using System;
using System.Collections.Generic;
class Program
{
	static void Main(string[] args)
	{
		int n = int.Parse(Console.ReadLine());
		int[] x = new int[n];
		int[] y = new int[n];
		for(int i = 0; i < n; i++){
			string[] input = Console.ReadLine().Split(' ');
			x[i] = int.Parse(input[0]);
			y[i] = int.Parse(input[1]);
		}
		double kyori = 0;
		double sum = 0;
		for(int i = 0; i < n; i++){
			for(int j = 0; j < i; j++){
				kyori = Math.Sqrt(Math.Pow(x[i]-x[j], 2)+Math.Pow(y[i]-y[j], 2));
				sum += kyori;
			}
		}
		//出力
		Console.WriteLine(sum * 2 / n);
	}
}

Measured memory_bytes: 11092
#include <bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
#define db(x) (cerr << #x << ": " << (x) << '\n')
#define cps CLOCKS_PER_SEC
#define tests(t) int t; cin >> t; while(t--)
#define iceil(n, x) (((n) + (x) - 1) / (x))
#define eb emplace_back
#define pb push_back
#define pf push_front
#define pob pop_back
#define pof pop_front
#define sz size()
#define all(v) (v).begin(), (v).end()
#define uni(v) sort(all(v)), (v).erase(unique(all(v)), (v).end())
#define fi first
#define se second
#define bitcount(x) __builtin_popcount(x)
#define bit(x) (1LL << x)
#define PI acos(-1.0)
#define EPS 1e-9

#define mod 1000000007
#define maxn 200005

using namespace std;

using namespace __gnu_pbds;
template<class key, class cmp = std::less<key>>
using ordered_set = tree<key, null_type, cmp, rb_tree_tag, tree_order_statistics_node_update>;
///All indexing is 0-based
///methods: find_by_order(k); & order_of_key(k);
///To make it an ordered_multiset, use pairs of (value, time_of_insertion)
///to distinguish values which are similar

typedef long long ll;
typedef double ld;
typedef pair<ll, ll> par;

ll sol=0,M,N,arr[100] , a[100],b[100],c[100],d[100],Q;

void comb(int pos,int val)
{
    if(pos == N+1){
       ll ret=0;
       for(int i=1;i<=Q;i++)
            if(arr[ b[i] ] - arr[a[i]] == c[i] )
                ret+=d[i];
       sol = max(sol,ret);
       return ;
    }

    for(int i=val;i<=M;i++){
        arr[pos] = i;
        comb(pos+1,i);
    }
}

int main()
{
    #ifdef acm
    freopen("a.in","r",stdin);
    #endif // acm
    ios_base::sync_with_stdio(0);
    cin.tie(0);

    cin >> N >> M >> Q;

    for(int i=1;i<=Q;i++)
        cin >> a[i] >> b[i] >> c[i] >> d[i];
    comb(1,1);

    cout << sol;





}


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

using namespace std;

string s,t;

int main(){
	cin >> s;
	bool flag = 0;
	int st = 0;
	
	while(s.size() >= t.size() + 5){
		if(s[t.size()] == 'd'){
			t += "dream";
			st = 1;
		}
		else if(s[t.size()] == 'r' && st == 2){
			t += "r";
			st = 0;
		}
		else{
			if (s[t.size() + 2] != 'a' && st != 0){
				t += "er";
				st = 0;
			}
			else{
				t += "erase";
				st = 2;
			}
		}
	}
	
	if(st == 1 && s.size() - t.size() == 2)
	t += "er";
	if(st == 2 && s.size() - t.size() == 1)
	t += "r";
	
	if(s == t)
	printf("YES\n");
	else
	printf("NO\n");
}


Measured memory_bytes: 640
#pragma GCC optimize ("O3")
#pragma GCC target ("avx")
#include<stdio.h>
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<string.h>

#ifdef LOCAL
#define eprintf(...) fprintf(stderr, __VA_ARGS__)
#else
#define NDEBUG
#define eprintf(...) do {} while (0)
#endif
#include<cassert>

using namespace std;

typedef long long LL;
typedef vector<int> VI;

#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define EACH(i,c) for(__typeof((c).begin()) i=(c).begin(),i##_end=(c).end();i!=i##_end;++i)

template<class T> inline void amin(T &x, const T &y) { if (y<x) x=y; }
template<class T> inline void amax(T &x, const T &y) { if (x<y) x=y; }
template<class Iter> void rprintf(const char *fmt, Iter begin, Iter end) {
    for (bool sp=0; begin!=end; ++begin) { if (sp) putchar(' '); else sp = true; printf(fmt, *begin); }
    putchar('\n');
}

int A, B, M;
int as[100011], bs[100011];

void MAIN() {
    scanf("%d%d%d", &A, &B, &M);
    REP (i, A) scanf("%d", as+i);
    REP (i, B) scanf("%d", bs+i);

    int ans = *min_element(as, as+A) + *min_element(bs, bs+B);
    REP ($, M) {
	int x, y, c;
	scanf("%d%d%d", &x, &y, &c);
	x--; y--;
	amin(ans, as[x] + bs[y] - c);
    }

    printf("%d\n", ans);
}

int main() {
    int TC = 1;
//    scanf("%d", &TC);
    REP (tc, TC) MAIN();
    return 0;
}



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

struct UnionFind {
private :
    vector<int> data; int sz;
public :
    UnionFind(int sz) : data(sz, -1), sz(sz) { }

    bool unite(int x, int y) {
        if ((x = root(x)) == (y = root(y))) return false;
        if (data[x] > data[y]) swap(x, y);
        data[x] += data[y];
        data[y] = x;
        sz--;
        return true;
    }

    bool is_same(int x, int y) { return root(x) == root(y); }

    int root(int x) { return data[x] < 0 ? x : data[x] = root(data[x]); }

    size_t size(int x) { return (size_t)-data[root(x)]; }

    size_t size() { return (size_t)sz; }

};

constexpr int MAX = 100100;

int main() {
    int n;
    cin >> n;
    UnionFind uf(n);
    vector<int> x(n), y(n);
    vector<int> idx(MAX, -1), idy(MAX, -1);
    for (int i = 0; i < n; i++) {
        cin >> x[i] >> y[i];
        if (idx[x[i]] == -1) {
            idx[x[i]] = i;
        } else {
            uf.unite(i, idx[x[i]]);
        }
        if (idy[y[i]] == -1) {
            idy[y[i]] = i;
        } else {
            uf.unite(i, idy[y[i]]);
        }
    }
    
    vector<vector<int>> dx(n), dy(n);
    for (int i = 0; i < n; i++) {
        const int r = uf.root(i);
        dx[r].emplace_back(x[i]);
        dy[r].emplace_back(y[i]);
    }
    
    for (vector<int> &v : dx) {
        sort(v.begin(), v.end());
        v.erase(unique(v.begin(), v.end()), v.end());
    }
    for (vector<int> &v : dy) {
        sort(v.begin(), v.end());
        v.erase(unique(v.begin(), v.end()), v.end());
    }
    
    long long ans = 0;
    for (int i = 0; i < n; i++) {
        long long cx = dx[i].size();
        long long cy = dy[i].size();
        if (cx < 2 or cy < 2) continue;
        ans += cx * cy;
        ans -= uf.size(i);
    }
    
    cout << ans << '\n';
    
    return 0;
}

Measured memory_bytes: 8064
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define inf 99999999999999
ll dp[100005],a[105],b[105];
int main()
{
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    ll N,W,i,j,ans;
    cin>>N>>W; 
    for(i=0;i<100005;i++) dp[i]=inf;
    for(i=0;i<N;i++) cin>>a[i]>>b[i];
    dp[0]=0;
    for(i=0;i<N;i++)
    {
        for(j=100004;j>=0;j--)
        { 
            if(j+b[i]<100005)
            dp[j+b[i]]=min(dp[j+b[i]],dp[j]+a[i]); 
        }
    }
    for(i=0;i<100005;i++)
    {
        if(dp[i]<=W)
        { ans=i;}
    }
    cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 1024
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let mut s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};

    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}

macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };

    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };

    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };

    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };

    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}
fn adjacent4(x: usize, y: usize, sx: usize, sy: usize) -> Vec<(usize, usize)> {
    [(-1, 0), (1, 0), (0, -1), (0, 1)]
        .into_iter()
        .filter_map(|&(dx, dy)| {
            let nx = x as isize + dx;
            let ny = y as isize + dy;
            if nx >= 0 && nx < sx as isize && ny >= 0 && ny < sy as isize {
                Some((nx as usize, ny as usize))
            } else {
                None
            }
        })
        .collect()
}

#[allow(unused_imports)]
use std::collections::{BTreeMap, BTreeSet, BinaryHeap, HashMap, HashSet, VecDeque};
fn main() {
    input! {
        n: u64,
    }
    for x in 0..500001 {
        let y = (x as f64 * 1.08) as u64;
        if y == n {
            println!("{}", x);
            return;
        }
    }
    println!(":(");
}


Measured memory_bytes: 4352
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(ll i = 0, i##_len = (n); i < i##_len; i++)
#define reps(i, s, n) for(ll i = (s), i##_len = (n); i < i##_len; i++)
#define rrep(i, n) for(ll i = (n) - 1; i >= 0; i--)
#define rreps(i, e, n) for(ll i = (n) - 1; i >= (e); i--)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define sz(x) ((ll)(x).size())
#define len(x) ((ll)(x).length())
#define endl "\n"

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    // ifstream in("input.txt");
    // cin.rdbuf(in.rdbuf());
    ll x, y;
    cin >> x >> y;
    rep(i, x + 1) {
        ll j = x - i;
        if (((i * 2) + (j * 4)) == y) {
            cout << "Yes" << endl;
            return 0;
        }
    }
    cout << "No" << endl;
    return 0;
}


Measured memory_bytes: 3640
#include <iostream>
#include <sstream>
#include <iomanip>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cctype>
#include <cstring>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <algorithm>
#include <iterator>
#include <bitset>
#include <ctime>
#include <complex>
using namespace std;



#define FOR(i,a,b) for (int i = (a); i < (b); i++)
#define RFOR(i,b,a) for (int i = (b)-1; i >= (a); i--)
#define ITER(it,a) for (__typeof(a.begin()) it = a.begin(); it != a.end(); it++)
#define FILL(a,value) memset(a, value, sizeof(a))

#define SZ(a) (int)a.size()
#define ALL(a) a.begin(), a.end()
#define PB push_back
#define MP make_pair

typedef long long LL;
typedef vector<int> VI;
typedef pair<int, int> PII;

const double PI = acos(-1.0);
const int INF = 1000 * 1000 * 1000 + 7;
const LL LINF = INF * (LL)INF;

const double EPS = 1e-8;
const int MOD = 1000 * 1000 * 1000 + 7;
const int MAX = 2*1000 * 100 + 47;
const int LEN = 20;
const int ALP = 128;

int DP[MAX];
int main()
{
    //freopen("in.txt", "r", stdin);
    int n;
    scanf("%d", &n);
    FOR(i, 0, n) {
        int x;
        scanf("%d", &x);
        DP[x] = DP[x-1]+1;
    }
    int res = n - *max_element(DP, DP + n + 1);
    cout << res << endl;
    
    
    return 0;
}


Measured memory_bytes: 1024
#include <cstdio>

int main() {
	int r, c;
	while(~scanf("%d%d", &r, &c) && (r || c)) {
		if(r % 2 && c % 2) {
			puts("no");
		}else {
			puts("yes");
		}
	} 
	return 0;
} 

Measured memory_bytes: 1012
import java.util.Scanner;
public class Main{
	public static void main(String[] args) {
		int a,b,d,r;
		double f;
		Scanner br =new Scanner(System.in);
		a=br.nextInt();
		b=br.nextInt();
		d=a/b;
		r=a%b;
		f=(double)a/b;
		System.out.print(d+" "+r+" ");
		System.out.printf("%.5f",f);
		System.out.println();
	}
}

Measured memory_bytes: 26288
#pragma region Macros
#include <bits/stdc++.h>

using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
using WGraph = vector<vector<pair<int, ll>>>;

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

constexpr int dx[4] = {-1, 0, 0, 1}, dy[4] = {0, -1, 1, 0};
constexpr int INF = 1e9;
constexpr int MOD = 1e9 + 7;
constexpr long long LINF = 1e18;
constexpr double EPS = 1e-10;
constexpr double PI = M_PI;
#pragma endregion

void solve() {
    int n;
    cin >> n;
    vector<int> a(n);
    for (int i=0; i<n; i++) {
        cin >> a.at(i);
    }

    for (int x : a) {
        if (x%2 == 0) {
            if (x%3 != 0 && x%5 != 0) {
                cout << "DENIED" << '\n';
                return;
            }
        }
    }

    cout << "APPROVED" << '\n';
}

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

    solve();

    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <iomanip>
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
// #define ordered_set tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update>

#define ll long long
#define Size(v) (int)v.size()

using namespace std;
// using namespace __gnu_pbds;

int n, k;

void solve() {
	cin >> n >> k;

	vector<int> a(n + 1);

	for (int i = 1; i <= n; ++i) cin >> a[i];

	int cnt = 0;
	for (int i = 1; i <= n; ++i) if (a[i] >= k) ++cnt;

	cout << cnt;
}

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

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

Measured memory_bytes: 3632
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ll long long
int main(){
    int n,k;
    cin >> n >> k;
    vector<int> sunuke(n);
    int cnt=0;
    
    rep(i,k){
        int a;
        cin >> a;
        
        rep(i,a){
            int b;
            cin >> b;
            b--;
            sunuke[b]++;
        }
    }
    rep(i,n){
        if(sunuke[i] == 0) cnt++;
    }
    cout <<cnt <<endl;
}

Measured memory_bytes: 3628
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < n; i++)
#define all(v) v.begin(), v.end()
    
int main(){
    long long x,k,d;
    cin >> x >> k >> d;

    x = abs(x);
    
    long long kai = x/d;

    if(kai > k){
        cout << x - k * d << endl;
    }

    else{
        long long amari = (k-kai)%2;
        if(amari == 0){
            cout << abs(x - kai*d) << endl;
        }
        else{
            cout << abs(x - kai*d - d) << endl;
        }
    }
}


Measured memory_bytes: 3632
#include <iostream>
#include <cmath>

using namespace std;

template<class T>
auto digit_sum(T x)
{
    T sum = 0;
    while(x >= 10)
    {
        sum += x % 10;
        x /= 10;
    }
    return sum + x;
}

int main()
{
    int n;
    
    cin >> n;
    cout << ((n % digit_sum(n) == 0) ? "Yes" : "No") << endl;
    return 0;
}


Measured memory_bytes: 256
#include <algorithm>
#include <climits>
#include <iostream>
#include <string>
#include <utility>
#include<vector>
#include<iomanip>
#include<map>
#include <queue>
#include<cmath>
#include<cstdio>
#include<iomanip>
#include<set>
#include <bits/stdc++.h>
 
using namespace std;
using ll = long long int;
 
#define REP(i,n) for(ll i=0;i<(ll)(n);i++) //REP(i, 5) cout<<i;
#define REPD(i,n) for(ll i=(ll)(n)-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=(a);i<=(b);i++)
#define MOD 1000000007 //10^9+7
//#define MOD 1
 
ll gcd(ll a, ll b) {
  ll tmp;
  if ( b > a) {
    tmp = a;
    a = b;
    b = tmp;
  }
  while (a % b !=0) {
    tmp = b;
    b = a % b;
    a = tmp;
  }
  return b;
}
 
const int MAX = 2000;

long long fac[MAX], finv[MAX], inv[MAX];
 
// テーブルを作る前処理
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}

// 二項係数計算
long long COM(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}


void sosuu(ll n, vector<ll> &v){

  vector<ll> num(n, 0);

  FOR(i, 1, sqrt(n)){
    if(num[i]==0){
      FOR(j, 0, n/i){
        num[i+(j*i)] = 1;
      }
    }
  }
  REP(i, n){
    if(num[i]==0) v.push_back(i+1);
  }
}

ll GetDigit(ll num){
    ll digit=0;
    while(num!=0){
        num /= 10;
        digit++;
    }
    return digit;
}

ll power(ll a, ll b){
  ll ans = 1;
  if(b%2==0){
    REP(i, b/2){
      ans *= a;
      if(ans>1000000000){
        return -1;
      }
    }
    return ans * ans;
  }else{
    b = b/2;
    REP(i, b){
      ans *= a;
      if(ans>1000000000){
        return -1;
      }
    }
    return ans * ans* a;
  }
}
int main(void){
  
  ll a, b;
  cin>>a>>b;
  cout<<a*b <<endl;
  return 0;
}

Measured memory_bytes: 3644
#include<iostream>
#include<vector>
#include<string>
#include<cmath>
#include<limits>
#include<algorithm>
#include<numeric>
#include<utility>

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

int main(){
    int N,D;

    std::cin >> N >> D;

    std::cout << ((N%(D*2+1)==0)?(N/(D*2+1)):(N/(D*2+1)+1)) << std::endl;

    return 0;
}

Measured memory_bytes: 256
<?php
$mem = [];
$ans = 0;
fscanf(STDIN, "%d", $K);
for ($i = 1; $i <= $K; $i++) {
    for ($j = 1; $j <= $K; $j++) {
        for ($k = 1; $k <= $K; $k++) {
            $x = gcd($i, $j);
            $y = gcd($x, $k);
            $ans += $y;
        }
    }
}
printf("%d", $ans);

//最大公約数
function gcd($m, $n){
    global $mem;

    if($n > $m) list($m, $n) = array($n, $m);
    $mm = $m;
    $nn = $n;

    if (isset($mem[$mm][$nn])) {
        return $mem[$mm][$nn];
    }

    while($n !== 0){
        $tmp_n = $n;
        $n = $m % $n;
        $m = $tmp_n;
    }
    $mem[$mm][$nn] = $m;
    return $m;
}
 
//最小公倍数
function lcm($m, $n){
    return $m * $n / gcd($m, $n);
}

Measured memory_bytes: 17816
#include<bits/stdc++.h>
using namespace std;
using ll=long long;
 
int main(){
  int i,j,cnt=0;
  int n,y;
  cin>>n>>y;
  y/=1000;
  for(i=0;;i++){
    if(i>n)break;
    for(j=0;;j++){
      if(i+j>n)break;
      if(n+4*i+9*j==y){
        cout<<j<<" "<<i<<" "<<n-i-j;
        return 0;
      }
    }
  }
  cout<<-1<<" "<<-1<<" "<<-1;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <bitset>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#include <complex>
#include <string.h>
#include <numeric>
using namespace std;

//#define int long long
#define reps(i,s,n) for(int (i)=(s);(i)<(n);++(i))
#define rep(i,n) reps(i,0,n)
#define rept(i,n) rep(i,(n)+1)
#define repst(i,s,n) reps(i,s,(n)+1)
#define reprt(i,n,t) for(int (i)=(n);(i)>=(t);--(i))
#define repr(i,n) reprt(i,n,0)
#define each(itr,v) for(auto &(itr):(v))
#define all(c) (c).begin(),(c).end()
#define rall(c) (c).rbegin(),(c).rend()
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define tmax(x,y,z) max(x,max(y,z))
#define tmin(x,y,z) min(x,min(y,z))
#define chmin(x,y) x=min(x,y)
#define chmax(x,y) x=max(x,y)
#define ln '\n'
#define bln(i,n) (((i)==(n)-1)?'\n':' ')
#define dbg(x) cout<<#x" = "<<(x)<<ln<<flush
#define dbga(x,n) {cout<<#x" : ";for(int (i)=0;i<(n);++i){cout<<((x)[i])<<(i==((n)-1)?'\n':' ')<<flush;}}
#define zero(a) memset(a,0,sizeof(a))
#define unq(a) sort(all(a)),a.erase(unique(all(a)),a.end())

//typedef complex<double> P;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<string> vst;
typedef vector<pii> vpii;
typedef vector<pll> vpll;
typedef vector<vector<int> > mat;

const ll inf = (ll)1e9+10;
const ll linf = (ll)1e18+10;
const ll mod = (ll)(1e9+7);
const int dx[] = {0, 1, 0, -1};
const int dy[] = {1, 0, -1, 0};
const int ddx[] = {0, 1, 1, 1, 0, -1, -1, -1};
const int ddy[] = {1, 1, 0, -1, -1, -1, 0, 1};
const double eps = 1e-10;

ll mop(ll a,ll b,ll m=mod) {ll r=1;a%=m;for(;b;b>>=1){if(b&1)r=r*a%m;a=a*a%m;}return r;}
ll gcd(ll a,ll b) {return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b) {return a*b/gcd(a,b);}
bool ool(int x,int y,int h,int w) {return((x<0)||(h<=x)||(y<0)||(w<=y));}
bool deq(double a,double b) {return abs(a-b)<eps;}

struct oreno_initializer {
	oreno_initializer() {
		cin.tie(0);
		ios::sync_with_stdio(0);
	}
} oreno_initializer;



int a[4], b;

signed main() {
	while (cin>>a[0]>>a[1]>>a[2]>>a[3]) {
		int x = 0, y = 0;
		rep(i,4) {
			cin >> b;
			rep(j,4) if (a[j]==b) (i==j ? x : y)++;
		}
		cout << x << ' ' << y << endl;
	}
}



Measured memory_bytes: 3112