akhauriyash/Code-Regression huggingface dataset:
#include<stdio.h>
long long int n, c, d[100],f[60][2600];
int main(){
	scanf("%lld %lld",&n,&c);
	for(int i=0;i<n;i++) scanf("%lld",d+i);
	f[0][n*c]=1;
	for(int i=0;i<n;i++){
		for(int j=0;j<2510;j++){
			f[i+1][j]=f[i][j+c]+f[i][j+d[i]];
		}
	}
	printf("%lld",f[n][0]-1);
}


Measured memory_bytes: 1152
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>

using namespace std;

int a, b, c;

int main()
{
    cin >> a >> b>>c;
    if(a >= b && a >= c)
        cout << b + c;
    else if(b >= a && b >= c)
        cout << a + c;
    else
        cout << a + b;
    
    return 0;
}


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

using namespace std;
using lli = int_fast64_t;
using ulli = uint_fast64_t;
#define debug(x) cerr << #x << " : " << x << endl
#define debugv(x) cerr << #x << " : {";for(auto value_of_x:x){ cerr << value_of_x << ", ";}cerr << endl
#define debugst(x) auto xt = x;cerr << #x << " : {";for(int i=0;i<x.size();i++){ cerr << xt.top() << ", ";xt.pop();}cerr << endl
#define debugvp(x) cerr << #x << " : {";for(auto value_of_x:x){ cerr << value_of_x.first << " : " << value_of_x.second << ", ";}cerr << endl
#define HYPP(x) hypot(x.first,x.second)

const lli MOD = 1000000007;
const lli LIMIT = 1000000000000000000 * 5;
const int tenfive = 100000;



int main() {
	int W, H, N;
	cin >> W >> H >> N;
	vector<vector<bool>> grid(H, vector<bool>(W,true));
	for (int i = 0; i < N; i++) {
		int x, y, a;
		cin >> x >> y >> a;
		switch (a)
		{
		case 1:
			for (int i = 0; i < H; i++) {
				for (int j = 0; j < x; j++) {
					grid[i][j] = false;
				}
			}
			break;
		case 2:
			for (int i = 0; i < H; i++) {
				for (int j = x; j < W; j++) {
					grid[i][j] = false;
				}
			}
			break;
		case 3:
			for (int i = 0; i < y; i++) {
				for (int j = 0; j < W; j++) {
					grid[i][j] = false;
				}
			}
			break;
		case 4:
			for (int i = y; i < H; i++) {
				for (int j = 0; j < W; j++) {
					grid[i][j] = false;
				}
			}
			break;
		}
	}
	int ans = 0;
	for (int i = 0; i < H; i++) {
		for (int j = 0; j < W; j++) {
			if (grid[i][j])ans++;
		}
	}

	cout << ans << endl;
	return 0;
}


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

int main(){
  int n,k;
  cin >>n>>k;
  int num[n]={0};
  for (int i=0;i<k;i++){
    int a;
    cin >>a;
    for (int j=0;j<a;j++){
      int b=0;
      cin >>b;
      for(int m=0;m<n;m++){
        if(b==m+1) ++num[m];
      }
    }
  }
  int p=0;
  for(int i=0;i<n;i++){
    if(num[i]==0) p++;
  }
  cout << p<<endl;
}

Measured memory_bytes: 3624
#include <bits/stdc++.h>
using namespace std;
int main(void){
    // Your code here!
    long long int n,b,c=0;
    cin>>n;
    b=n*3;
    long long int a[b+5];
    for(int j=0;j<b;j++){
       cin>>a[j];
    }
    sort(a,a+b);
    for(int i=1;i<=n;i++){
        c+=a[b-i*2];
    }
    cout<<c<<endl;
    return 0;
}


Measured memory_bytes: 2560
#include<bits/stdc++.h>
#define F first
#define S second
#define endl '\n'
#define lcm( a, b ) ((a)/__gcd(a,b)*(b))
#define MP make_pair
#define pb push_back
#define all(x) (x).begin(),(x).end()

using namespace std;

typedef long long LL;
typedef pair<int, int> P;
typedef pair<int, P> i_P;
typedef pair< LL, LL > L_P;

const int INF = INT_MAX;
const int MIN = INT_MIN;
const LL LINF = LLONG_MAX;
const int MOD = 1000000000 + 7;
const int SIZE = 100005;

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

    while( true ) {
        string nu;
        int n;
        cin >> nu;
        if( nu == "0000" ) break;
        int res = 0;

        bool flg = true;
        int cnt[10] = {};

        int dig = 1;
        n = 0;
        for( int i = 3; i >= 0; --i ) {
            n += ( nu[i] - '0' ) * dig;
            dig *= 10;
        }

        int t = n;
        while( t > 0 ) {
            ++cnt[t % 10];
            t /= 10;

        }
        for( int i = 0; i < 10; ++i ) {
            if( cnt[i] == 4 ) {
                  flg = false;
                  break;

            }
        }

        if( !flg ) {
            cout << "NA" << endl;
            continue;

        }


        while( n != 6174 ) {
            int l = 0, s = 0;
            vector< int > tmp;
            /*while( n > 0 ) {
                tmp.pb( n % 10 );
                n /= 10;

            }*/

            tmp.pb( n % 10 ); n /= 10;
            tmp.pb( n % 10 ); n /= 10;
            tmp.pb( n % 10 ); n /= 10;
            tmp.pb( n % 10 ); n /= 10;
            sort( tmp.begin(), tmp.end() );
            int dig = 1;
            int pos = 0;
            while( pos < tmp.size() ) {
               s += tmp[pos] * dig;
               dig *= 10;
               ++pos;

            }
            pos = tmp.size() - 1;
            dig = 1;
            while( pos >= 0 ) {
                l += tmp[pos] * dig;
                dig *= 10;
                --pos;

            }
            n = s - l;
            ++res;

        }
        cout << res << endl;

    }
    return 0;
}




Measured memory_bytes: 3168
def get_i() #空白区切の入力を数値(整数)の配列で返す
  return gets.chomp.split(" ").map(&:to_i)
end
def get_f() #空白区切の入力を数値(実数)の配列で返す
  return gets.chomp.split(" ").map(&:to_f)
end
def get() #空白区切の入力を文字列の配列で返す
  return gets.chomp.split(" ")
end
def get_nsp() #入力されたものを一文字ずつに区切った文字列の配列で返す
  return gets.chomp.split("")
end
def yn_judge(bool,y="Yes",n="No") #boolに真偽を投げることで、trueならy、falseならnの値を出力する
  return bool ? y : n 
end
def array(size,n=1,init=nil) #nに配列の次元数、sizeに配列の大きさ、initに初期値を投げることでその配列を返す
  if n==1
    return Array.new(size){init}
  else
    return Array.new(n).map{Array.new(size){init}}
  end
end

n,m=get_i
ab=array(n,1)
n.times do|i|
  ab[i]=get_i
end
ab.sort!{|x,y| x[0]<=>y[0]}
ans=0
i=0
while m>0
  if m-ab[i][1]>0
    m-=ab[i][1]
    ans+=ab[i][0]*ab[i][1]
  else
    ans+=ab[i][0]*m
    break
  end
  i+=1
end
puts ans

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

int main() {
  int i, H, W;
  cin >> H >> W;
  string TU;
  string X = "#";
  vector<string> S(H);
  for(i = 0; i < W+2; i++){
    TU += X;
  }
  cout << TU << endl;
  
  for(i = 0; i < H; i++){
    cin >> S.at(i);
  }
  for(i = 0; i < H; i++){
    cout << X + S.at(i) + X << endl;
  }
  
  cout << TU << endl;
}

Measured memory_bytes: 256
#include <algorithm>
#include <bits/stdc++.h>
#include <cstdint>
#include <iostream>
#include <iterator>
#include <vector>

// lib/util.hpp
#ifndef UTIL_HPP
#define UTIL_HPP


typedef ::std::int_fast64_t i64;
typedef ::std::uint_fast64_t u64;
typedef ::std::int_fast32_t i32;
typedef ::std::uint_fast32_t u32;

namespace tools {
  template <typename T>
  void read(::std::istream& is, ::std::vector<T>& vector, const typename ::std::vector<T>::size_type size) {
    vector.reserve(size);
    ::std::copy_n(::std::istream_iterator<T>(is), size, ::std::back_inserter(vector));
  }
  template <typename T>
  void read(::std::vector<T>& vector, const typename ::std::vector<T>::size_type size) {
    ::tools::read(::std::cin, vector, size);
  }

  template <typename T, ::std::size_t N>
  void read(::std::istream& is, ::std::array<T, N>& array) {
    ::std::copy_n(std::istream_iterator<T>(is), N, array.begin());
  }
  template <typename T, ::std::size_t N>
  void read(::std::array<T, N>& array) {
    ::tools::read(::std::cin, array);
  }
}

#endif

// main.cpp

int main() {
  i64 N, K;
  std::cin >> N >> K;
  std::vector<i64> A(N), B(N);
  for (i64 i = 0; i < N; ++i) {
    std::cin >> A[i] >> B[i];
  }

  std::unordered_set<i64> options;
  for (i64 i = 0; i < N; ++i) {
    options.insert(i);
  }
  i64 answer = 0;

  for (i64 i = 29; i >= 0; --i) {
    if (((K >> i) & 1) == 0) {
      auto it = options.begin();
      while (it != options.end()) {
        if (((A[*it] >> i) & 1) == 0) {
          ++it;
        } else {
          it = options.erase(it);
        }
      }
    } else {
      i64 possible_answer = 0;
      for (const i64& option : options) {
        if (((A[option] >> i) & 1) == 0) {
          possible_answer += B[option];
        }
      }
      answer = std::max(answer, possible_answer);
    }
  }
  answer = std::max(answer, std::accumulate(options.begin(), options.end(), static_cast<i64>(0), [&](const i64& sum, const i64& option) { return sum + B[option]; }));

  std::cout << answer << std::endl;
  return 0;
}

Measured memory_bytes: 5924
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i=0; i<(int)(n); i++)
#define FOR(i, r, n) for (int i=(int)(r); i<=(int)(n); i++)
#define all(v) v.begin(), v.end()
#define INF 2147483647
#define INF64 9223372036854775807
#define MOD 1000000007

int main(){

    string a, b;cin>>a>>b;
    int ans=0;
    rep(i, a.size()){
        if(a[i]!=b[i]) ans++;
    }
    cout<<ans<<endl;

}

Measured memory_bytes: 3844
import bisect
N, K = map(int, input().split())
x = list(map(int, input().split()))
t = 2 * (x[-1] - x[0])
i = bisect.bisect_right(x, 0)
for j in range(0, N):
    if N <= j + K -1 :
        break
    if (j - (i - 0.1)) * (j + K- 1 - (i - 0.1)) >= 0:
        t = min(t, max(abs(x[j]), abs(x[j+K-1])))
    else:
        t = min(t, abs(2 * x[j]) + x[j+K-1])
        t = min(t, abs(x[j]) + 2 * x[j+K-1])
print(t)

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

int main(){
  int n;
  cin >> n;
  vector<int> a(n);
  rep(i,n){
   cin >> a[i]; 
  }
  sort(a.begin(),a.end());
  int counts =0;
  rep(i,n-1){
   if(a[i]==a[i+1]) counts++; 
  }
  if(counts == 0) cout << "YES" << endl;
  else cout << "NO" << endl;
}


Measured memory_bytes: 3952
data class Bingo (
    val value:Int,
    var isOn:Boolean
)
fun main (args:Array<String>) {
    var bingoList :MutableList<Bingo> = arrayListOf()
    readLine()!!.split(" ").map(String::toInt).forEach{

        bingoList.add(Bingo(it,false))
    }
    readLine()!!.split(" ").map(String::toInt).forEach{

        bingoList.add(Bingo(it,false))
    }
    readLine()!!.split(" ").map(String::toInt).forEach{

        bingoList.add(Bingo(it,false))
    }
//    val list1 = readLine()!!.split(" ").map(String::toInt)
//    val list2 = readLine()!!.split(" ").map(String::toInt)
//    val list3 = readLine()!!.split(" ").map(String::toInt)
    val num = readLine()!!.toInt()

    for (i in 1..num){

        val b = readLine()!!.toInt()
        bingoList.forEach{
            if(it.value == b){
                it.isOn = true
            }
        }
    }
    for(i in 0..6 step 3){
        if(bingoList[i].isOn == true && bingoList[i+1].isOn == true && bingoList[i+2].isOn == true){
            print("Yes")
            return
        }

    }
    for(i in 0..2){
        if(bingoList[i].isOn == true && bingoList[i+3].isOn == true && bingoList[i+6].isOn == true){
            print("Yes")
            return
        }

    }
    for(i in 0..2){
        if(bingoList[i].isOn == true && bingoList[i+3].isOn == true && bingoList[i+6].isOn == true){
            print("Yes")
            return
        }

    }
    if(bingoList[0].isOn == true && bingoList[4].isOn == true && bingoList[8].isOn == true){
        print("Yes")
        return
    }
    if(bingoList[2].isOn == true && bingoList[4].isOn == true && bingoList[6].isOn == true){
        print("Yes")
        return
    }
    print("No")

}

Measured memory_bytes: 36788
//JOI??¬?????????????????????

#include<iostream>
#include<algorithm>
using namespace std;

long long JOI_honsen_Gannbarimasu(long long a, long long b, long long &x, long long &y) {
	long long d;
	if (b == 0) {
		d = a;
		x = 1; y = 0;
	}
	else {
		d = JOI_honsen_Gannbarimasu(b, a%b, y, x);
		y -= a / b*x;
	}
	return d;
}

int main() {
	long long a, b, x, y;
	cin >> a >> b;
	JOI_honsen_Gannbarimasu(a, b, x, y);
	cout << x << ' ' << y << endl;
	return 0;
}

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

int main(){

  string s, p;
  int counter;
  bool result=false;

  getline(cin, s);
  getline(cin, p);

  s+=s;

  for(int i=0; i<s.length(); i++){
    if(s[i]==p[0]){// pの最初の文字があったら、２文字目以降が同じかチェックする.
      for(int j=0; j<p.length(); j++){
        if(s[i+j]!=p[j])break;
        if(j==p.length()-1)result=true;
      }
    }
  }
  if(result)cout << "Yes" << endl;
  else cout << "No" << endl;
}


Measured memory_bytes: 3220
#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <algorithm>
#include <cctype>
#include <cmath>
#include <queue>
#include <map>
#include <numeric>
#include <unordered_map>
#include <iomanip>
#include <functional>
#include <bitset>
#include <complex>

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define repi(i,a,b) for(int i=int(a);i<int(b);i++)
#define all(x) (x).begin(),(x).end()

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

typedef long long ll;

using namespace std;

int prime[]={2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97};
int main()
{
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin>>n;

  map<int,int>ma;
  rep(i,25)
  {
    int tn=n;
    while(tn!=0)
    {
      tn/=prime[i];
      ma[prime[i]]+=tn;
    }

  }
  int cnt5=0,cnt3=0,cnt25=0,cnt15=0,cnt75=0;

  for(auto t:ma)
  {
    if(t.second>=4)cnt5++;
    if(t.second>=2)cnt3++;
    if(t.second>=24)cnt25++;
    if(t.second>=14)cnt15++;
    if(t.second>=74)cnt75++;

  }
  //cout<<cnt3<<" "<<cnt5<<" "<<cnt15<<" "<<cnt25<<" "<<cnt75<<endl;
  cout<<cnt5*(cnt5-1)/2*(cnt3-2)+cnt25*(cnt3-1)+cnt15*(cnt5-1)+cnt75<<endl;


  return 0;

}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <cstdio>
#include <cmath>
#include <tuple>
#include <iomanip>
#include <numeric>
#include <unordered_map>
#include <sstream>
#include<limits.h>
#include<float.h>
#include<list>
#include <array>
#include <complex>
#include<stdio.h>
#include<string.h>
#include <bitset>
// #include<assert.h>
#include<random>
using namespace std;
#define int long long

#define I32_MAX 2147483647
#define I64_MAX 9223372036854775807LL
#define I64_MAX2 1223372036854775807LL
#define INF I64_MAX2
#define MOD 1000000007
// #define MOD 998244353 
#define MEM_SIZE 10000
#define DEBUG_OUT true
#define ALL(x) (x).begin(), (x).end()

template<typename T> void DEBUG(T e){if(DEBUG_OUT == false)return; std::cout << e <<" ";}
template<typename T> void DEBUG(const std::vector<T>& v){if(DEBUG_OUT == false)return;for(const auto& e : v){std::cout<< e << " "; } std::cout << std::endl;}
template<typename T> void DEBUG(const std::vector<std::vector<T> >& vv){if(DEBUG_OUT == false)return;for(const auto& v : vv){ DEBUG(v); } }
template<class T,class... Ts> void DEBUG(T d, Ts... e){if(DEBUG_OUT == false)return;DEBUG(d);DEBUG(e...);}
template <class T> void corner(bool flg, T hoge) {if (flg) {cout << hoge << endl; abort();}}
template< typename T1, typename T2 > inline bool chmax(T1 &a, T2 b) { return a < b && (a = b, true); }
template< typename T1, typename T2 > inline bool chmin(T1 &a, T2 b) { return a > b && (a = b, true); }


//BELOW

void solve(void)
{ 
  int N,M,D;
  cin>>N>>M>>D;
  double res = 0;
  int P = (N)*N;
  int C = (N-D)*2;
  res = double(C)/double(P)*double(M-1);
  if(D == 0)res /= 2;
  cout<<res<<endl;
  return;
}
int32_t main(int32_t argc, const char *argv[])
{
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);

  std::cout << std::fixed;
  std::cout << std::setprecision(11);
  solve();

  return 0;
}


Measured memory_bytes: 3788
#include <bits/stdc++.h>
using namespace std;
#define sz(x) ((int) (x).size())
#define forn(i,n) for (int i = 0; i < int(n); ++i)
typedef long long ll;
typedef long long i64;
typedef long double ld;
const int inf = int(1e9) + int(1e5);
const ll infl = ll(2e18) + ll(1e10);

const int maxn = 3005;
int a[maxn];
vector<int> g[maxn];

bool win(int u) {
    for (int v: g[u]) {
        if (a[v] >= a[u])
            continue;
        if (!win(v))
            return true;
    }
    return false;
}

int main() {
    #ifdef LOCAL
    assert(freopen("f.in", "r", stdin));
    #else
    #endif
    int n;
    cin >> n;
    forn (i, n)
        cin >> a[i];
    forn (i, n - 1) {
        int u, v;
        cin >> u >> v;
        --u, --v;
        g[u].push_back(v);
        g[v].push_back(u);
    }
    forn (i, n) {
        if (win(i))
            cout << i + 1 << ' ';
    }
    cout << '\n';
}


Measured memory_bytes: 512
import java.util.*;
public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int K = sc.nextInt();
		long count = 0;
		Integer[] enemy = new Integer[N];
		for (int i = 0; i < N; i++) {
			enemy[i]= sc.nextInt();
		}
		Arrays.sort(enemy, Collections.reverseOrder());
		for (int i = K; i < N; i++) {
			count += enemy[i];
		}
		System.out.println(count);
	}
}

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

int main(){
    int a, b, x;
    cin >> a >> b >> x;
    long double pi = M_PI;
    long double c = 180.0;
    long double ans;
    if(a*a*b/2 < x){
        ans = atan((2.0*b-(2.0*x)/(a*a))/a) * c/pi;
      	cout << fixed << setprecision(10);
      	cout << ans;
    }else{
        ans = 90.0 - atan(((2.0*x)/(a*b))/b) * c/pi;
        cout << fixed << setprecision(10);
        cout << ans << endl;
    }
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
 
using namespace std;
int main(void){
    string l;
    cin >> l;
    
    if (l[0] == '7') cout << "Yes" << endl;
    else if (l[1] == '7') cout << "Yes" << endl;
    else if (l[2] == '7') cout << "Yes" << endl;
    else cout << "No" << endl;
}

Measured memory_bytes: 3104
import itertools


D, G = map(int, input().split())

P     = [None] * D
C     = [None] * D
count = [None] * D
score = [None] * D

for i in range(D):
    p, c          = map(int, input().split())
    P[i]          = p
    C[i]          = c
    count[i]      = list(range(p+1))
    score[i]      = [100 * (i+1) * j for j in range(p+1)]
    score[i][-1] += c

answer = sum(P)

for is_complete in itertools.product([True, False], repeat=D):
    score_tmp  = 0
    count_tmp  = 0
    score_tmp += sum([score[i][-1] for i in range(D) if is_complete[i]])
    count_tmp += sum([count[i][-1] for i in range(D) if is_complete[i]])
    if score_tmp < G:
        for i in list(range(D))[::-1]:
            if is_complete[i] == False:
                if (G - score_tmp) % (100 * (i+1)) == 0:
                    count_add  = min((G - score_tmp) // (100 * (i+1)),     P[i] - 1)
                else:
                    count_add  = min((G - score_tmp) // (100 * (i+1)) + 1, P[i] - 1)
                score_add      = 100 * (i+1) * count_add
                count_tmp     += count_add
                score_tmp     += score_add
            if score_tmp >= G:
                break
    if score_tmp >= G:
        answer = min(answer, count_tmp)

print(answer)


Measured memory_bytes: 3188
#include <iostream>
#include <algorithm>
using namespace std;
static const int MAX = 200000;

int main(){
        int R[MAX], n;

        cin >> n;
        for(int i = 0; i < n; i++ ) cin >> R[i];

        int maxv = -2000000000;
        int minv = R[0];

        for(int i = 1; i < n; i++ ){
                maxv = max(maxv, R[i] - minv);
                minv = min(minv, R[i]);
        }

        cout << maxv << endl;
        return 0;
}


Measured memory_bytes: 3864
using System;
using System.Collections.Generic;
using System.Linq;

class PaizaSample
{

    static void Main()
    {
        int n = int.Parse(Console.ReadLine());


        ulong sum = 0;

        for (int i = 0; i < n; i++)
        {
            int input = int.Parse(Console.ReadLine());

            sum += (ulong)input;
        }

        Console.WriteLine(sum / (ulong)n);

      //   Console.ReadKey();

    }
}

Measured memory_bytes: 9164
#define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using vi = vector<int>;

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

const int inf = 999999999;
const int mod = 1e9 + 7;
const long double pi = 3.141592653589793238462643383279502884197;
const long double eps = 1e-7;

int main() {
	cin.tie(0);
	int x1, x2, y1, y2;
	cin >> x1 >> y1 >> x2 >> y2;

	int xt = abs(x1 - x2);
	int yt = abs(y1 - y2);

	if (x2 >= x1) {
		if (y2 >= y1) {
			cout << x2 - yt << " " << y2 + xt << " " << x1 - yt << " " << y1 + xt;
		}
		else {
			cout << x2 + yt << " " << y2 + xt << " " << x1 + yt << " " << y1 + xt;
		}
	}
	else {
		if (y2 >= y1) {
			cout << x2 - yt << " " << y2 - xt << " " << x1 - yt << " " << y1 - xt;
		}
		else {
			cout << x2 + yt << " " << y2 - xt << " " << x1 + yt << " " << y1 - xt;
		}
	}


	system("pause");
	return 0;
}

Measured memory_bytes: 504
#include<bits/stdc++.h>
#define PI acos(-1.0)
#define pb push_back
#define F first
#define S second
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
const int N=1e3+3;
const int MOD=1e9+7;
template <class T>
bool sf(T &ret){ //Faster Input
    char c; int sgn; T bit=0.1;
    if(c=getchar(),c==EOF) return 0;
    while(c!='-'&&c!='.'&&(c<'0'||c>'9')) c=getchar();
    sgn=(c=='-')?-1:1;
    ret=(c=='-')?0:(c-'0');
    while(c=getchar(),c>='0'&&c<='9') ret=ret*10+(c-'0');
    if(c==' '||c=='\n'){ ret*=sgn; return 1; }
    while(c=getchar(),c>='0'&&c<='9') ret+=(c-'0')*bit,bit/=10;
    ret*=sgn;
    return 1;
}


int main(void){
    string s;
    cin >>s;
    if(s[0]!='A'){
        cout <<"WA";
        return 0;
    }
    ///(2,n-2) has one c
    int n=(int)s.size();
    int cnt=0,index;
    for(int i=2;i<=n-2;i++)
        if(s[i]=='C')   cnt++,index=i;
    if(cnt!=1){
        cout <<"WA";
        return 0;
    }
    s[index]='c';
    s[0]='a';
    for(auto ch : s){
        if(isupper(ch)){
            cout <<"WA";
            return 0;
        }
    }
    cout <<"AC";

    return 0;
}


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

const int maxn = 2e5+1;
int n, a[maxn];

vector<int> v;

void solve()
{
	for (int i = n-1; i >= 0; i -= 2)
		v.push_back(a[i]);
	if (n%2)
		for (int i = 1; i < n-1; i += 2)
			v.push_back(a[i]);
	else
		for (int i = 0; i < n-1; i += 2)
			v.push_back(a[i]);
}

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

	solve();
	cout << v[0];
	for (int i = 1; i < n; i++)
		cout << " " << v[i];
	cout << endl;

	return 0;

}



Measured memory_bytes: 3828
from sys import stdin
import numpy as np


def dp_solve(dp, lim, n):
    for i in range(n):
        w, v = map(int, input().split())
        dp[i+1][:w] = dp[i][:w]
        dp[i+1][w:] = np.maximum(dp[i][w:], dp[i][:-w]+v)
    return np.max(dp[n])


if __name__ == "__main__":
    n, lim = map(int, stdin.readline().split())
    items = []

    dp = np.zeros((n+1, lim+1), dtype='uint64')
    print(dp_solve(dp, lim, n))


Measured memory_bytes: 92308
#include <cstdio>

typedef long long ll;
#define min(a, b) (((a) < (b)) ? (a) : (b))
#define max(a, b) (((a) > (b)) ? (a) : (b))

inline ll read()
{
    char c = getchar();
    ll ret = 0;
    while (c < '0' || c > '9') c = getchar();
    while (c >= '0' && c <= '9') ret = ret * 10 + c - '0', c = getchar();
    return ret;
}

int main()
{
    ll T = read(), X = read();
    printf("%.8f\n", T / (double)X);
    return 0;
}

Measured memory_bytes: 128
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define F first
#define S second
#define pii pair<int, int>
#define eb emplace_back
#define all(v) v.begin(), v.end()
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rep3(i, l, n) for (int i = l; i < (n); ++i)
#define sz(v) (int)v.size()
const int inf = 1e9 + 7;
const ll INF = 1e18;
#define abs(x) (x >= 0 ? x : -(x))
#define lb(v, x) (int)(lower_bound(all(v), x) - v.begin())
#define ub(v, x) (int)(upper_bound(all(v), x) - v.begin())
template<typename T1, typename T2> inline bool chmin(T1 &a, T2 b) { if (a > b) { a = b; return 1; } return 0; }
template<typename T1, typename T2> inline bool chmax(T1 &a, T2 b) { if (a < b) { a = b; return 1; } return 0; }
template<typename T> T gcd(T a, T b) { if (b == 0) return a; return gcd(b, a % b); }
template<typename T> T lcm(T a, T b) { return a / gcd(a, b) * b; }
template<typename T> T pow(T a, int b) { return b ? pow(a * a, b / 2) * (b % 2 ? a : 1) : 1; }
const int mod = 1000000007;
ll modpow(ll a, int b) { return b ? modpow(a * a % mod, b / 2) * (b % 2 ? a : 1) % mod : 1; }
template<class T> ostream& operator<<(ostream& os, const vector<T>& vec) { rep(i, sz(vec)) { if (i) os << " "; os << vec[i]; } return os; }
template<class T, class U> ostream& operator<<(ostream& os, const pair<T, U>& p) { os << p.F << " " << p.S; return os; }
template<class T> inline void add(T &a, int b) { a += b; if (a >= mod) a -= mod; }



void solve();

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

  int T;
  // cin >> T;
  T = 1;

  while (T--) {
      solve();
  }
}


struct UnionFind {
  vector<int> data;
  int sz;
  UnionFind(int _sz) : data(_sz, -1) { sz = _sz; }
  bool connect(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 issame(int x, int y) { return root(x) == root(y); }
  int root(int x) { return data[x] < 0 ? x : data[x] = root(data[x]); }
  int size(int x) { return -data[root(x)]; }
  int size() { return sz; }
};

void solve() {
  int n, m, k;
  cin >> n >> m >> k;

  UnionFind uni(n);

  vector<vector<int> > G(n);

  rep(i, m) {
    int a, b;
    cin >> a >> b;
    a--; b--;
    uni.connect(a, b);

    G[a].eb(b);
    G[b].eb(a);
  }

  vector<int> ans(n);
  rep(i, k) {
    int a, b;
    cin >> a >> b;
    a--; b--;
    if (uni.issame(a, b)) {
      ans[a]--;
      ans[b]--;
    }
  }

  rep(i, n) ans[i] += uni.size(i) - 1 - sz(G[i]);
  cout << ans << endl;
}


Measured memory_bytes: 7544
//Airport bus

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

using namespace std;

int main(){
    int N;
    long capa,lim;
    cin>>N>>capa>>lim;

    vector<long> arrival(N);

    for(auto &x:arrival){
        cin>>x;
    }

    sort(arrival.begin(),arrival.end());

    int curr=0;
    int cnt_bus=0;
    int kyaku=1;

    for(int i=1;i<N;++i){
        kyaku++;
        if(kyaku>capa){
            kyaku-=capa;
            cnt_bus++;
            curr=i;
        }else if((arrival[curr]+lim)<arrival[i]){
            cnt_bus++;
            kyaku=1;
            curr=i;
        }

    
    }

    if(kyaku>0){
        cnt_bus++;
    }

    cout<<cnt_bus<<endl;

}

Measured memory_bytes: 1024
//#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
 
#define IOS ios::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define endl '\n'
#define ll long long int
#define ld long double
#define vec vector
#define forn(a) for(ll a=0; a<n; a++)
#define all(x) x.begin(), x.end()
#define deb(x) cerr<<#x<<" = "<<x<<endl
 
using namespace std;
 
int main() {
    IOS;
    cout.precision(20);

    int n; cin>>n;
    vec<ld> v(n);
    forn(i) cin>>v[i];
    sort(all(v));

    ld res = v[0];
    for(int i=1; i<n; i++){
        res = (res + v[i])/2;
    }

    cout<<res<<endl;

    return 0;
}

Measured memory_bytes: 256
import java.util.*;


import java.io.*;

public class Main {
	private static void solve(){
		//Implement solution here.
		int n = ni();
		for(int i = 1; i < 10; i++) {
			int div = n / i;
			int rem = n % i;
			if(div < 10 && rem == 0) {
				System.out.println("Yes");
				return;
			}
		}
		System.out.println("No");
	}

	//Switch input source (stdin/file)
	private static BufferedReader br  = new BufferedReader(new InputStreamReader(System.in));
	public static void main(String[] args){
		String debugDataPath = System.getenv("DD_PATH");        
		if(debugDataPath != null){
			try{
				br = new BufferedReader(new InputStreamReader(new FileInputStream(new File(debugDataPath))));
			}catch(Exception e){
				throw new RuntimeException(e);
			}
		} 
		solve();
	}

	//Input read utility
	private static StringTokenizer tokenizer = null;
	public static String next() {
		while (tokenizer == null || !tokenizer.hasMoreTokens()) {
			try {
				tokenizer = new StringTokenizer(br.readLine());
			} catch (Exception e) {
				throw new RuntimeException(e);
			}
		}
		return tokenizer.nextToken();
	}
	//Get next single int
	private static int ni() {
		return Integer.parseInt(next());
	}
	//Get next single long
	private static long nl() {
		return Long.parseLong(next());
	}
	//Get next single double
	private static double nd() {
		return Double.parseDouble(next());
	}
	//Get next int array from one line
	private static int[] na(int n) {
		int[] a = new int[n];
		for (int i = 0; i < n; i++)
			a[i] = ni();
		return a;
	}
	//Get next char array from one line
	private static char[] ns() {
		return next().toCharArray();
	}
	//Get next long array from one line
	private static long[] nal(int n) {
		long[] a = new long[n];
		for (int i = 0; i < n; i++)
			a[i] = nl();
		return a;
	}
}

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

unsigned long long n;
string s;

int main() {
    cin >> n;
    while(n) {
        n--;
        char c = n%26 + 'a';
        n /= 26;
        s.push_back(c);
    }
    reverse(s.begin(), s.end());
    cout << s;
}


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

using namespace std;
typedef unsigned long long ll;

#define pf printf
#define pi acos(-1.0)
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define pb push_back
#define mp make_pair
#define sz(v) ((int)(v).size())
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
#define FORE(i,a,b) for(int i=(a);i<=(b);++i)
#define REPE(i,n) FORE(i,0,n)
#define REPSZ(i,v) REP(i,SZ(v))
#define pll pair <ll, ll>

const ll mxn = 1e4;
const ll mod = 1e9+7;
vector <ll> prime;
bitset<mxn>is_prime;
ll K[105][100005]; 
void print(vector <ll> &v){cout << v.size() << endl;for(int i = 0; i < v.size(); i++){pf("%lld ", v[i]);}pf("\n");}
void print(vector <pll> &v){ cout << v.size() << endl; for(int i = 0; i < v.size(); i++){pf("%lld %lld\n", v[i].first, v[i].second);}}
void print(set<ll> s){set <ll> :: iterator itr;for (itr = s.begin(); itr != s.end(); ++itr){cout << *itr << " ";}cout << endl;}
void print(double d){cout << fixed << setprecision(10) << d << endl;}

void from_file(void){ freopen("input.txt","r",stdin); freopen("output.txt","w",stdout);}

/* ------------------main section-------------! */

ll max(ll a, ll b) 
{ 
    return (a > b) ? a : b; 
}

ll knapSack(ll W, ll wt[], ll val[],ll n) 
{ 
    ll i, w; 
  
    // Build table K[][] in bottom up manner 
    for (i = 0; i <= n; i++) { 
        for (w = 0; w <= W; w++) { 
            if (i == 0 || w == 0) 
                K[i][w] = 0; 
            else if (wt[i - 1] <= w) 
                K[i][w] = max( 
                    val[i - 1] + K[i - 1][w - wt[i - 1]], 
                    K[i - 1][w]); 
            else
                K[i][w] = K[i - 1][w]; 
        } 
    } 
  
    return K[n][W]; 
}

void run() {
    fastio;
    ll n,x,t;
    cin >> n >> x >> t;
    ll ans = n/x;
    if(n%x) ans++;
    cout << ans*t << endl;
}


int main() {
    #ifndef ONLINE_JUDGE
        from_file();
    #endif
    run();
    return 0;
}


Measured memory_bytes: 3648
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long N = sc.nextLong();
		if (N <= 9) {
			System.out.println(N);
		} else if (N <= 99) {
			System.out.println(9);
		} else if (N <= 999) {
			System.out.println(9 + (N - 99));
		} else if (N <= 9999) {
			System.out.println(9 + (999 - 99));
		} else if (N <= 99999) {
			System.out.println(9 + (999 - 99) + (N - 9999));
		} else if (N <= 999999) {
			System.out.println(9 + (999 - 99) + (99999 - 9999));
		}
	}
}


Measured memory_bytes: 21460
#include <bits/stdc++.h>
#include <stdlib.h>
#include <fstream>
#include <iostream>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<ll,ll> llP;

ll mod(ll a, ll b){
  ll ret=a%b;
  if(ret<0) ret+=b;
  return ret;
}

ll modpow(ll a,ll b,ll c){
  ll res=1;
  while(b>0){
    if(b&1) res=mod(res*a,c);
    a=mod(a*a,c);
    b>>=1;
  }
  return res;
}

int main() {
  int n;
  cin>>n;
  bool memo[201];
  for(int i=0;i<n;i++){
    memo[i]=false;
  }
  memo[105]=memo[165]=memo[195]=memo[135]=memo[189]=true;
  int cnt=0;
  for(int i=1;i<=n;i+=2){
    if(memo[i])cnt++;
  }
  cout<<cnt<<endl;
  return 0;
}


Measured memory_bytes: 3640
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
#include<functional>
#include<assert.h>
#include<numeric>
using namespace std;
#define REP(i,m,n) for(int i=(int)(m) ; i < (int) (n) ; ++i )
#define rep(i,n) REP(i,0,n)
using ll = long long;
const int inf=1e9+7;
const ll longinf=1LL<<60 ;
const ll mod=1e9+7 ;

int main(){
    ll s;
    cin>>s;
    ll t = sqrt(s);
    ll x1,y1,x2,y2;
    if(t*t>=s){
        x1=1;
        y2=t*t-s;
        x2=y1=t;
    }
    else if(t*(t+1)>=s){
        x1=t;y2=t+1;
        x2=1;y1=(t+1)*t-s;
    }
    else if((t+1)*(t+1)>=s){
        x1=t+1;y2=t+1;
        x2=1;y1=(t+1)*(t+1)-s;
    }

    cout<<"0 0 ";
    cout<<x1<<" "<<y1<<" ";
    cout<<x2<<" "<<y2<<endl;
    return 0;
}

Measured memory_bytes: 256
/**
 * D - I hate Factorization
 * https://atcoder.jp/contests/abc166/tasks/abc166_d
 */
#include <bits/stdc++.h>
using namespace std;
 
int main() {
    // A5−B5=X を満たす整数の組 (A,B) をひとつ示してください。 ただし、与えられる X に対して、条件を満たす整数の組 (A,B) が存在することが保証されています。
    long long X;
    cin >> X;

    for (long long a = 0; a < INT_MAX; a++) {
            for (long long b = 0; b < a; b++) {
                long long a5 = a * a * a * a * a;
                long long b5 = b * b * b * b * b;
                if ((a5 - b5) == X) {
                    cout << a << ' ' << b << endl;
                    return 0;
                } else if ((a5 + b5) == X) {
                    cout << a << " -" << b << endl;
                    return 0;
                }
            }
    }

}
 

Measured memory_bytes: 3632
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		sc.close();
		
		boolean[] used = new boolean[26];
		for (int i = 0; i < s.length(); i++) {
			used[s.charAt(i) - 'a'] = true;
		}
		
		for (int i = 0; i < used.length; i++) {
			if (!used[i]) {
				System.out.println((char) ('a' + i));
				return;
			}
		}
		System.out.println("None");
		
	}
}




Measured memory_bytes: 30316
import sys

n, m = map(int, sys.stdin.readline().split())

root = list(range(n+1))
height = [0] * (n + 1)

def find_root(v):
    u = root[v]
    if u == v:
        return u
    w = find_root(u)
    root[v] = w
    return w

def merge(v, u):
    rv = find_root(v)
    ru = find_root(u)
    if rv != ru:
        if height[v] >= height[u]:
            root[ru] = rv
            height[v] = max(height[v], height[v] + 1)
        else:
            root[rv] = ru

graph = [[] for _ in range(n+1)]
for l, r, d in zip(*[map(int, sys.stdin.read().split())] * 3):
    graph[l].append((r, d))
    graph[r].append((l, -d))
    merge(l, r)

for v in range(1, n+1):
        find_root(v)

def main():
    dist = [None] * (n + 1)
    for v in set(root[1:]):
        dist[v] = 0
        stack = [v]
        while stack:
            x = stack.pop()
            for y, d in graph[x]:
                if dist[y] is None:
                    dist[y] = dist[x] + d
                    stack.append(y)
                elif dist[y] != dist[x] + d:
                    return 'No'
    return 'Yes'
      
if __name__ == '__main__':
    ans = main()
    print(ans)

Measured memory_bytes: 101084
import sys
n = int(input())
xLst = list(map(int, input().split()))
sm = 0
ans = int(sys.maxsize)

#開催する座標
for i in range(101):
    #全員の体力の計算
    sm = sum((xLst[ii] - i)**2 for ii in range(n))
    if ans > sm:
        ans = sm        
print(ans)


Measured memory_bytes: 2940
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <vector>
#include <string>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <algorithm>
 
using namespace std;
 
#define rep(i,j) REP((i), 0, (j))
#define REP(i,j,k) for(int i=(j);(i)<(k);++i)
#define BW(a,x,b) ((a)<=(x)&&(x)<=(b))
#define ALL(v) (v).begin(), (v).end()
#define LENGTHOF(x) (sizeof(x) / sizeof(*(x)))
#define AFILL(a, b) fill((int*)a, (int*)(a + LENGTHOF(a)), b)
#define SQ(x) ((x)*(x))
#define Mod(x, mod) (((x)+(mod)%(mod))
#define MP make_pair
#define PB push_back
#define Fi first
#define Se second
#define INF (1<<29)
#define EPS 1e-10
#define MOD 1000000007
 
typedef pair<int, int> pi;
typedef pair<int, pi> pii;
typedef vector<int> vi;
typedef queue<int> qi;
typedef long long ll;
 
int N;
ll M;
ll P[1024];
 
int main(){
  while(scanf("%d%lld",&N,&M) && N+M){
    ll res = 0;
    rep(i,N) scanf("%lld", P+i);
    P[N] = 0;
    vector<ll>PP;
    rep(i,N+1) rep(j,N+1) PP.push_back(P[i]+P[j]);
    sort(PP.begin(), PP.end());
    PP.erase(unique(PP.begin(), PP.end()), PP.end());
    for(int i=0;i<PP.size();i++){
      if(PP[i] > M) continue;
      ll x = M-PP[i];
      ll last = *(--upper_bound(PP.begin(), PP.end(), x));
      if(PP[i]+last <= M) res =  max(res, PP[i]+last);
    }
     
    printf("%lld\n", res);
  }
  return 0;
}


Measured memory_bytes: 18848
#include <iostream>
using namespace std;
int main(){
	int a,b,c,d[1001]={0},m=0;
	cin>>a>>b>>c;
	for (int A=a;A<b;A++)d[A]=1;
	for (int A=0;A<c;A++){
		cin>>a>>b;
		for (int B=a;B<b;B++){
			if (d[B]!=1) d[B]=1;
			else m=1;
		}
	}
	if (m==0) cout<<0<<endl;
	else cout<<1<<endl;
	return 0;
}

Measured memory_bytes: 3116
// ABC142 E

#include <bits/stdc++.h>
#define RI register int
typedef long long LL;

using namespace std;

int const MAXN = 1 << 13;
int f[MAXN];

int main() {
  
 // freopen("a.in", "r", stdin);
 // freopen("a.out", "w", stdout);

  int n, m; cin >> n >> m;
  memset(f, 0x7f, sizeof(f));
  f[0] = 0;
  int all = 1 << n;
  for (RI i = 1; i <= m; ++i) {
    int cost, cnt; cin >> cost >> cnt;
    int s = 0;
    for (RI j = 1, x; j <= cnt; ++j)
      cin >> x, s |= (1 << (x - 1));
    for (RI j = 0; j < all; ++j)
      f[j | s] = min(f[j | s], f[j] + cost);
  }
  if (f[all - 1] == 0x7f7f7f7f) puts("-1");
  else printf("%d\n", f[all - 1]);
  
  return 0;
}

// created by Daniel yuan


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

#define PI 3.14159265358979323846

using namespace std;

int main() {
  long double a, b;
  long double x;
  cin >> a >> b >> x;
  long double Air = a*a*b - x;
  long double tri, c;
  if(Air < x){
    tri = Air / a;
    c = atan(2*tri/(a*a));
    c *= 180.0/PI;
    cout << fixed;
    cout << setprecision(12) << c << endl;
  }else{
    c = atan(2*x/a/b/b);
    //cout << c << endl;
    //cout << 4*x/a/b/b << endl;
    c *= 180.0;
    c /= PI;
    c = 90 - c;
    cout << fixed;
    cout << setprecision(12) << c << endl;
  }
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
using Int = long long;
//INSERT ABOVE HERE
signed main(){
  Int a,b,c,d;
  cin>>a>>b>>c>>d;
  cout<<(abs(a-c)<=d||(abs(a-b)<=d&&abs(b-c)<=d)?"Yes":"No")<<endl;
  return 0;
}


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


int main() {
    int N, K, d, tmp, count = 0;
    cin >> N >> K;
    vector<int> vec(N, 0);

    for (int i = 0; i < K; i++) {
        cin >> d;
        for (int j = 0; j < d; j++) {
            cin >> tmp;
            vec.at(tmp-1)++;
        }
    }
    for (int i = 0; i < N; i++) {
        if (!vec.at(i)) count++;
    }
    cout << count << endl;
    return 0;
}

Measured memory_bytes: 3596
using System;

class Program
{
    static void Main(string[] args)
    {
        var input = Console.ReadLine().Split(' ');
        var num1 = Convert.ToInt32(input[0]);
        var num2 = Convert.ToInt32(input[1]);

        if (num1 <= 8 && num2 <= 8) Console.WriteLine("Yay!");
        else Console.WriteLine(":(");
    }
}

Measured memory_bytes: 13268
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
import math
import bisect
import random
from itertools import permutations, accumulate, combinations, product
import sys
import string
from bisect import bisect_left, bisect_right
from math import factorial, ceil, floor
from operator import mul
from functools import reduce
from pprint import pprint
sys.setrecursionlimit(2147483647)


INF = float('inf')
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS(): return sys.stdin.readline().split()
def S(): return sys.stdin.readline().strip()
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]
mod = 1000000007



from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
import math
import bisect
import random
from itertools import permutations, accumulate, combinations, product
import sys
import string
from bisect import bisect_left, bisect_right
from math import factorial, ceil, floor
from operator import mul
from functools import reduce


INF = float('inf')
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS(): return sys.stdin.readline().split()
def S(): return sys.stdin.readline().strip()
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]
mod = 1000000007


n, k = LI()
A = LI()
cnt = 0
for i in A:
    if i >= k:
        cnt += 1

print(cnt)

Measured memory_bytes: 51680
using System;
using System.Linq;
using System.Collections.Generic;
using static System.Console;
using System.Text;
using System.IO;
using static System.Math;
using System.Numerics;
using System.Runtime.InteropServices.ComTypes;
using System.Xml.Schema;
using System.ComponentModel.DataAnnotations;
using System.Security.Cryptography;
using System.Drawing;

namespace AtCoder
{
    public class Program
    {
        public static void Main(string[] args)
        {
            //SetOut(new StreamWriter(OpenStandardOutput()) { AutoFlush = false });
            Solve();
            //Out.Flush();
            Read();
        }

        static void Solve()
        {
            var (A, B) = Slice2<long>();
            if (A <= 5)
                WriteLine(0);
            else if (A <= 12)
                WriteLine(B / 2);
            else
                WriteLine(B);
        }

        static long Mod = (long)1e9 + 7;
        static public long[] Sarray() { return ReadLine().Split().Select(long.Parse).ToArray(); }
        static public List<long> Slist() { return ReadLine().Split().Select(long.Parse).ToList(); }
        static public (T1 a, T2 b) Slice<T1, T2>()
        {
            var t = ReadLine().Split();
            return (
            (T1)Convert.ChangeType(t[0], typeof(T1)),
            (T2)Convert.ChangeType(t[1], typeof(T2)));
        }
        static public (T a, T b) Slice2<T>()
        {
            var t = ReadLine().Split();
            return (
            (T)Convert.ChangeType(t[0], typeof(T)),
            (T)Convert.ChangeType(t[1], typeof(T)));
        }
        static public (T a, T b, T c) Slice3<T>()
        {
            var t = ReadLine().Split();
            return (
            (T)Convert.ChangeType(t[0], typeof(T)),
            (T)Convert.ChangeType(t[1], typeof(T)),
            (T)Convert.ChangeType(t[2], typeof(T)));
        }
        static public (T a, T b, T c, T d) Slice4<T>()
        {
            var t = ReadLine().Split();
            return (
            (T)Convert.ChangeType(t[0], typeof(T)),
            (T)Convert.ChangeType(t[1], typeof(T)),
            (T)Convert.ChangeType(t[2], typeof(T)),
            (T)Convert.ChangeType(t[3], typeof(T)));
        }
    }
}

Measured memory_bytes: 27420
#include <bits/stdc++.h>
#define REP(i,n) for (int i = 0; i <(n); ++i)
#define REP2(i,x,n) for (int i = x; i <(n); ++i)
#define ALL(v) v.begin(), v.end()
#define RALL(v) v.rbegin(), v.rend()
using namespace std;
using ll = long long;
using P = pair<int,int>;
static const double PI = acos(-1);
static const int INF = 1e9+7;
#define REP(i,n) for (int i = 0; i <(n); ++i)
//debug 
#ifdef _DEBUG
#define debug(var)  do{cout << #var << " :";view(var);}while(0)
#else
#define debug(...)
#endif
template<typename T> void view(T e){cout << e << endl;}
template<typename T> void view(const vector<T>& v){for(const auto& e : v){ cout << e << " "; } cout << endl;}
template<typename T> void view(const vector<vector<T> >& vv){ for(const auto& v : vv){ view(v); } }


int main(){
  int n, x;
  cin >> n >> x;
  vector<int> a(n);
  REP(i,n) cin >> a[i];
  sort(ALL(a));
  int sum  = 0;
  REP(i,n) sum += a[i];

  n += (x - sum)/a[0];
  cout << n << endl;
  return 0;
}

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

long long n,sum;
long long ans;
string s[100010];
char temp;

long long calc(long long a)
{
	if(a==1) return 0;
	else return a*(a-1)/2;
} 

int main()
{
	cin >> n;
	for(int i=1;i<=n;i++)
	{
		cin >> s[i];
		for(int j=0;j<9;j++)
			for(int k=j+1;k<10;k++)
				if(s[i][j]>s[i][k])
				{
					temp=s[i][j];
					s[i][j]=s[i][k];
					s[i][k]=temp;
				}
	}
	sort(s+1,s+1+n);
	sum=1;
	for(int i=2;i<=n+1;i++)
	{
		if(s[i]==s[i-1]) sum++;
		else
		{
			ans+=calc(sum);
			sum=1;
		}
	}
	cout << ans << endl;
	return 0;
}


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

#define times(n, i)      uptil(0, n, i)
#define rtimes(n, i)     downto((n) - 1, 0, i)
#define upto(f, t, i)    for(int _##i = (t), i = (f); i <= _##i; i++)
#define uptil(f, t, i)   for(int _##i = (t), i = (f); i <  _##i; i++)
#define downto(f, t, i)  for(int _##i = (t), i = (f); i >= _##i; i--)
#define downtil(f, t, i) for(int _##i = (t), i = (f); i >  _##i; i--)
typedef long double ld;
#define long long long

#if defined(EBUG) && !defined(ONLINE_JUDGE)
    #define debug true
    #define ln << endl
#else
    #define debug false
    #define ln << '\n'
#endif
#define tb << '\t'
#define sp << ' '

const int MOD = 1e9+7;

int N, parent[100009], ssize[100009];
vector<int> paths[100009];

int parentDFS(int i, int p) {
    parent[i] = p;
    int s = 1;
    for(int j: paths[i]) if(j != p) s += parentDFS(j, i);
    return ssize[i] = s;
}

bool checkDFS(int i) {
    int c = 0;
    for(int j: paths[i]) {
        int k = j == parent[i] ? N - ssize[i] : ssize[j];
        c += k % 2;
    }
    if(c != 1) return true;
    for(int j: paths[i]) if(j != parent[i]) {
        if(checkDFS(j)) return true;
    }
    return false;
}

signed main() { // long: 64bit
    if(!debug) {
        cin.tie(0);
        ios::sync_with_stdio(0);
    }

    scanf("%d",&N);
    times(N-1, i) {
        int A, B;
        scanf("%d%d",&A,&B);
        paths[A-1].push_back(B-1);
        paths[B-1].push_back(A-1);
    }

    parentDFS(0, 0);
    if(checkDFS(0)) {
        cout << "First\n";
    } else {
        cout << "Second\n";
    }

    return 0;
}


Measured memory_bytes: 6656
#include<iostream>
#include<algorithm>
#include<queue>
#include<vector>
#include<string>
#include<unordered_map>
#include<string.h>
#include<math.h>
using namespace std;
using ll = long long;
int main(){
    double N;
    cin >> N;
    int i = N / 1.08;
    int j = N / 1.08 + 1;
    
    int k = i * 1.08;
    int l = j * 1.08;
    
    if(k == N)cout << i;
    else if(l == N)cout << j;
    else cout << ":(";
}


Measured memory_bytes: 256