akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;

int main() {
  int N, M;
  cin >> N >> M;
  vector<pair<int, int>> student(N),point(M);
  for(int i = 0; i < N; i++){
    cin >> student.at(i).first >> student.at(i).second;
  }
  for(int i = 0; i < M; i++){
    cin >> point.at(i).first >> point.at(i).second;
  }
  
  //それぞれの学生の最近チェックポイントを求める
  for(int i = 0; i < N; i++){
    int min = INT_MAX,num = 0;
    for(int j = 0; j < M; j++){
      int distance;
      distance = abs(student.at(i).first - point.at(j).first) + abs(student.at(i).second - point.at(j).second);
      if(min > distance){
        num = j;
        min = distance;
      }
    }
    cout << num + 1 <<endl;
  }
}

Measured memory_bytes: 256
c1=[int(i) for i in input().split()]
c2=[int(i) for i in input().split()]
d=[(0,0,1),(-1,0,0),(0,1,0),(0,-1,0),(1,0,0),(0,0,-1)]
def crosspro(y,x):
    return (y[1]*x[2]-y[2]*x[1],y[2]*x[0]-y[0]*x[2],y[0]*x[1]-y[1]*x[0])
def north(r):
    res=[]
    for p in r:
        res.append((p[2],p[1],-p[0]))
    return res
def south(r):
    res=[]
    for p in r:
        res.append((-p[2],p[1],p[0]))
    return res
def east(r):
    res=[]
    for p in r:
        res.append((p[0],p[2],-p[1]))
    return res
def west(r):
    res=[]
    for p in r:
        res.append((p[0],-p[2],p[1]))
    return res
def left(r):
    res=[]
    for p in r:
        res.append((p[1],-p[0],p[2]))
    return res
def right(r):
    res=[]
    for p in r:
        res.append((-p[1],p[0],p[2]))
    return res
T=["","N","E","W","S","NN"]
U=["","L","LL","LLL"]
def change(S):
    D=d
    for i in S:
        if i=="N":
            D=north(D)
        elif i=="E":
            D=east(D)
        elif i=="W":
            D=west(D)
        elif i=="S":
            D=south(D)
        elif i=="L":
            D=left(D)
        else:
            D=right(D)
    return D
for i in T:
    for j in U:
        D=change(i+j)
        flag=0
        for x in range(6):
            for y in range(6):
                if d[x]==D[y]:
                    if c1[x]!=c2[y]:
                        flag=1
        if flag==0:
            print("Yes")
            exit()
print("No")



Measured memory_bytes: 5628
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp>
#define ll long long int
#define ld long double
#define pb push_back
#define pll pair<ll, ll> 
#define tri pair<pll, ll>
#define vl vector<ll> 
#define vvl vector< vector<ll> > 
#define vlp vector< pair<ll, ll> >
#define vllp vector<pair<pll, ll> > 
#define mll map<ll, ll> 
#define rep(i,a)  for(ll i=0; i< a; i++)
#define rep1(i,a)   for(ll i = 1; i< a; i++)
#define foi(i, a, b)    for(ll i = a; i<b ; i++)
#define fod(i, a, b)    for(ll i = a; i>=b ; i--)
#define mp make_pair
#define all(v)  (v).begin(), (v).end()
#define fst first
#define sec second
#define ff first.first
#define fs first.second
#define max3(a, b, c)   max(max(a, b), c)
#define min3(a, b, c)   min(min(a, b), c)
#define MAX 1000005
#define MOD 1000000007
// #define MOD 998244353
#define endl "\n"
#define INF (ll)1e18
#define s(v) (ll)v.size()
#define e(v) v.empty()
#define bscount(x) __builtin_popcountll(x)
// #define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>

using namespace std;
// using namespace __gnu_pbds;

ll gcd(ll a, ll b){if(b==0)return a;return gcd(b, a%b);}
ll cpow(ll a, ll b, ll M){ll ans = 1;while(b){if(b&1) ans = ans*a%M; b/=2;a=a*a%M;}return ans;}
void ingraph(vvl& graph, ll m){ll x, y;rep(i, m){cin>>x>>y;x--, y--;graph[x].pb(y);graph[y].pb(x);}}
ll modify(ll n){ll res = n;res%=MOD;res+=MOD;res%=MOD;return res;}
ll fexp(ll a, ll b) {return cpow(a, b, MOD);}
ll cinv(ll a, ll p){return cpow(a, p-2, p);} 
ll inverse(ll a)    {return cinv(a, MOD);}

int main(){
    // #ifndef ONLINE_JUDGE
    //     freopen("../input.txt", "r", stdin);
    //     freopen("../output.txt", "w", stdout);
    // #endif
    ios::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
    ll t;
    // cin>>t;
    t = 1;
    ll tc = 0;
    while(tc++ < t){
    	ll n, m, d;
        cin>>n>>m>>d;
        ld ans = 1.0*(m-1)*(n-d)/(n*1.0*n);
        if(d > 0)	ans *= 2.0;
        cout<<fixed<<setprecision(10)<<ans;
    }
}

Measured memory_bytes: 3768
#include<bits/stdc++.h>
using namespace std;
const int N=2e5+10;
typedef long long ll;

ll a[N],f[N];
ll n,k;

bool judge(ll mi)
{
    ll t=k;
    for(int i=0;i<n;++i)
    {
        if(a[i]*f[i]<=mi)
            continue;
        ll d=mi/f[i];
        if(t<a[i]-d)
            return false;
        t-=a[i]-d;
    }
    return true;
}

ll bi_search()
{
    ll l=0,r=1e13;
    while(l<r)
    {
        ll mi=(l+r)>>1;
        if(judge(mi))
            r=mi;
        else l=mi+1;
    }
    return l;
}

int main()
{
    cin>>n>>k;
    for(int i=0;i<n;++i)
        scanf("%lld",a+i);
    for(int i=0;i<n;++i)
        scanf("%lld",f+i);
    sort(a,a+n);
    sort(f,f+n,greater<ll>());
    cout<<bi_search();
    return 0;
}


Measured memory_bytes: 3328
#include <bits/stdc++.h>
using namespace std;
 
int main () {
  int N;
  cin >> N;
  vector<int64_t> memo(N);
  cin >> memo.at(0);
  for (int i = 1; i < N; i++) {
    int64_t a;
    cin >> a;
    memo.at(i) = a + memo.at(i - 1);
  }
  double ans = 100000000000001;
  for (int i = 0; i < N - 1; i++) {
    ans = min(ans, abs(((memo.at(N - 1) + 0.0) / 2) - memo.at(i)));
  }
  int64_t A = 2 * ans;
  cout << A << endl;
}
       

Measured memory_bytes: 4776
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
#define REP(i, start, end) for (ll i = start, i##Len = (end); i < i##Len; ++i)
#define REPR(i, start, end) for (ll i = start, i##Len = (end); i > i##Len; --i)
using ll = long long;
using namespace std;

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

    int n, x, t;
    cin >> n >> x >> t;
    cout << (n + x - 1) / x * t << endl;
}

Measured memory_bytes: 3608
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.lang.reflect.Array;
import java.util.Arrays;
import java.util.StringTokenizer;

public class Main {
    public static void main(String[] args) {
        FastReader s = new FastReader();
        int n,k;
        n=s.nextInt();
        k=s.nextInt();
        int d;
        int cnt=0;
        int [] arr = new int[n];
        Arrays.fill(arr,0);
        while(k-->0){
           d=s.nextInt();
           while(d-->0){
               arr[s.nextInt()-1]+=1;
           }
        }
        for(int i=0;i<n;i++){
            if(arr[i]==0)
                cnt+=1;
        }
        System.out.println(cnt);
    }

    private static boolean isPrime(int n) {
        if (n == 2)
            return true;
        else if ((n % 2 == 0 && n > 2) || n < 2)
            return false;
        else {
            for (int i = 3; i <= (int) Math.sqrt(n); i += 2) {
                if (n % i == 0)
                    return false;
            }
            return true;
        }


    }

    static class FastReader {
        BufferedReader br;
        StringTokenizer st;

        public FastReader() {
            br = new BufferedReader(new
                    InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

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

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

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }

}

Measured memory_bytes: 26936
#include <bits/stdc++.h>
using namespace std;
const int INF = 1 << 30;

int N;
int V[4];
int val[10];
int best = INF;
int l[10];

void solve(const int idx) {
   if (idx == N) {
      int curr = 0;
      bool flag = 1;
      for (int id = 1; id <= 3 && flag; id++) {
         int tot = 0, sum = 0;
         for (int i = 0; i < N; i++) {
            if (val[i] == id) {
               tot++;
               sum += l[i];
            }//if
         }//for
         if (!tot)
            flag = 0;
         curr += (tot - 1) * 10;
         curr += abs(V[id] - sum);
      }//for
      if (flag)
         best = min(best, curr);
      return;
   }//if
   for (int i = 0; i < 4; i++) {
      val[idx] = i;
      solve(idx + 1);
   }//for
}//solve

int main() {
   scanf("%d %d %d %d", &N, &V[1], &V[2], &V[3]);
   for (int i = 0; i < N; i++)
      scanf("%d", &l[i]);
   solve(0);
   printf("%d\n", best);
   return 0;
}//main


Measured memory_bytes: 256
package main

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

var sc *bufio.Scanner = func() *bufio.Scanner {
	sc := bufio.NewScanner(os.Stdin)
	sc.Split(bufio.ScanWords)
	return sc
}()

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

func eat(a, b, k int) (int, int) {
	if a > k {
		return a - k, b
	}
	k -= a
	if b > k {
		return 0, b - k
	}
	return 0, 0
}

func main() {
	a, b, k := nextInt(), nextInt(), nextInt()
	taka, ao := eat(a, b, k)
	fmt.Println(taka, ao)
}


Measured memory_bytes: 640
N, Y = map(int, input().split())

for ykt in range(0, N+1):
    for icy in range(0, N+1):
        hdy = N - ykt - icy
        if hdy < 0:
            continue
        if 10000 * ykt + 5000 * icy + 1000 * hdy == Y:
            print(str(ykt) + ' ' + str(icy) + ' ' + str(hdy))
            exit()

print('-1 -1 -1')

Measured memory_bytes: 66268
#include <stdio.h>

int main(void)
{
  int value,a,b,change;
  scanf("%d",&value);
  
  a = value / 1000;
  b = value % 1000;
  
  if(b == 0)
    change = a * 1000 - value;
  else
    change = (a+1) * 1000 - value;
  
  printf("%d\n",change);
  
  return 0;
}

Measured memory_bytes: 1700
// J'aime
// Chemise Blanche

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

#define int long long

#define ii pair<int,int>
#define fi first
#define sc second

#define all(x) (x).begin(),(x).end()
#define dbg(x) cerr << __LINE__ << " > " << #x << " = " << (x) << endl

void MAIN() {
  int a, b;
  cin >> a >> b;
  if (a % 3 == 0 || b % 3 == 0 || (a + b) % 3 == 0) {
    cout << "Possible" << '\n';
  } else {
    cout << "Impossible" << '\n';
  }
}

signed main() {
#ifdef _DEBUG
  // freopen("in" , "r", stdin );
  // freopen("out", "w", stdout);
#endif
  ios::sync_with_stdio(0); cin.tie(0);
  int T = 1;
  // cin >> T;
  while (T--) MAIN();
}


Measured memory_bytes: 3568
import sys
input = sys.stdin.readline
N,Q = map(int,input().split())
TUV = [tuple(map(int,input().split())) for i in range(Q)]

class UnionFind:
    def __init__(self,N):
        self.parent = [i for i in range(N)]
        self._size = [1] * N
        self.count = 0
    def root(self,a):
        if self.parent[a] == a:
            return a
        else:
            self.parent[a] = self.root(self.parent[a])
            return self.parent[a]
    def is_same(self,a,b):
        return self.root(a) == self.root(b)
    def unite(self,a,b):
        ra = self.root(a)
        rb = self.root(b)
        if ra == rb: return
        if self._size[ra] < self._size[rb]: ra,rb = rb,ra
        self._size[ra] += self._size[rb]
        self.parent[rb] = ra
        self.count += 1
    def size(self,a):
        return self._size[self.root(a)]

uf = UnionFind(N)
for t,u,v in TUV:
    u,v = u-1,v-1
    if t:
        print(int(uf.is_same(u,v)))
    else:
        uf.unite(u,v)

Measured memory_bytes: 40492
#include<stdio.h>
         
        int main(){
         
          int D,N;
          scanf("%d%d",&D,&N);
          if(N==100){
          N++;
}
          switch(D){
            case 0:
              printf("%d",N);
              break;
            case 1:
              printf("%d",N*100);
              break;
            case 2:
              printf("%d",N*10000);
          }
         
          return 0;
        }

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

using namespace std;

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

  long long n;
  cin >> n;
  long long ans = n + 2;
  for (int i = 1; 1ll * i * i <= n; ++i) {
    if (n % i) {
      continue;
    }
    ans = min(ans, i + n / i - 2);
  }
  cout << ans;

  return 0;
}

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

int main(){
  string S;
  cin >> S;
  int a = 0;
  for(int i = 2; i < S.size()-1; i++){
    if(S.at(i) == 'C'){
      a++;
    }
  }

  int b = 0;
  for(int i = 0; i < S.size(); i++){
    if(isupper(S.at(i))){
      b++;
    }
  }

  if(S.at(0) == 'A'  && a == 1 && b == 2){
    cout << "AC";
  }else{
    cout << "WA";
  }
  return 0;
}


Measured memory_bytes: 256
import javax.swing.plaf.basic.BasicInternalFrameTitlePane;
import  java.io.*;
import  java.math.*;
import java.nio.Buffer;
import java.sql.SQLSyntaxErrorException;
import  java.util.*;
import  java.text.*;
import java.util.stream.Collectors;


public class Main {

    public static int gcd(int n,int m){
        return (m==0)?n:gcd(m,n%m);
    }
    public static void main(String[] args) {
        Scanner cin = new Scanner(System.in);

        long n=cin.nextInt();
        long m=cin.nextInt();
        long k=cin.nextInt();
        if(k-n-m<0){
            System.out.println("No");
            return;
        }
        if(4*n*m<(k-n-m)*(k-n-m)){
            System.out.println("Yes");
        }
        else{
            System.out.println("No");
        }
    }

}



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

int main()
{
  cin >> noskipws;
  while(true)
  {
    int cards[21];
    int card_num;
    int ace_num = 0;   //  エースがあるかどうか
    for (card_num = 0; ; card_num++)
    {
      if ( card_num == 22 )
      {
        int dummy;
        char ws;
        bool b = true;
        while (b)
        {
          cin >> dummy >> ws;
          if ( ws != ' ' )
          {
            b = false;
          }
        }
        break;
      }
      cin >> cards[card_num];
      if ( cards[card_num] == 0 ) return 0;
      if ( cards[card_num] == 1 ) ace_num++;
      char ws;
      cin >> ws;
      if ( ws != ' ' )
      {
        card_num++;
        break;
      }
    }

    int point = 0;
    for (int i=0; i<card_num; i++)
    {
      if ( cards[i] < 10 )
      {
        point += cards[i];
      }
      else
      {
        point += 10;
      }
    }

    while ( ace_num > 0 && point <= 11 )
    {
      point += 10;
      ace_num--;
    }
    if ( point > 21 )
    {
      point = 0;
    }

    cout << point << endl;

  }
}

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

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

  string alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";

  for (int i = 0; i < S.size(); i++)
  {
    for (int j = 0; j < alphabet.size(); j++)
    {
      if (S.at(i) == alphabet.at(j))
      {
        int k = 1 << 29;

        while (k > alphabet.size())
        {
          k = j + N >= alphabet.size() ? j + N - alphabet.size() : j + N;
        }
        cout << alphabet.at(k);
      }
    }
  }
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define watch(x) cout << (#x) << " is " << (x) << endl
#define eps 1e-9

typedef long long ll;

using namespace std;

const ll inf = 1e18;
const ll mod = 1e9+7;
const int N = 1e5+5;
//int a[N];

int main()

{
    ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);

    int n, m, x;

    cin >> n;

    map <int, int> mp;

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

        cin >> x;

        mp[x]++;
    }

    cin >> m;

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

        cin >> x;

        if (mp[x]) mp[x]--;
        else {

            cout << "NO";
            return 0;
        }
    }

    cout << "YES";

    return 0;
}


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

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

using namespace std;

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

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

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

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

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

signed main()
{
	cin.tie(0);
	ios::sync_with_stdio(false);
	
	int A, B, C, D;
	cin >> A >> B >> C >> D;
	cout << max(A*B, C*D) << endl;

	return 0;
}

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

int n, lx, ly, lt;

int main(){
    int ok = 1;
    scanf(" %d", &n);
    while(n--){
        int t, x, y;
        scanf(" %d%d%d", &t, &x, &y);
        ok &= (((1&x)^(1&y)) == (1&t));
        ok &= (abs(lx - x) + abs(ly - y) <= t - lt);
        lx = x, ly = y, lt = t;
    }
    if(ok) puts("Yes");
    else puts("No");
}

Measured memory_bytes: 256
#include <cstdio>
#include <vector>
#include <algorithm>
#include <utility>
using namespace std;

typedef pair<int,int> pii;

int main(){
	int n, h, r;
	const int INF = 1 << 30;
	while(1){
		vector<pii> v;
		for(int i = 0; i < 2; ++i){
			if(scanf("%d", &n) == EOF){ return 0; }
			for(int j = 0; j < n; ++j){
				scanf("%d%d", &h, &r);
				v.push_back(pii(h, -r));
			}
		}
		sort(v.begin(), v.end());

		vector<int> dp(v.size() + 1, INF);
		for(int i = 0; i < v.size(); ++i){
			r = -v[i].second;
			*lower_bound(dp.begin(), dp.end(), r) = r;
		}
		printf("%d\n", lower_bound(dp.begin(), dp.end(), INF) - dp.begin());
	}
}

Measured memory_bytes: 1040
n = int(raw_input())
A = map(int,raw_input().split())
q = int(raw_input())
m = map(int,raw_input().split())
 
def solve(i,m):
    if m == 0:
        return 1
    if i >= n or m - sum(A) > 0:
        return 0
    res = solve(i+1,m) or solve(i+1,m-A[i])
    return res
 
for j in range(q):
    if solve(0,m[j]):
        print "yes"
    else:
        print "no"
 

Measured memory_bytes: 6448
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int INF=100100100;
const int MOD=(int)1e9+7;
#define ALL(a) a.begin(),a.end()
#define REP(i,n) for(int i=0; i<n; i++)
#define FOR(i,a,b) for(int i=a; i<b; i++)

int main(){
    string s;
    cin>>s;
    int n=s.size();
    vector<int>v(n);
    for(int i=0; i<n; i++){
        v[i]=s[i]-'0';
    }
    reverse(ALL(v));
    int k=1;
    vector<int>x(n+1,0);
    for(int i=0; i<n; i++){
        x.at(i+1)=(x.at(i)+v.at(i)*k)%2019;
        k*=10;
        k%=2019;
    }
    ll ans=0;
    vector<ll>c(2019,0);
    for(int i=0; i<n+1; i++){
        c.at(x.at(i))++;
    }
    for(int i=0; i<2019; i++){
        ans+=(c.at(i)*(c.at(i)-1))/2;
    }
    cout<<ans<<endl;
}
    

Measured memory_bytes: 5212
#include<iostream>
#include <string>
#include<algorithm>
#include <set>
#include <cmath>
using namespace std;
typedef long long lint;
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rep0(i,n) rep(i,0,n)

int main(void){
	ios::sync_with_stdio(false);
	string A, result;
	cin >> A;
	int i, j, k, Len;
	Len = A.length();
	j = 0;
	for (i = 0; i < Len; i++) {
		if (i % 2 == 0) {
			if (A[i] == 'L') j++;
		}
		else {
			if (A[i] == 'R') j++;
		}
	}
	if (j == 0) cout << "Yes";
	else cout << "No";
	
	return 0;
}

////sort Ｎ個の配列a
//sort(a, a + N); //昇順
//sort(a, a + N, greater<int>()); //降順
//
////最大公約数（ユークリッドの互除法利用）
//int gcd(int a, int b) {
//	if (a == 0) return b;
//	if (b == 0) return a;
//	int m = max(a, b);
//	int n = min(a, b);
//	if (m%n == 0) return n;
//	else return gcd(n, m%n);
//
//}
//
////最小公倍数
//int lca(int a, int b) {
//	if (a == 0) return 0;
//	if (b == 0) return 0;
//	return a * b / gcm(a, b);
//}
//
////n^k(整数)
//int pow_int(int n, int k) {
//	int re = 1;
//	for (int i = 0; i < k; i++) re *= n;
//	return re;
//}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <functional>
#include <vector>
#include <string>
#include <map>
#include <sstream>
#define ll long long
// #include <bits/stdc++.h>
#define req(i,h) for(int i = 0; i < h; i++)

using namespace std;


int main(void) {
    ll n, a;
    cin >> n;
    vector<ll> data(n + 1);
    data.at(0) = 2;
    data.at(1) = 1;
    for(int i = 2; i < n + 1; i++) {
       for(int j = i - 2; j < i; j++) {
           data.at(i) += data.at(j);
       }
    }
    if(n == 1) {
        cout << 1;
    } else {
        cout << data.at(n);
    }
    return 0;
}


Measured memory_bytes: 256
#include <algorithm>
#include <array>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>

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

constexpr double EPS = 1e-7;
constexpr int INF = 1e9;
constexpr ll LINF = 1e18;
#define PI (acos(-1))

constexpr int MOD = 1e9 + 7;

using Weight = ll;
struct Edge {
	int src, dst;
	Weight weight;
	Edge(int src, int dst, Weight weight) : src(src), dst(dst), weight(weight) {}
};
bool operator<(const Edge &e, const Edge &f) {
	return e.weight != f.weight ? e.weight > f.weight : // !!INVERSE!!
			   e.src != f.src ? e.src < f.src : e.dst < f.dst;
}
using Edges = vector<Edge>;
using Graph = vector<Edges>;

bool shortestPathBellmanFord(const Graph g, int s,
							 vector<Weight> &dist, vector<int> &prev) {
	int n = g.size();
	dist.assign(n, LINF + LINF);
	dist[s] = 0;
	prev.assign(n, -2);
	bool negative_cycle = false;
	for (int k = 0; k <= 2 * n; k++) {
		for (int i = 0; i < n; i++) {
			for (auto &&e : g[i]) {
				if (dist[e.dst] > dist[e.src] + e.weight) {
					dist[e.dst] = dist[e.src] + e.weight;
					prev[e.dst] = e.src;
					if (e.dst == n - 1 && k == 2 * n) {
						dist[e.dst] = -LINF;
						negative_cycle = true;
					}
				}
			}
		}
	}
	return !negative_cycle;
}

int main(int argc, char const *argv[]) {
	cin.tie(nullptr);
	ios::sync_with_stdio(false);
	cout << fixed << setprecision(15);

	int N, M;
	cin >> N >> M;

	Graph g(N);
	for (int i = 0; i < M; i++) {
		int a, b, c;
		cin >> a >> b >> c;
		g[a - 1].push_back(Edge(a - 1, b - 1, -c));
	}

	vector<Weight> dist;
	vector<int> prev;
	bool ans = shortestPathBellmanFord(g, 0, dist, prev);
	if (ans == false) {
		cout << "inf" << endl;
	} else {
		cout << -dist[N - 1] << endl;
	}

	return 0;
}


Measured memory_bytes: 384
#include <stdio.h>

int main(void)
{
    int sum[1024];
    int i, j;
    int n;

    for (i = 0; i <= 1000; i++) sum[i] = i * (i + 1) / 2;
    while (scanf("%d", &n), n){
        int cnt = 0;
        for (i = 1; i <= 1000; i++){
            for (j = 0; j <= i - 2; j++){
                if (sum[i] - sum[j] == n) cnt++;
            }
        }
        printf("%d\n", cnt);
    }

    return 0;
}

Measured memory_bytes: 604
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <iomanip>
using namespace std;
typedef long long unsigned int ll;

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))

#define DEBUG

#ifdef DEBUG
#define var_dump(...) fprintf(stdout, __VA_ARGS__)
#define dump(a) cout << a << "\n";
#else
#define var_dump(...) 42
#define dump(a) 42
#endif

typedef pair<int, int> P;
typedef pair<ll, ll> LP;
typedef pair<int, P> PP;
typedef pair<ll, LP> LPP;

int dy4[]={0, 0, 1, -1};
int dx4[]={1, -1, 0, 0};
int dx8[]={0, 0, 1, -1, 1, 1, -1, -1};
int dy8[]={1, -1, 0, 0, 1, -1, -1, 1};

// https://beta.atcoder.jp/contests/abc098/tasks/abc098_b

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

    int max = 0;
    for (int i = 1; i < S.length(); i++) {
        string front = S.substr(0, i);
        string back = S.substr(i, S.length()-i);

        set<char> sf;
        for (char t : front) {
            sf.insert(t);
        }

        set<char> bf;
        int cnt = 0;
        for (char t : back) {
            if (sf.count(t) && !bf.count(t)) {
                cnt++;
                bf.insert(t);
            }
        }

        max = std::max(max, cnt);
    }

    cout << max << "\n";

    return 0;
}


Measured memory_bytes: 256
#include <stdio.h>

int main() {
  int n;
  int m;
  scanf("%d",&n);
  m = n % 10;
  if (m==3) printf("bon");
  else if ((m==0)||(m==1)||(m==6)||(m==8)) {
    printf("pon");
  }
  else {
    printf("hon");
  }
}
  

Measured memory_bytes: 1724
#include<bits/stdc++.h>
using namespace std;
#define endl "\n"
#define fastio ios_base::sync_with_stdio(0);  cin.tie(0) ; cout.tie(0);
#define debug(x) cout << #x << " : " << x << endl;
#define pi 3.14159265359
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define F first
#define S second
using ll = long long int;
using db = double;
typedef pair<ll,ll> pll;
typedef pair<int,int> pii;
typedef vector<ll> vl;
typedef vector<int> vi;
typedef vector<bool> vb;
const int MOD = 1e9+9;

void solve()
{
    db d, t , s;
    cin >> d >> t >>s;
    if (d/s <= t)
        cout <<"Yes\n";
    else
        cout <<"No\n";
}

int main()
{
//  #ifndef ONLINE_JUDGE
//     freopen("input.txt", "r", stdin); 
//     freopen("output.txt", "w", stdout);
//  #endif
    fastio;

    ll t = 1;
    // cin >> t;
    while(t--)
       solve();
    return 0;
}

Measured memory_bytes: 3732
/*
,,,,
　　　　　　　　　　　　　　　　　　　　　　　　　　,.斗*''“i:i:{
　　　　　　　　　　　　　,.　｡. . . * : : : ''' : : : :” :”“ ''ｰ - 弋,,_
　　　　　 　 　 ,.斗*''“ : : : : : : : : : : : : : ' ' ' ' ' ' : : : : : : : : : : :”: '':* ｡ ,
　　　 ,.斗*''“ ” ＼：　　 ”・・． ' ' ' '　　　　　　　　 ' ' ' ' : : : : : : : : : : : : ”ミ*｡,,,,,,　　　　　　 　 　 　 ＿
　　く.　 ◎　 ﾞ:.ﾞ:..　ﾟ:,　:　───────────　　　--　　,,,,,,__ ' ' ' :.:.:.:.:.”≧s｡.　　＿,,,｡s*i:i:i:i:<
　　ﾏ*s｡ :,　 }　ﾟ:,　 :}　　　　　　　　　　　　　　　　　　　　　　　　　　　　”　''　-　”””：：”：：`*｡i:i:i:i:i:i:i;:’
　　　` .｡`　 ,　,ノ ／｡ ,,,_　　　　　　　　　　　　　　　　　　　　　　　　　　　　　＿＿`　　} }　　ﾉi:i:i:i:i:ﾂ
　　　　　 `　*　｡　　`*｡i:i:i::*=-　　　　　　　　　　　＿＿　　　　　　,,,....｡s*'i,:’　　　”`*｡＿,*’i:i:i:i:r’
　　　　　　　　　　　”　─ --　　　　｡｡｡｡｡　　 -　－`''''''''ヽ ─ '''”　　　｀ｰ“　　　　　　　`*｡i:i:i:i:i:i:
　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　`*｡i:i:::
　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　`*ﾟ:,
         fozubaoyou    no BUGs alive!
*/

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
#define mp make_pair
#define pb push_back
#define ppb pop_back
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define repp(i,a,b) for(int i=a;i<b;i++)
#define repm(i,a,b) for(int i=a;i>b;i--)


#define debug_interval ','
#define dump_interval ' '
#define debug_toggle 0

inline int toInt(string s){int v;istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x){ostringstream sout;sout<<x;return sout.str();}
template<class...A> inline void dump(){cout<<endl;}
template<class...A> inline void dump_rest() {cout<<endl;}
template<class T, class...A> inline void dump_rest(const T& first, const A&... rest){cout<<dump_interval<<first;dump_rest(rest...);}
template<class T,class...A> inline void dump(const T&first,const A&...rest){cout<<first;dump_rest(rest...);}
template<class...A> inline void debug(){cout<<endl;}
template<class...A> inline void debug_rest() {cout<<endl;}
template<class T, class...A> inline void debug_rest(const T& first, const A&... rest){cout<<debug_interval<<first;debug_rest(rest...);}
template<class T,class...A> inline void debug(const T&first,const A&...rest){if(debug_toggle)cout<<first,debug_rest(rest...);}

priority_queue <ll,vector<ll> > pq;
ll a,b,r,n,ans;

int main(){
    ios::sync_with_stdio(false);
    cin>>a>>b;
    dump(max(a+b,max(a*b,a-b)));
}

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

int cmp(const void *a,const void *b)
{
        return *(int*)a-*(int*)b;
}

int main(void)
{
   int n, k, p[1000], i, s=0;

   scanf("%d%d",&n,&k);
   for(i=0;i<n;i++)
      scanf("%d",&p[i]);

   qsort(p,n,sizeof(int),cmp);

   for(i=0;i<k;i++)
      s+=p[i];

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

Measured memory_bytes: 1732
#include<stdio.h>
int main()
{
    int n;
    scanf("%d",&n);
    if(n%1000==0)printf("0\n");
    else
    {
    	int x=n/1000+1;
    	x*=1000;
    	printf("%d\n",x-n);
	}
    return 0;
}

Measured memory_bytes: 1736
#include <bits/stdc++.h>
#define endl '\n'
 
using namespace std;
template<class T, class T2> inline void chkmax(T &x, const T2 &y) { if(x < y) x = y; }
template<class T, class T2> inline void chkmin(T &x, const T2 &y) { if(x > y) x = y; }
const int MAXN = (1 << 11);
 
int n, Z, W;
int a[MAXN];
vector<int> V;
 
void read()
{
	cin >> n >> Z >> W;
	for(int i = 1; i <= n; i++)
	{
		cin >> a[i];
		V.push_back(a[i]);
	}
 
	V.push_back(Z);
	V.push_back(W);
sort(V.begin(), V.end());
}
 
int dp[MAXN][MAXN][2];
 
int rec(int pos, int last, int pl)
{
	if(pos == n) return abs(a[pos] - last);
 
	int &memo = dp[pos][lower_bound(V.begin(), V.end(), last) - V.begin()][pl];
	if(memo != -1) return memo;
 
	memo = rec(pos + 1, a[pos], pl ^ 1);
 
	if(pl == 0)	chkmax(memo, rec(pos + 1, last, pl));
	else chkmin(memo, rec(pos + 1, last, pl));
 
	return memo;
}
 
void solve()
{
	a[0] = W;
	memset(dp, -1, sizeof(dp));
	cout << rec(1, W, 0) << endl;
}
 
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
 
	read();
	solve();
	return 0;
}

Measured memory_bytes: 33152
n = int(input())
sList = [0] * 13
hList = [0] * 13
cList = [0] * 13
dList = [0] * 13
for i in range(n):
    pat, num = input().split()
    num = int(num)
    if pat == 'S':
        sList[num - 1] = 1
    elif pat == 'H':
        hList[num - 1] = 1
    elif pat == 'C':
        cList[num - 1] = 1
    elif pat == 'D':
        dList[num - 1] = 1

for i in range(13):
    if sList[i] == 0:
        print("S %d" %(i+1))
for i in range(13):
    if hList[i] == 0:
        print("H %d" %(i+1))
for i in range(13):
    if cList[i] == 0:
        print("C %d" %(i+1))
for i in range(13):
    if dList[i] == 0:
        print("D %d" %(i+1))


Measured memory_bytes: 5604
#include<stdio.h>
#include<stdlib.h>

int main(void)
{
    int a,b,k;

    scanf("%d%d",&a,&b);
    k=(a+b)/2;
    if(abs(a-k)==abs(b-k))
      printf("%d\n",k);
    else
      printf("IMPOSSIBLE\n");

    return 0;
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
    using namespace std;
    #define tani_nachi_ke  ios_base::sync_with_stdio(false); cin.tie(NULL);
    #define M_PI 3.14159265358979323846
    int main()
    {
     // clock_t begin = clock();
     // #ifndef ONLINE_JUDGE
     // freopen("input.txt", "r", stdin);
     // freopen("output.txt", "w", stdout);
     // #endif
   tani_nachi_ke  
    
   int n;
   cin>>n;
   int arr[n+1][4];
   for(int i=1; i<=n; i++)cin>>arr[i][1]>>arr[i][2]>>arr[i][3];
   int dp[n+1][4];
   memset(dp,0,sizeof(dp));
   for(int i=1; i<=n; i++)
   {
      dp[i][1]=max(dp[i-1][2],dp[i-1][3])+arr[i][1];
      dp[i][2]=max(dp[i-1][1],dp[i-1][3])+arr[i][2];
      dp[i][3]=max(dp[i-1][1],dp[i-1][2])+arr[i][3];

   }
   cout<<max(dp[n][1],max(dp[n][2],dp[n][3]))<<endl;
    
  
    // #ifndef ONLINE_JUDGE 
    // clock_t end = clock();
    // cout<<endl<<double(end - begin) / CLOCKS_PER_SEC*1000<<" ms";
    // #endif 
    // return 0;
}






Measured memory_bytes: 3328
def prime_decomposition(a)
  division = 1
  primes = {}
  while a > 1
    division += 1
    next if a % division != 0

    while a % division == 0
      if primes[division.to_s]
      	primes[division.to_s] += 1
      else
        primes[division.to_s] = 1
      end
      a /= division
    end
  end
  primes
end

def get_lcm(a, b)
  a_prime = prime_decomposition(a)
  b_prime = prime_decomposition(b)
  lcm = 1

  [a_prime.keys, b_prime.keys].flatten.uniq.each do |key|
    if a_prime[key] && b_prime[key]
      lcm *= key.to_i ** [a_prime[key], b_prime[key]].max
    elsif a_prime[key]
      lcm *= key.to_i ** a_prime[key]
    else
      lcm *= key.to_i ** b_prime[key]
    end
  end
  lcm
end

a, b = gets.split("\s").map(&:to_i)
print get_lcm(a, b)
  

Measured memory_bytes: 1788
#include<stdio.h>

int sort(int x[],int l){
	int i,j,k;
	for(i=1;i<=l;i++){
		for(j=l;j>=i+1;j--){
			if(x[j-1]<x[j]){
				k=x[j];
				x[j]=x[j-1];
				x[j-1]=k;
			}
		}
	}
	return 0;
}

int main(void){
	char s[16];
	int n,k,d[32]={0},i,c=0,b=0,x;
	scanf("%d%d",&n,&k);
	for(i=1;i<=n;i++){
		scanf("%s",s);
		x=s[0]-64;
		d[x]++;
	}
	while(1){
		sort(d,26);
		for(i=1;i<=k;i++){
			if(d[i]){
				d[i]--;
			}
			else{
				b++;break;
			}
		}
		if(b){break;}
		c++;
	}
	printf("%d\n",c);
	return 0;
}

Measured memory_bytes: 128
#include<iostream>
#include<string>
#include<algorithm>
using namespace std;

int lcs(string str1, string str2)
{
	int len[1001][1001] = { 0 };

	int len1 = str1.size();
	int len2 = str2.size();
	str1 = ' ' + str1;
	str2 = ' ' + str2;

	for (int i = 0; i <= len1; i++)
		for (int j = 0; j <= len2; j++) len[i][j] = 0;

	for (int i = 1; i <= len1; i++)
	{
		for (int j = 1; j <= len2; j++)
		{
			if (str1[i] == str2[j]) len[i][j] = len[i - 1][j - 1] + 1;
			else len[i][j] = max(len[i - 1][j], len[i][j - 1]);
		}
	}
	return len[len1][len2];
}

int main()
{
	int n;
	string str1, str2;

	cin >> n;
	for (int i = 0; i < n; i++)
	{
		cin >> str1 >> str2;
		cout << lcs(str1, str2) << endl;
	}

	return 0;
}

Measured memory_bytes: 7120
#include <bits/stdc++.h>
#define SORT(a) sort(a.begin(), a.end())
#define RSORT(a) sort(a.rbegin(), a.rend())
#define REP(i, n) for (int i = 0; i < n; i++)
#define RREP(i, n) for (int i = n; 0 <= i; i--)
#define FOR(i, start, end) for (int i = start; i < end; i++)
#define RFOR(i, start, end) for (int i = start; end <= i; i--)
#define ALL(a) a.begin(), a.end()
#define MOD(a) a %= 1'000'000'007
#define INF32 1'050'000'000
#define INF64 4'000'000'000'000'000'000
using ll = long long;
using namespace std;
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;
}

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

    int H, W;
    cin >> H >> W;
    vector<string> s(H);
    for (auto &&i : s) {
        cin >> i;
    }

    vector<int> dx = {-1, 1, 0, 0};
    vector<int> dy = {0, 0, -1, 1};
    auto exist     = [](int H, int W, int nx, int ny) -> bool {
        if (nx < 0 || W <= nx || ny < 0 || H <= ny)
            return false;
        else
            return true;
    };

    REP(y, H) {
        REP(x, W) {
            if (s[y][x] == '#') {
                bool f = true;
                REP(i, 4) {
                    int nx = x + dx[i];
                    int ny = y + dy[i];
                    if (exist(H, W, nx, ny) && s[ny][nx] == '#') {
                        f = false;
                    }
                }
                if (f) {
                    std::cout << "No" << '\n';
                    return 0;
                }
            }
        }
    }
    std::cout << "Yes" << '\n';

    return 0;
}

Measured memory_bytes: 256
// Author: Vamsi Krishna Reddy Satti
// With love for Competitive Programming!
 
#pragma GCC optimize ("Ofast,unroll-loops,-ffloat-store")
#pragma GCC target ("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,fma")

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

string to_string(const string& s) { return '"' + s + '"'; }
void debug_out() { cout << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
    cout << " " << to_string(H);
    debug_out(T...);
}
#ifdef LOCAL
    #define debug(...) cout << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#else
    #define debug(...) 3
#endif
 
#define cin_exception cin.exceptions(cin.failbit);
#define cout_precision cout.setf(ios::fixed); cout.precision(15);
#define fast_io ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
using ll = int_fast64_t; using ld = long double;

// -----------------------------------------------------------------------------

void solve() {
    ld a, b;
    cin >> a >> b;
    int l = ceil(max(10 * b, 25 * a / 2));
    ++a; ++b;
    int r = ceil(min(10 * b, 25 * a / 2)) - 1;
    if (l > r || r < 1) cout << -1 << '\n';
    else cout << max(l, 1) << '\n';
}

int main() {
    fast_io; cin_exception;
    int t = 1;
    // cin >> t;
    for (int i = 0; i < t; ++i) {
        solve();
    }
}


Measured memory_bytes: 256
import java.util.*;
public class Main {
        public static void main(String[] args){
                Scanner sc = new Scanner(System.in);
                int n = sc.nextInt();
                int w = sc.nextInt();
                int[][] v = new int[2][n];
                for(int i = 0 ; i < n ; i++){
                        for(int j = 0 ; j < 2 ; j++){
                                v[j][i] = sc.nextInt();
                        }
                }
                sc.close();
                long[][] dp = new long[n + 1][w + 1];
                Arrays.fill(dp[0] , 0);
                for(int i = 0 ; i < n ; i++){
                        for(int j = 0 ; j <= w ; j++){
                                if(j >= v[0][i]) dp[i + 1][j] = Math.max(dp[i][j - v[0][i]] + v[1][i] , dp[i][j]);
                                else dp[i + 1][j] = dp[i][j];
                        }
                }
                System.out.println(dp[n][w]);
        }
}

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

int main() {
	long long int n,a[100002],i,j,k,ans,x,y,z,mi=1e10;
	cin>>n;
	for(i=0;i<n;i++)
	{
	    cin>>a[i];
	    mi=min(mi,a[i]);
	}
	if(mi==1)
	cout<<1;
	else
	{
	    vector<long long int>v;
	    for(i=0;i<n;i++)v.push_back(a[i]);
	    mi=1e10;
	    for(j=1;j<=50;j++)
	    {
	        if(v.size()==1 || mi==1)
	        {
	            if(v.size()==1)
	            cout<<v[0];
	            else
	            cout<<1;
	            break;
	        }
	        mi=1e10;
	        long long int in;
	        for(i=0;i<v.size();i++)
	        {
	            if(mi>v[i])
	            {
	                mi=v[i];
	                in=i;
	            }
	        }
	        vector<long long int >v1;
	        for(i=0;i<v.size();i++)
	        {
	            if(v[i]%mi!=0 && i!=in)
	            v1.push_back(v[i]%mi);
	            if(i==in)
	            v1.push_back(v[i]);
	        }
	        v=v1;
	    }
	}
}


Measured memory_bytes: 3316
#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;
const int inf = 1001001001;

int main() {
	int h, n;
	cin >> h >> n;
	vector<int> dp(h + 1, inf);
	dp[0] = 0;
	rep(i, n) {
		int a, b; cin >> a >> b;
		rep(j, h) {
			int nj = min(j + a, h);
			dp[nj] = min(dp[nj], dp[j] + b);
		}
	}
	cout << dp[h] << endl;
	return 0;
}


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

#define int long long
#define endl "\n"
#define REP(i,a,n) for(int i=a;i<n;++i)
#define REPR(i,a,n) for(int i=a;i>n;--i)
#define RUP(a,b) ((a+b-1)/(b))
#define ALL(v) (v).begin(),(v).end()
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define MOD 1000000007
#define INF LLONG_MAX/2

typedef long long ll;
typedef pair<int,int> Pii;
typedef tuple<int,int,int> Tiii;
typedef vector<int> Vi;
typedef vector<Vi> VVi;
typedef vector<Pii> VPii;
typedef vector<string> Vs;

template<class T> inline bool chmax(T& a,T b){if(a<b){a=b;return 1;}return 0;}
template<class T> inline bool chmin(T& a,T b){if(a>b){a=b;return 1;}return 0;}
template<class T> void YesNo(T a) {cout<<(a?"Yes":"No")<<endl;}
template<class T> void YESNO(T a) {cout<<(a?"YES":"NO")<<endl;}
int gcd(int a,int b){return b?gcd(b,a%b):a;}
int lcm(int a,int b){return a/gcd(a,b)*b;}
void uniq(Vi &v){sort(v.begin(),v.end()); v.erase(unique(v.begin(),v.end()),v.end());}
bool comp(Pii a,Pii b){
    if(a.second != b.second) return a.second<b.second;
    else return a.first<b.first;
}

void solve(long long N, long long K, std::vector<long long> h){
    int ans=0;
    REP(i,0,N) if(h[i]>=K) ans++;
    cout<<ans<<endl;
}

// Generated by 1.1.5 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
signed main(){
    long long N;
    scanf("%lld",&N);
    long long K;
    scanf("%lld",&K);
    std::vector<long long> h(N);
    for(int i = 0 ; i < N ; i++){
        scanf("%lld",&h[i]);
    }
    solve(N, K, std::move(h));
    return 0;
}


Measured memory_bytes: 1024
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define endl "\n"
#define pb push_back
#define fi first`
#define se second
const int N=1e5+500;
void solve()
{
	ll n,a,b;
	cin>>n>>a>>b;
	cout<<(n/(a+b)*a)+min(n%(a+b),a);

}

int main()
{


    // ios_base::sync_with_stdio(false);
    // cin.tie(NULL);
    int t = 1;
    // cin >> t;
    while(t--)
    {
        solve();
        // cout << endl;
    }

}




Measured memory_bytes: 256
/*
 *  AUTHOR : MANAV PATEl
*/
#include<bits/stdc++.h>
#include<functional>
//#include<boost/multiprecision/cpp_int.hpp>
//using namespace boost::multiprecision;
using namespace std;

namespace fastio
{

	template <class T> istream &operator>>(istream &os, vector<T> & vec)
	{
		for (auto &u : vec)os >> u;
		return os;
	}
	template <class T> ostream &operator<<(ostream &os, const vector<T> & vec)
	{
		for (auto &u : vec)os << u << " ";
		return os;
	}
	template<class T1, class T2> inline istream& operator>>(istream& os, pair<T1, T2>& p)
	{
		return os >> p.first >> p.second;
	}
	template<class T1, class T2> ostream& operator<<(ostream& os, const pair<T1, T2>& p)
	{
		return os << p.first << " " << p.second;
	}
	template <class T> ostream &operator<<(ostream &os, set<T> & con)
	{
		for (auto &u : con) os << u << " ";
		return os;
	}
	void re() {}
	template <typename T, typename... args> void re(T& x, args&... tail)
	{
		cin >> x;
		re(tail...);
	}
	void pr() {}
	template <typename T> void pr(const T& x)
	{
		cout << x;
	}
	template <typename T, typename... args> void pr(const T& x, const args&... tail)
	{
		cout << x << " ";
		pr(tail...);
	}
	template <typename... args> void prln(const args&... tail)
	{
		pr(tail...);
		cout << "\n";
	}
}
using namespace fastio;

typedef long long int ll;
typedef long double ld;

ll p = 1e9+7;
const ll mod1 = 998244353;

#define fill(a)  memset(a, 0, sizeof(a))
#define fst first
#define snd second
#define mp make_pair
#define pb push_back

ll power(ll x, ll y)
{
	ll res = 1;
	while (y > 0)
	{
		if (y & 1ll)
			res = (res*x) % p;
		y = y>>1ll;
		x = (x*x) % p;
	}
	return res % p;
}

ll modpow(ll a, ll p, ll mod)
{
	if (p == 0)
		return 1;

	if (p % 2 == 0)
	{
		ll half = modpow(a, p / 2, mod) % mod;
		return half * half % mod;
	}
	else
	{
		return a * modpow(a, p - 1, mod) % mod;
	}
}

// nCa ????
ll modCombination(ll n, ll a, ll mod)
{
	if (n - a < a)
	{
		return modCombination(n, n - a, mod);
	}

	ll denominator = 1; // ??
	ll numerator = 1;   // ??

	for (ll i = 0; i < a; i++)
	{
		denominator *= a - i;
		numerator *= n - i;
		denominator %= mod;
		numerator %= mod;
	}

	return numerator * modpow(denominator, mod - 2, mod) % mod;
}

int main()
{

	ll x, y;
	re(x,y);
	if((x+y) % 3 == 0)
	{
		ll n=(2*x-y)/3;
		ll m=x-2*n;
		if(n<0||m<0)
		{
			cout<<0<<endl;
			return 0;
		}
		cout << modCombination(m+n,n,p);
	}
	else
	{
		prln(0);
	}
}


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

int main(){
    int x;
    cin>>x;
    switch(x%7){
        case 0:
            cout<<"thu"<<endl;
            break;
        case 1:
            cout<<"fri"<<endl;
            break;
        case 2:
            cout<<"sat"<<endl;
            break;
        case 3:
            cout<<"sun"<<endl;
            break;
        case 4:
            cout<<"mon"<<endl;
            break;
        case 5:
            cout<<"tue"<<endl;
            break;
        case 6:
            cout<<"wed"<<endl;
            break;
    }

    return 0;
}


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

typedef long long ll;

int main() {
  ll n;
  cin >> n;
  ll ans = 1000000000000000000LL;
  for(ll i = 1; i*i <= n; i++) {
    if(n%i==0) {
      ans = min(ans, i+n/i-2);
    }
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <math.h>
using namespace std;

int main(){

    int a, b;
    cin>>a>>b;
    if(a%3==0 || b%3==0 || (a+b)%3 ==0){
        cout<<"Possible"<<endl;
    }
    else{
        cout<<"Impossible"<<endl;
    }
    return 0;
}


Measured memory_bytes: 256
#include <algorithm>
#include <cmath>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>

typedef long long ll;

using namespace std;

int main() {
    int n;
    cin >> n;
    int rem = n % 10;
    if (rem == 2 || rem == 4 || rem == 5 || rem == 7 || rem == 9) {
        cout << "hon"
             << "\n";
        return 0;
    }
    if (rem == 0 || rem == 1 || rem == 6 || rem == 8) {
        cout << "pon"
             << "\n";
        return 0;
    }
    if (rem == 3) {
        cout << "bon"
             << "\n";
    }
    return 0;
}

Measured memory_bytes: 3624
#include <bits/stdc++.h>
#define Int int64_t

using namespace std;

int main() {
	Int N, M, K;
	cin >> N >> M >> K;
	vector<Int> a(N), b(M);
	for (int i = 0; i < N; ++i) { cin >> a[i]; }
	for (int i = 0; i < M; ++i) { cin >> b[i]; }

	vector<Int> da(N + 1, 0), db(M + 1, 0);
	for (int i = 0; i < N; ++i) { da[i + 1] += da[i] + a[i]; }
	for (int i = 0; i < M; ++i) { db[i + 1] += db[i] + b[i]; }

	int ans = 0;
	for (int i = 0; i <= N; ++i) {
		if (K < da[i]) { continue; }
		Int k = K - da[i];
		int idx = upper_bound(db.begin(), db.end(), k) - db.begin();
		ans = max(ans, i + (idx - 1));
	}
	cout << ans << endl;

	return 0;
}


Measured memory_bytes: 9592