akhauriyash/Code-Regression huggingface dataset:
using System;
using System.Collections.Generic;

class ShellSort {

    static long insertionSort(int[] A, int n, int g) {
        long cnt = 0;
        for (int i = g; i < n; i++) {
            int v = A[i];
            int j = i-g;
            while (j >= 0 && A[j] > v) {
                A[j+g] = A[j];
                j -= g;
                cnt++;
            }
            A[j+g] = v;
        }
        return cnt;
    }

    static long shellSort(int[] A, int n) {
        long cnt = 0;
        List<int> G = new List<int>();
        for (int h = 1; ;) {
            if (h > n)
                break;
            G.Add(h);
            h = 3*h + 1;
        }
        int m = G.Count;
        for (int i = m-1; i >= 0; i--) {
            cnt += insertionSort(A, n, G[i]);
        }
        return cnt;
    }

    static void Main()
    {
        List<int> G = new List<int>();
        long cnt = 0;
        int[] A = new int[1000000];
        int n = int.Parse(Console.ReadLine());

        for (int h = 1; ;) {
            if (h > n)
                break;
            G.Add(h);
            h = 3*h + 1;
        }

        int m = G.Count;

        for (int i = 0; i < n; i++)
            A[i] = int.Parse(Console.ReadLine());

        cnt += shellSort(A, n);

        Console.WriteLine(m);

        for (int i = m-1; i >= 0; i--) {
            Console.Write(G[i]);
            Console.Write(i == 0 ? "\n" : " ");
        }

        Console.WriteLine(cnt);

        for(int i = 0; i < n; i++)
            Console.WriteLine(A[i]);
    }
}

Measured memory_bytes: 16432
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vvvll = vector<vvll>;
using vs = vector<string>;
using pll = pair<ll, ll>;
using vp = vector<pll>;
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define repr(i, a, b) for (ll i = (a); i < (b); i++)
#define ALL(a) (a).begin(), (a).end()
#define SZ(x) ((int)(x).size())
#define PRINT(V) for (auto v:(V)) {cerr << v << " ";} cerr << endl
#define dump(x) cerr << #x << " : " << (x) << endl
#define dump2(x, y) cerr << "(" << #x << ", " << #y << ") = (" << x << ", " << y << ")" << endl
inline ll GCD(ll a, ll b){return b ? GCD(b, a % b) : a;}
const ll MOD = 1000000007;
const ll INF = 100000000000000000LL;
/* END OF TEMPLATE */

int main(){
    cin.tie(0); ios::sync_with_stdio(false);
    ll w, h, x, y;
    cin >> w >> h >> x >> y;
    double ans = w * h;
    ans /= 2;
    int mul;
    if(x * 2 == w && y * 2 == h){
        mul = 1;
    }else{
        mul = 0;
    }
    cout << fixed << setprecision(15) << ans << " " << mul << endl;
    return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;
public class Main {
    public static void main(final String[] args){
        final Scanner sc = new Scanner(System.in);
        final int a = sc.nextInt();
        final int b = sc.nextInt();
        final int c = sc.nextInt();

        if(a<b){
            if(b<c){
                System.out.printf("%d %d %d\n",a,b,c);
            }else if(a<c){
                System.out.printf("%d %d %d\n",a,c,b);
            }else{
                System.out.printf("%d %d %d\n",c,a,b);
            }
        }else if(a>b){
            if(a<c){
                System.out.printf("%d %d %d\n",b,a,c);
            }else if(c<b){
                System.out.printf("%d %d %d\n",c,b,a);
            }else {
                System.out.printf("%d %d %d\n",b,c,a);
            }
        }
        sc.close();
    }
}


Measured memory_bytes: 26384
N, T = map( int, input().split())

c = []
cmin = []

for i in range(N):
  C, t = map( int, input().split())
  if( t <= T):
    c.append(C)

  else:
    c.append(1001)
    
cmin = sorted(c)

if( cmin[0] == 1001):
  print("TLE")
  
else:
  print(cmin[0])

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

public class AtCoderA
{
    static void Main()
    {
        var sc = new Scanner();

        int n = sc.NextInt();

        double answer = 0;

        for (int i = 0; i < n; i++)
        {
            double x = sc.NextDouble();
            string u = sc.Next();

            if (u == "JPY")
            {
                answer += x;
            }
            else
            {
                answer += x * 380000.0;
            }
        }

        Console.WriteLine(answer);
    }

    class Scanner
    {
        private string[] _line;
        private int _index;
        private const char Separator = ' ';

        public Scanner()
        {
            _line = new string[0];
            _index = 0;
        }

        public string Next()
        {
            while (_index >= _line.Length)
            {
                _line = Console.ReadLine().Split(Separator);
                _index = 0;
            }

            return _line[_index++];
        }

        public int NextInt() => int.Parse(Next());
        public long NextLong() => long.Parse(Next());
        public double NextDouble() => double.Parse(Next());
        public decimal NextDecimal() => decimal.Parse(Next());
        public char NextChar() => Next()[0];
        public char[] NextCharArray() => Next().ToCharArray();

        public string[] Array()
        {
            _line = Console.ReadLine().Split(Separator);
            _index = _line.Length;
            return _line;
        }

        public int[] IntArray() => Array().Select(int.Parse).ToArray();
        public long[] LongArray() => Array().Select(long.Parse).ToArray();
        public double[] DoubleArray() => Array().Select(double.Parse).ToArray();
        public decimal[] DecimalArray() => Array().Select(decimal.Parse).ToArray();
    }
}

Measured memory_bytes: 13140
N = int(input())
S = [input() for _ in range(N)]
M = int(input())
T = [input() for _ in range(M)]
scorelists = []
for key in S:
    score = 0
    for tmp in S:
        if key == tmp:
            score += 1
    for tmp in T:
        if key == tmp:
            score -= 1
    scorelists.append(score)

print(max(scorelists) if max(scorelists) > 0 else 0)


Measured memory_bytes: 3060
//B - Magic 2
//Hiia
#include <stdio.h>
#include <stdlib.h>//rannsuu, zettaichi(absolute)
#include <time.h>
//srand((unsigned int) time(0));
#include <math.h>//koudona keisann
#include <string.h>//hairetsu
#define max(p,q)((p)>(q)?(p):(q))
#define min(p,q)((p)<(q)?(p):(q))
typedef long long ll;
//#define N 998244353
#define pi 3.1415926535897932384626433832

int gcd(int m,int n){if((0==m)||(0==n))return 0;while(m!=n)if(m>n)m=m-n;else n=n-m;return m;}
int lcm(int m,int n){if((0==m)||(0==n))return 0;return(m*n/gcd(m, n));}
int fact(int x){if(x==1) return(x);else return(x*fact(x-1));}//Kaijou x!
int ruijou(int base,int exponent){int i,answer=1;i=exponent;while(i!=0){answer=answer*base;--i;}return answer;}//ruijou base^exponent

long long int llgcd(long long int m,long long int n){if((0==m)||(0==n))return 0;while(m!=n)if(m>n)m=m-n;else n=n-m;return m;}
long long int lllcm(long long int m,long long int n){if((0==m)||(0==n))return 0;return(m*n/llgcd(m, n));}
long long int llfact(long long int x){if(x==1) return(x);else return(x*llfact(x-1));}//Kaijou
int llruijou(long long int base,long long int exponent){long long int i,answer=1;i=exponent;while(i!=0){answer=answer*base;--i;}return answer;}//ruijou base^exponent

int main()
{
  int a,b,c,k;
  scanf("%d %d %d", &a,&b,&c);
  scanf("%d", &k);

  int count=0;
  while(a>=b){
    b*=2;
    count+=1;
  }
  while(b>=c){
    c*=2;
    count+=1;
  }

  if(count<=k){
    printf("Yes\n");
  }
  else{
    printf("No\n");
  }

  return 0;
}


Measured memory_bytes: 1660
from collections import deque
import heapq
words = lambda t : list(map(t, input().split()))
n,m = words(int)
ab = []
max_a = 0
for i in range(n):
    a,b = words(int)
    ab.append((b,a))
    max_a = max(a, max_a)

ab.sort()
ab = list(map(lambda ba: (ba[1],ba[0]), ab))
moto = {}

for a,b in ab:
    if a not in moto:
        moto[a] = deque()
    moto[a].append(b)

#print(moto)

h = []
ans = 0
for a in range(m+1):
    #print(a)
    if a in moto:
        #print(moto[a])
        if len(moto[a]) > 0:
            b = moto[a].pop()
            heapq.heappush(h,(-b,a))
    #print(h)
    if len(h) > 0:
        mb,na = heapq.heappop(h)
        if na in moto:
            if len(moto[na]) > 0:
                nb = moto[na].pop()
                heapq.heappush(h,(-nb, na))
        ans += -mb
print(ans)


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

int main() {
  int N, M;
  cin >> N >> M;
  vector<string> A(N), B(M);
  for (int i = 0; i < N; ++i) cin >> A.at(i);
  for (int i = 0; i < M; ++i) cin >> B.at(i);
  bool ans = false;
  for (int i = 0; i < N - M + 1; ++i) {
    for (int j = 0; j < N - M + 1; ++j) {
      bool match = true;
      for (int k = 0; k < M; ++k) {
        for (int l = 0; l < M; ++l) {
          if (A.at(i + k).at(j + l) != B.at(k).at(l)) {
            match = false;
          }
        }
      }
      ans |= match;
    }
  }
  cout << (ans ? "Yes" : "No") << endl;
}


Measured memory_bytes: 256
// D.

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

using namespace std;

typedef pair<int, int> II;

int main(int argc, char *argv[]) {
	int n;
	cin >> n;
	vector<II> v;
	for (int i = 0; i < n; ++i) {
		int a, b;
		cin >> a >> b;
		v.push_back({ b, a });
	}
	sort(v.begin(), v.end());
	int t = 0;
	bool ans = true;
	for (int i = 0; i < n; ++i) {
		t += v[i].second;
		if (t > v[i].first) {
			ans = false;
			break;
		}
	}
	cout << (ans ? "Yes" : "No") << endl;
	return 0;
}


Measured memory_bytes: 3444
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;

ll gcd(ll a, ll b) {
  while (a && b) {
    if (a >= b) {
      a %= b;
    } else {
      b %= a;
    }
  }
  return a + b;
}

bool solve() {
  ll a, b, c, d;
  cin >> a >> b >> c >> d;
  if (a < b) {
    return false;
  }
  if (b > d) {
    return false;
  }
  ll g = gcd(b, d);
  ll r = ((a - c - 1) % g + g) % g;
  return c + 1 + r >= b;
}

signed main() {
#ifdef LOCAL
  assert(freopen("b.in", "r", stdin));
#endif
  int tn;
  cin >> tn;
  for (int i = 0; i < tn; ++i) {
    cout << (solve() ? "Yes" : "No") << '\n';
  }
}


Measured memory_bytes: 256
import collections
N=int(input())
li=list(map(int,input().split()))
li_count=collections.Counter(li)
li_count_most=li_count.most_common()
ans=0
for k in range(len(li_count_most)):
    if li_count_most[k][0]<=li_count_most[k][1]:
        ans+=(li_count_most[k][1]-li_count_most[k][0])
    else:
        ans+=li_count_most[k][1]
print(ans)


Measured memory_bytes: 21228
#include <bits/stdc++.h>
  using namespace std;
#define ll long long
#define fw(p) for(int w=0;w<(p);w++)
#define fx(p) for(int x=0;x<(p);x++)
#define fy(p) for(int y=0;y<(p);y++)
#define fz(p) for(int z=0;z<(p);z++)
#define fyg(p,g) for(int y=(g);y<(p);y++)
#define fzg(p,g) for(int z=(g);z<(p);z++)
#define ce(d) cout<<d<<endl;
#define vecp(p) int aa;cin>>aa;(p).push_back(aa);
#define vecpl(p) long long aa;cin>>aa;(p).push_back(aa);
#define vecps(p) string aa;cin>>aa;(p).push_back(aa);
#define vecp2(p) int ab;cin>>ab;(p).push_back(ab);
#define vecpl2(p) long long ab;cin>>ab;(p).push_back(ab);
#define vecps2(p) string ab;cin>>ab;(p).push_back(ab);
#define set0(k,n) for(int nn=0;nn<(n);nn++){ (k).push_back(0); }
#define sorts(c) sort((c).begin(),(c).end());
#define reverses(c) reverse((c).begin(),(c).end());
#define vec(b) vector<int> (b);
#define vecl(b) vector<long long> (b);
#define vecs(b) vector<string> (b);
#define vecsize(b,size) vector<int> (b)((size));
#define pb(b,a) (b).push_back((a));
#define doublece(a,b) cout<<(a)<<' '<<(b)<<endl;
#define pairs(s) vector<pair<int,int>> (s);
#define pairsl(s) vector<pair<ll,ll>> (s);
#define pairss(s) vector<pair<string,string>> (s);
#define pairsp(s) int aa,bb;cin>>aa>>bb;(s).push_back(make_pair(aa,bb));
#define pairspl(s) int aa,bb;cin>>aa>>bb;(s).push_back(make_pair(aa,bb));
#define pairsps(s) int aa,bb;cin>>aa>>bb;(s).push_back(make_pair(aa,bb));
#define pairsREV(s) (s).push_back(make_pair(bb,aa));
#define pairslREV(s) (s).push_back(make_pair(bb,aa));
#define pairssREV(s) (s).push_back(make_pair(bb,aa));
#define MOD 1000000007

int main() {
	
	int N;
	cin>>N;
	int k=0,n=N;
	while(n>0){
		k+=n%10;
		n/=10;
	}
	if(N%k==0){
		ce("Yes")
	}else{
		ce("No")
	}
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0; i < n; i++)
#define reps(i,n) for(int i = 1; i <= n; i++)
#define rrep(i,n) for(int i = n-1; i >= 0; i--)
#define rreps(i,n) for(int i = n; i >= 1; i--)
#define mrep(i,from,n) for(int i = from; i < n; i++)
#define mreps(i,from,n) for(int i = from; i <= n; i++)
#define all(x) (x).begin(),(x).end()
#define sz(x) ((int)(x).size())
#define ERASE(x,val) x.erase(remove(ALL(x), val), x.end())
typedef long long ll;
typedef pair<int, int> P;
template<class T>inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; }return false; }
template<class T>inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; }return false; }
ll mod = 1000000007;

void solve()
{
	int n, k;
	cin >> n >> k;
	ll ans = 0;
	mreps(i,k + 1,n)
	{
		int x = n / i;
		ans += x * (i-k);
		ans += max(0, n - x*i - k+1);
		if(k==0)ans--;
	}
	cout << ans << endl;
	return;
}

int main()
{
	cin.tie(0);
	ios::sync_with_stdio(false);
	cout << fixed << setprecision(15);
	solve();
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#define rep(i,l,r) for((i)=(l);(i)<(r);(i)++)
#define repp(i,l,r,k) for((i)=(l);(i)<(r);(i)+=(k))
using namespace std;
int main(){
    int n,i,j;
    cin>>n;
    rep(i,1,10){
        rep(j,1,10){
            if(i*j==n){
                cout<<"Yes"<<endl;
                return 0;
            }
        }
    }
    cout<<"No"<<endl;
}

Measured memory_bytes: 256
#関数リスト
import sys
input = sys.stdin.readline

def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))

H, W, K = MI()
mylist = []
result = 0

for i in range(H):
    temp = input().rstrip()
    temp = [temp[j] for j in range(W)]
    mylist.append(temp)

for maskH in range(0, 2**H):
    for maskW in range(0, 2**W):
        black = 0
        for i in range(0, H):
            for j in range(0, W):
                if ((maskH >> i) & 1) == 0 and ((maskW >> j) & 1) == 0 and mylist[i][j] == "#":
                    black += 1
        if black == K:
            result += 1
            
print(result)


Measured memory_bytes: 73620
#include <iostream>
#include <vector>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <cstdio>
#include <bitset>
#include <queue>
#include <deque>
#include <algorithm>
#include <numeric>
#include <cassert>
#include <functional>
#include <stack>
#include <cmath>
#include <string>
#pragma GCC optimize("Ofast")
#pragma GCC target("avx")

using namespace std;

#define REP(i, N) for (int i = 0; i < (int)N; i++)
#define FOR(i, a, b) for (int i = a; i < (int)b; i++)
using ll = long long;

inline bool bit(ll x, int b) { return (x >> b) & 1; }

constexpr int SZ = 100000;
constexpr int prs = 10;
ll pre[1 << prs][SZ + 1];

int main() {
  int N;
  cin >> N;
  vector<int> V(N + 1), W(N + 1);
  REP(i, N) cin >> V[i + 1] >> W[i + 1];
  FOR(i, 1, min(N + 1, 1 << prs)) {
    if (i != 1) copy(pre[i / 2], pre[i / 2] + SZ + 1, pre[i]);
    for (int j = SZ; j >= W[i]; --j)
      pre[i][j] = max(pre[i][j], pre[i][j - W[i]] + V[i]);
    REP(j, SZ) pre[i][j + 1] = max(pre[i][j + 1], pre[i][j]);
  }
  int Q;
  cin >> Q;
  while (Q--) {
    int v, L;
    cin >> v >> L;
    if (v < (1 << prs)) {
      cout << pre[v][L] << "\n";
    } else {
      int bi = 32 - __builtin_clz(v) - prs;
      ll ans = 0;
      REP(b, 1 << bi) {
        int w = 0;
        ll va = 0;
        REP(i, bi) {
          if ((b >> i) & 1) {
            w += W[v >> i];
            va += V[v >> i];
          }
          if (w > L) break;
        }
        if (w <= L) ans = max(ans, pre[v >> bi][L - w] + va);
      }
      cout << ans << "\n";
    }
  }
  return 0;
}


Measured memory_bytes: 804472
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll MOD = 1e9 + 7;
//const ll MOD = 998244353;
//const ll MOD = ;
ll mod(ll A, ll M) {return (A % M + M) % M;}
const ll INF = 1LL << 60;
template<class T> bool chmin(T& a, T b) {if (a > b) {a = b; return true;} return false;}
template<class T> bool chmax(T& a, T b) {if (a < b) {a = b; return true;} return false;}
ll divceil(ll A, ll B) {return (A + (B - 1)) / B;}
ll myctoi(char C) {return C - '0';}
char myitoc(ll N) {return '0' + N;}
#define FINALANS(A) {cout << (A) << '\n'; exit(0);}

int main()
{
  string S;
  cin >> S;
  string s = S;
  S += S;
  ll N = S.size();
  ll K;
  cin >> K;

  bool same = true;
  for (ll i = 0; i < N - 1; i++)
  {
    if (S.at(i) != S.at(i + 1))
    {
      same = false;
      break;
    }
  }
  if (same)
    FINALANS(N / 2 * K / 2);

  ll a0 = 0, a1 = 0;
  for (ll i = 0; i < N - 1; i++)
  {
    if (S.at(i) == S.at(i + 1))
    {
      S.at(i + 1) = '?';
      if (i + 1 < N / 2)
        a0++;
      else
        a1++;
    }
  }
  ll ans = a0 + (K - 1) * a1;
  cout << ans << endl;
  cerr << a0 << " " << a1 << endl;

  return 0;

  cerr << endl;
  string T = s;
  for (ll i = 0; i < K - 1; i++)
  {
    T += s;
  }
  ll tmp = 1;
  ll ans0 = 0;
  for (ll i = 0; i < T.size() - 1; i++)
  {
    if (T.at(i) == T.at(i + 1))
      tmp++;
    else
    {
      ans0 += tmp / 2;
      tmp = 1;
    }
  }
  ans0 += tmp / 2;
  cerr << S << endl
       << T << endl;
  cerr << ans0 << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL
#include "debug.h"
#else
#define dump(...)
#endif
#define endl "\n"
#define ll long long
#define FOR(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define REP(i, x) for (int i = 0; i < (int)(x); i++)
#define REPS(i, x) for (int i = 1; i <= (int)(x); i++)
#define RREP(i, x) for (int i = ((int)(x)-1); i >= 0; i--)
#define RREPS(i, x) for (int i = ((int)(x)); i > 0; i--)
#define INF (1 << 30 - 1)
#define LLINF (1LL << 60)
#define vi vector<int>
#define vvi vector<vector<int>>
#define pi pair<int, int>
#define ALL(a) (a).begin(), (a).end()
#define BIT(n) (1LL << (n))
#define UNIQUE(v) v.erase(unique(v.begin(), v.end()), v.end()) //sortしてからつかうこと
constexpr ll MOD = 1e9 + 7;
int dx[8] = {1, 0, -1, 0, 1, 1, -1, -1};
int dy[8] = {0, 1, 0, -1, 1, -1, 1, -1};
ll A, B, C, D, E, F, G, H, N, M, L, K, P, Q, R, W, X, Y, Z;
string S, T;
ll ans = 0;

template <typename T>
istream &operator>>(istream &is, vector<T> &vec) {
    for (T &x : vec)
        is >> x;
    return is;
}

signed main() {
    double r;
    cin >> r;
    cout << setprecision(10) << 2.0 * M_PI * r << endl;
}

Measured memory_bytes: 3788
#include <bits/stdc++.h>
using namespace std;
//ofstream cout("output.out");

#define fast() {ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);}
#define o(a) { cout << #a << ":" << (a) <<" ";}
#define ov(a) { cout << "["; \
	for(int i = 0; i < (a).size(); ++i){ \
		cout << i <<":" << a[i] <<" "; \
		if(i % 10 == 9) cout <<"\n"; \
		} \
	cout << "]"; \
}
#define ovv(a) { cout << "["; \
	for(int i = 0; i < a.size(); ++i){ \
		for(int j = 0; j < a[i].size(); ++j){ \
			cout << "(" << i <<"," <<j <<")" <<":" << a[i][j] <<" "; \
		} \
		cout << "\n"; \
	} \
	cout << "]"; \
}
#define op(a) { cout <<"[" << #a << ".fi:"<<a.first; \
					cout << " "<< #a << ".se:" << a.second <<"]"; }

using ll = long long;
const int mod = 1e9 + 7;
const ll INF = 1e18L + 5;
int n, m, k, q;

int main()
{
	fast();
	cin >> n >> m;
	vector<int> h(n);
	for(int i = 0; i < n; ++i){
		cin >> h[i];
	}
	vector<vector<int>> a(n);
	for(int i = 0; i < m; ++i){
		int x, y;
		cin >> x >> y;
		a[x - 1].push_back(y - 1);
		a[y - 1].push_back(x - 1);
	}
	int rs = 0;
	for(int i = 1; i <= n; ++i){
		int check = 0;
		for(auto x : a[i - 1]){
			if(h[x] >= h[i - 1]){
				check = 1;
			}
		}
		if(!check) rs ++;
	}
	cout << rs;
}			

Measured memory_bytes: 8744
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

import numpy as np

N,K = map(int,read().split())

def solve_even(N,K):
    L = N//2
    x = np.arange(K,K+N)
    y = np.concatenate([np.arange(K+L+N,K+L+N+L),np.arange(K+N,K+L+N)])
    add = N-(K+L)
    z = x + y + add
    z[L:] += 1
    answer = np.vstack([x,y,z]).T
    print('\n'.join(' '.join(row) for row in answer.astype(str)))

def solve_odd(N,K):
    L = N//2
    x = np.arange(K,K+N)
    y = np.concatenate([np.arange(K+L+N,K+L+N+L+1),np.arange(K+N,K+L+N)])
    add = N-(K+L)
    z = x + y + add
    answer = np.vstack([x,y,z]).T
    print('\n'.join(' '.join(row) for row in answer.astype(str)))

def solve(N,K):
    if K+K > N+1:
        print(-1)
        return
    if N&1:
        solve_odd(N,K)
    else:
        solve_even(N,K)

solve(N,K)

Measured memory_bytes: 59524
#include <bits/stdc++.h>
#include <unordered_map>
#include <queue>
#define MOD 1000000007
#define REP(i,st,num)for(int i=(st);i<(num);++i)
#define ll long long
using namespace std;

int d[100001];
int D, G, p[11], c[11],used[11];
int ans=9999999;

void solve(int now,int cnt) {
    if(ans<cnt)return;
    if(now>=G){
        if(cnt<ans)ans=cnt;
        return;
    }
    int spare=G-now;
    REP(i,0,D){
        if(used[i]==1)continue;
        if(p[i]*100*(i+1)+c[i]<=spare){
            used[i]=1;
            solve(now+(p[i]*100*(i+1))+c[i],cnt+p[i]);
            used[i]=0;
        }else{
            REP(j,1,p[i]+1){
                if(j==p[i]){
                    solve(now+(j*100*(i+1))+c[i],cnt+p[i]);
                }else if(spare<=j*100*(i+1)){
                    solve(now+j*100*(i+1),cnt+j);
                }
            }
        }
    }
}

int main() {
    ios::sync_with_stdio(false);
    cin>>D>>G;
    REP(i,0,D){
        cin>>p[i]>>c[i];
    }
    solve(0,0);
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>

int main() {
  int N;
  std::cin >> N;

  std::vector<int> A(N);

  for (int i = 0; i < N; i++) {
    std::cin >> A[i];
  }

  int planned_price = 0;

  for (int i = 0; i <= N; i++) {
    planned_price += std::abs(((i == N ? 0 : A[i]) - (i == 0 ? 0 : A[i-1])));
  }

  for (int i = 0; i < N; i++) {
    const int prev = (i == 0 ? 0 : A[i-1]);
    const int crnt = (i + 1 == N ? 0 : A[i+1]);

    std::cout << planned_price - std::abs(A[i] - prev) - std::abs(crnt - A[i]) + std::abs(crnt - prev) << std::endl;
  }
}


Measured memory_bytes: 1664
N = int(input())
a = []
for i in range(N):
  a.append(map(int,input().split()))
pt,px,py=0,0,0
for t,x,y in a:
  dt,dx,dy = t-pt,x-px,y-py
  if dt < abs(dx)+abs(dy):
    print("No")
    exit()
  if dt%2 != (abs(dx)+abs(dy))%2:
    print("No")
    exit()
  pt,px,py = t,x,y
print("Yes")

Measured memory_bytes: 48784
fn main() {
    let n = read_i64();
    let k = read_i64();
    let x = read_i64();
    let y = read_i64();
    println!("{}", solve(n, k, x, y));
}

fn solve(n: i64, k: i64, x: i64, y: i64) -> i64 {
    if (n <= k) {
        return n * x;
    } else {
        return k * x + (n - k) * y;
    }
}

fn read_i64() -> i64 {
    let mut buf = String::new();
    std::io::stdin().read_line(&mut buf);
    buf.trim().parse().unwrap()
}

Measured memory_bytes: 4352
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <utility>
#include <cmath>
using namespace std;
using ll = long long;
const int INF = 999999999;

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

    S[K-1] = tolower(S[K-1]);

    cout << S << endl;

}

Measured memory_bytes: 256
// D - Chat in a Circle
#include <bits/stdc++.h>
using namespace std;
#define rp(i,s,e) for(int i=(int)(s);i<(int)(e);++i)

int main(){
	int N; cin>>N;
	vector<int> A(N); rp(i, 0, N) cin>>A[i];
	sort(A.rbegin(), A.rend());
	int64_t ans = 0;
	queue<int> q({A[0]});
	rp(i, 1, N){
		ans += q.front(); q.pop();
		q.push(A[i]); q.push(A[i]);
	}
	cout<< ans <<endl;
}


Measured memory_bytes: 4852
#138_C
import heapq
n = int(input())
v = list(map(int, input().split()))
heapq.heapify(v)

for _ in range(n-1):
    x = heapq.heappop(v)
    y = heapq.heappop(v)
    heapq.heappush(v, (x+y)/2)
print(heapq.heappop(v))

Measured memory_bytes: 3060
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigInteger;
import java.util.*;


public class Main {

    static int mod = (int) 1e9 + 7;
    public static final long pow(long x, long n) {
        long sum = 1;
        while (n > 0) {
            if ((n & 1) == 1) {  //ビットが立っていたら
                sum *= x;        //x^2^k1 * x^2^k2 * x^2^k3 * ・・・
            }
            x *= x;              //((x^2)^2)^2・・・
            n >>= 1;
        }
        return sum;
    }

    public static final long modPow(long a,long n,long p) {
        if (n == 1) return a % p;
        if (n % 2 == 1) return (a * modPow(a, n - 1, p)) % p;
        long t = modPow(a, n / 2, p);
        return (t * t) % p;
    }

    static long fermatComb(long a, long b) {
        if (b > a - b)
            return fermatComb(a, a - b);
        long mul = 1; //分子
        long div = 1; //分母
        for (int i = 0; i < b; i++) {
            mul *= (a - i);
            mul %= mod;
            div *= (i + 1);
            div %= mod;
        }
        long ans = mul * modpow(div, mod - 2) % mod; //フェルマーの小定理を利用して掛け算で計算
        return ans;
    }

    //mod条件下の高速pow
    static long modpow(long a, long p) {
        if (p == 0)
            return 1;
        if (p % 2 == 0) {
            long root = modpow(a, p / 2);
            return root * root % mod;
        } else
            return a * modpow(a, p - 1) % mod;
    }

    public static boolean isPrime(int num) {
        if (num < 2) return false;
        else if (num == 2) return true;
        else if (num % 2 == 0) return false; // 偶数はあらかじめ除く

        double sqrtNum = Math.sqrt(num);
        for (int i = 3; i <= sqrtNum; i += 2)
        {
            if (num % i == 0)
            {
                // 素数ではない
                return false;
            }
        }

        // 素数である
        return true;
    }



    public static void main(String[] args){
	// write your code here
        int[] plist=new int[100001];
        plist[0] = 0;
        for(int i=1;i<=100000;i++){
            if(isPrime(i)&&isPrime((i+1)/2)){
                plist[i] = plist[i-1] + 1;
            }else{
                plist[i] = plist[i-1];
            }
        }
        Scanner sc= new Scanner(System.in);
        int Q=sc.nextInt();
        int[] result=new int[Q];
        for(int i=0;i<Q;i++){
            int res = 0;
            int l=sc.nextInt();
            int r=sc.nextInt();
            res = plist[r] - plist[l-1];
            result[i]=res;

        }
        for(int i=0;i<Q;i++){
            System.out.println(result[i]);
        }



    }
}


Measured memory_bytes: 67992
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int[] boads = new int[N];
		boolean allEven = true;

		for (int i = 0; i < N; i++) {
			boads[i] = sc.nextInt();
			if (boads[i] %2 != 0) {
				allEven = false;
			}
		}

		if (!allEven) {
			System.out.println(0);
		} else {
			for (int devideCount = 1; devideCount < boads[0]; devideCount++) {
				for (int boad : boads) {
					int result = boad;
					for (int j = 0; j < devideCount; j++) {
						result = result /2;
					}
					if (result%2 != 0) {
						System.out.println(devideCount);
						allEven = false;
						break;
					}
				}
				if (!allEven) {
					break;
				}

			}

		}

	}
}


Measured memory_bytes: 22996
#F
t1,t2 = map(int,input().split())
a1,a2 = map(int,input().split())
b1,b2 = map(int,input().split())
l1 = (a1-b1)*t1
l2 = (a2-b2)*t2

    
if (l1+l2)==0:
    print('infinity')
elif (l1)*(l1+l2)>0:
    print(0)
else:
    zure = abs(l1+l2)
    oitsuki = abs(l1)
    n = oitsuki//zure
    if n * zure == oitsuki:
        print(2*n)
    else:
        print(2*n+1)

Measured memory_bytes: 38344
#include <bits/stdc++.h>
#define INF (1<<30)
#define MOD 1000000007
#define l_ength size
using ll = long long;
using namespace std;

int main(){
	string str;
	cin >> str;
	if( str.l_ength() == 2 ){
		cout << str;
	} else {
		cout << str[2] << str[1] << str[0];
	}
	cout << endl;
	return 0;
}

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

using namespace std;
typedef long long ll;

ll read(){
	ll x = 0 , f = 1; char ch = getchar();
	while(ch < '0' || ch > '9'){if(ch == '-') f = -1; ch = getchar();}
	while(ch >= '0' && ch <= '9'){x = x * 10 + ch - '0'; ch = getchar();}
	return x * f;
}

ll A , B , C , K;

int main(){
	A = read(); B = read(); C = read(); K = read();
	if(K % 2){
		printf("%lld\n",B-A);
	}
	else{
		printf("%lld\n",A-B);
	}
	return 0;
}

Measured memory_bytes: 256
function Main(input) {
    var K = parseInt(input[0], 10)
    var A = parseInt(input[1], 10)
    var B = parseInt(input[2], 10)

    for (var i = A; i <= B; i++) {
        if (i % K === 0) {
            console.log('OK');
            return;
        }
    }
    console.log('NG');
}

Main(require("fs").readFileSync("/dev/stdin", "utf8").trim().split(/\n|\s/));

Measured memory_bytes: 29636
#include <bits/stdc++.h>
#define fastIO (cin.tie(0), cout.tie(0), ios::sync_with_stdio(false))
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define precise(i) fixed << setprecision(i)
using llint = long long int;
using namespace std;

int main() {
    fastIO;
    int n, d;
    cin >> n >> d;
    cout << ceil((double)n / (2 * d + 1));
}

Measured memory_bytes: 3760
/* بِسْمِ اللَّهِ الرَّحْمَٰنِ الرَّحِيمِ */
//codeforces
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
#define FASTIO ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
#define mp make_pair
#define pb push_back
#define sz(v) ((int)v.size())
#define all(v) v.begin(), v.end()
void parseArray(ll* A,ll n){ for ( ll K = 0; K < n; K++){ cin >> A[K]; } }
ll modInverse(ll a, ll b){ return 1<a ? b - modInverse(b%a, a)*b/a : 1; }
ll gcd(ll a, ll b){ return b?gcd(b, a % b):a; }
ll lcm(ll a, ll b){ return (a*b)/gcd(a, b); }
ld dist(ld x, ld y, ld a, ld b){ return sqrt((x-a)*(x-a) + (y-b)*(y-b)); }
void debug(ll* a, ll n) { for ( ll k = 0; k < n; k++ ){ cerr << a[k] << " ";} cout << "\n"; }
#define PI 3.14159265358979323846
ll n, m, p;
char g[11][1111];
const ll inf = 1e13;

int main(){
	FASTIO;
	cin >> n >> m >> p;
	for ( int k = 0; k < n; k++ )
		cin >> g[k];
	ll ans = n - 1 + m - 1;
	for ( int comb = 0; comb < (1 << (n - 1)); comb++ ){
		vector<ll> total;
		ll candidate = 0;
		bool valid = true;
		for ( int k = 0; k < m; k++ ){
			vector<ll> cnts;
			ll tmp = 0;
			valid = true;
			ll x = 0;
			for ( int j = 0; j < n; j++ ){
				tmp += g[j][k] == '1' ? 1 : 0;
				if (tmp > p) {
					valid = false;
					break;
				}
				if (comb & (1 << j)) {
					x++;
					cnts.pb(tmp);
					tmp = 0;
				}
			}
			cnts.pb(tmp);
			if (!valid) {
				candidate = inf;
				valid = false;
				break;
			}
			if (k == 0) {
				for (ll e : cnts)
					total.pb(0);
			}
			for ( int j = 0; j < sz(cnts); j++ ){
				if (total[j] + cnts[j] > p) {
					valid = false;
					break;
				}
			}
			if (valid) {
				for ( int j = 0; j < sz(cnts); j++ )
					total[j] += cnts[j];
			}else {
				candidate++;
				for ( int j = 0; j < sz(cnts); j++ )
					total[j] = cnts[j];
			}
		}
		ans = min(ans, candidate + __builtin_popcount(comb));
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>

using namespace std;

const int MOD = 1000000007;
long long fp(long long a, long long b){
	if(b==0)return 1;
	long long res = fp(a,b/2);
	res = (res*res)%MOD;
	if(b%2)res = (res*a)%MOD;
	return res;
}

long long re[100001];

int main(){
	
	cin.tie(0); ios_base::sync_with_stdio(0);
	int n,k;
	long long res = 0;
	cin>>n>>k;
	for(long long i = k;i>=1;i--){
		long long f = k/i;
		long long can = fp(f,n);
		can -=re[i];
		if(can<0)can+=MOD;
		res = (res+i*can)%MOD;
		for(long long j = 1;j*j<=i;j++)if(i%j==0){
			re[j] = (re[j] + can)%MOD;
			if(j!=i/j){
				re[i/j] = (re[i/j] + can)%MOD;
			}
		}
	}
	cout<<res<<endl;
	
	return 0;
}

Measured memory_bytes: 3972
import java.util.Scanner;

class Main {
    static char calc(String str, int index) {
        char answer = str.charAt(0);

        if (str.charAt(0) == '1') {
            int lastIndex = 0;
            for (int i = 1; i < str.length(); i++) {
                if (str.charAt(i) == '1') {
                    lastIndex = i;
                } else {
                    break;
                }
            }

            if (index - 1 <= lastIndex) {
                answer = '1';
            } else {
                answer = str.charAt(lastIndex + 1);
            }
        }

        return answer;
    }

    public static void main(String args[]) {
        String S;
        int K;

        Scanner sc = new Scanner(System.in);
        S = sc.next();
        String k_s = sc.next();
        K = k_s.length() > 3 ? 101 : Integer.valueOf(k_s);

        System.out.println(calc(S, K));
    }
}


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


/*
  let's try computer shogi!!!
 */


struct Qid{
  long int P;
  long int L;
};

bool comp(const Qid &q1, const Qid &q2){
  if(q1.P!=q2.P){
    return q1.P < q2.P;
  }else{
    return q1.L < q2.L;
  }
} 
  
int main(){
  vector<long int >Q;
  long int N;
  vector<Qid >QV;
  Q.resize(4);
  QV.resize(4);
  
  for(int i=0;i<4;++i){
    cin >> Q[i];
    QV[i].P = Q[i];
    QV[i].L = i;
  }

  cin >> N;
  N = N *4;

  QV[0].P = QV[0].P * 8;
  QV[1].P = QV[1].P * 4;
  QV[2].P = QV[2].P * 2;
  sort(QV.begin(),QV.end(),comp);
  
  for(int i=0;i<4;++i){
    cerr<<QV[i].P <<"," <<QV[i].L<<endl;
  }

  int ls[4] = {1,2,4,8};
  long int out = 0;
  for(int i=0;i<4;++i){
    out +=  Q[QV[i].L] * (N / ls[QV[i].L]);
    cerr << N<<"buy id " << QV[i].L <<","<<ls[QV[i].L] << " amount "<< N / ls[QV[i].L] <<endl;
    N = N % ls[QV[i].L];
  }
  cout<<out<<endl;
  return 0;
 
}

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

// 内部定数
#define D_DIM_CNT		2										// 次元数
#define D_LINE_CNT		100000									// 最大線数
#define D_MOD			(long long)1000000007					// 除数

// 内部変数 - テスト用
#ifdef D_TEST
	static int siRes;
	static FILE *szpFpT, *szpFpA;
#endif

// 実行メイン
int
fMain(
	int piTNo					// <I> テスト番号 1～
)
{
	int i, j;
	char lc1Buf[1024], lc1Out[1024];

	// テストファイルオープン
#ifdef D_TEST
	sprintf(lc1Buf, ".\\Test\\T%d.txt", piTNo);
	szpFpT = fopen(lc1Buf, "r");
	sprintf(lc1Buf, ".\\Test\\A%d.txt", piTNo);
	szpFpA = fopen(lc1Buf, "r");
	siRes = 0;
#endif

	// 本数取得
	int li1Cnt[D_DIM_CNT];
#ifdef D_TEST
	fgets(lc1Buf, sizeof(lc1Buf), szpFpT);
#else
	fgets(lc1Buf, sizeof(lc1Buf), stdin);
#endif
	sscanf(lc1Buf, "%d%d", &li1Cnt[0], &li1Cnt[1]);

	long long ll1Len[D_DIM_CNT];
	for (i = 0; i < D_DIM_CNT; i++) {

		// 直線位置 - 取得
		int li1Pos[D_LINE_CNT];
		for (j = 0; j < li1Cnt[i]; j++) {
#ifdef D_TEST
			fscanf(szpFpT, "%d", &li1Pos[j]);
#else
			fscanf(stdin, "%d", &li1Pos[j]);
#endif
		}

		// 長さ合計 - 初期化
		ll1Len[i] = 0;

		// 長さ合計 - 取得
		for (j = 0; j < li1Cnt[i]; j++) {

			// 右側(上側)
			ll1Len[i] += (long long)li1Pos[j] * (long long)j % D_MOD;
			ll1Len[i] %= D_MOD;

			// 左側(下側)
			ll1Len[i] -= (long long)li1Pos[j] * (long long)(li1Cnt[i] - j - 1) % D_MOD;
			ll1Len[i] %= D_MOD;
		}

#ifdef D_TEST
		fgets(lc1Buf, sizeof(lc1Buf), szpFpT);
#else
		fgets(lc1Buf, sizeof(lc1Buf), stdin);
#endif
	}

	// 合計面積
	long long llArea = ll1Len[0] * ll1Len[1] % D_MOD;
	if (llArea < 0) {
		llArea += D_MOD;
	}

	// 結果セット
	sprintf(lc1Out, "%lld\n", llArea);

	// 結果表示
#ifdef D_TEST
	fgets(lc1Buf, sizeof(lc1Buf), szpFpA);
	if (strcmp(lc1Buf, lc1Out)) {
		siRes = -1;
	}
#else
	printf("%s", lc1Out);
#endif

	// テストファイルクローズ
#ifdef D_TEST
	fclose(szpFpT);
	fclose(szpFpA);
#endif

	// テスト結果
#ifdef D_TEST
	if (siRes == 0) {
		printf("OK %d\n", piTNo);
	}
	else {
		printf("NG %d\n", piTNo);
	}
#endif

	return 0;
}

int
main()
{

#ifdef D_TEST
	int i;
	for (i = D_TEST_SNO; i <= D_TEST_ENO; i++) {
		fMain(i);
	}
#else
	fMain(0);
#endif

	return 0;
}



Measured memory_bytes: 512
n=int(input())
l=list(map(int,input().split()))
d=dict()
for v in l:
    if v in d:
        d[v]+=1
    else:
        d[v]=1
c=0
for k, v in d.items():
    if k<=v:
        c+=v-k
    else:
        c+=v
print(c)


Measured memory_bytes: 21664
#include<iostream>
#include<cstdio>
using namespace std;
int main(){
  int data_count[100]={0},num,max_count=0,p=0;
  while(scanf("%d",&num)!=EOF){
    data_count[num-1]++;
    p++;
  }
  for(int i=0;i<p;i++){
    if(max_count<data_count[i])max_count=data_count[i];
  }
  for(int i=0;i<p;i++){
    if(max_count==data_count[i]){
      cout<<i+1<<endl;
    }
  }
}
 

Measured memory_bytes: 1208
#include <vector>
#include <algorithm>
#include <map>
#include <unordered_map>
#include <iostream>

using namespace std;

int main() {
    int N, S, tmp;
    cin >> N;
    S = N;
    tmp = 0;
    do{
        tmp += S % 10;
    }while(S = S / 10);
    
    if(N % tmp == 0)
        cout << "Yes" << endl;
    else
        cout << "No" << endl;
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <climits>
#include <algorithm>
#include <cmath>
#include <map>
#include <set>
#include <string>
#include <bitset>
#include <utility>
#include <numeric>
#include <queue>
#include <stack>

using ll = long long;
using namespace std;

constexpr int MOD = 1e9 + 7;
constexpr ll MOD_LL = ll(1e9 + 7);

int main(void) {
	int k, x;
	cin >> k >> x;
	
	for(int i = x - k + 1; i < x + k; ++i) {
		cout << i << " ";
	}
	
	cout << endl;
	
	return 0;
}


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

int main(){

  string O, E;

  cin>>O>>E;

  if(O.size()-E.size()){
    for(int i=0;i<E.size();i++) cout<<O[i]<<E[i];
    cout<<O[O.size()-1]<<endl;
  }else{
    for(int i=0;i<E.size();i++) cout<<O[i]<<E[i];
    cout<<endl;
  }
  
  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define ld long double
#define LL_MAX LLONG_MAX
#define ULL_MAX ULLONG_MAX
#define ull unsigned long long
#define IOS ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
#define pb(x) push_back(x)
#define re() pop_back()
#define eb(x) emplace_back(x)
#define forn(i, n) for (int i = 0; i < int(n); ++i)
#define fore(i, l, r) for (int i = int(l); i < int(r); ++i)
#define all(a) a.begin(),a.end()
#define msort(a) sort(a.begin(),a.end())
#define pii pair<int,int>
#define sz(x) int(x.size())
#define mk make_pair
#define endl '\n'

void solve()
{
    int n;
    cin>>n;
    string s;
    cin>>s;
    int count=0;
    for (int i = 0; i < s.size(); i++)
    {
        if(s[i]=='R') count++;
        /* code */
    }

    int ans=0;

    for (int i = 0; i < count; i++)
    {
        if(s[i]=='W') ans++;
        /* code */
    }
    cout<<ans;
    
}

int main()
{
    IOS;
    ll t=1; //cin>>t;
    while (t--)
    {
        solve();
    }
}

Measured memory_bytes: 3736
#include <iostream>

int main()
{
  int A, B, C, X;
  std::cin >> A >> B >> C >> X;
  int ans = 0;

  for ( int i = 0; i <= A; i++ ) {
    for ( int j = 0; j <= B; j++ ) {
      int total = i * 500 + j * 100;
      int res = X - total;
      if ( res < 0 ) {
        break;
      }
      if ( res % 50 == 0 && res / 50 <= C ) {
        ans++;
      }
    }
  }

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


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

int main()
{
    int A, B, C, K;
    cin >> A >> B >> C >> K;
    int maximum = max(max(A, B), C);
    int ans = A + B + C - maximum;
    for (int i = 0; i < K; i++)
    {
        maximum *= 2;
    }
    cout << ans + maximum << endl;
}


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


int main(void){
    string s,t;
    cin>>s>>t;
    int dif=0;
    for (int i = 0; i < s.size(); i++)
    {
        if (s[i]!=t[i])
        {
            dif++;
        }
        
    }
    cout<<dif<<endl;
    return 0;
}

Measured memory_bytes: 3612
use std::io::Read;

fn main() {
    let mut buf = String::new();
    std::io::stdin().read_to_string(&mut buf).unwrap();

    let answer = solve(&buf);

    println!("{}", answer);
}

fn solve(input: &str) -> String {
    let mut iterator = input.split_whitespace();

    let n: usize = iterator.next().unwrap().parse().unwrap();
    let k: usize = iterator.next().unwrap().parse().unwrap();
    let h: Vec<usize> = (0..n).map(|_| iterator.next().unwrap().parse().unwrap()).collect();

    let count = h.iter().filter(|it| **it >= k).count();
    return count.to_string();
}


Measured memory_bytes: 3220
#include<bits/stdc++.h>
#define ll long long
#define int long long int
#define MOD 1000000007
#define mkp make_pair
#define maxn 100005
#define pb push_back
#define ff first
#define ss second
#define debug1(a) cout<<a<<endl;
#define debug2(a,b) cout<<a<<' '<<b<<endl;
#define debug3(a,b,c) cout<<a<<' '<<b<<' '<<c<<endl;
#define rep(i,n) for(int i=0;i<n;i++)
#define repl(i,a,b) for(int i=a;i<b;i++)
#define pi pair<int,int>
#define pii pair<int,pi>
#define mp map<int,int>
#define ump unordered_map<int,int>
#define  vi vector<int>
#define st set<int>
#define mst multiset<int>
#define pq priority_queue
#define mpq priority_queue<int,vector<int>,greater<int> >
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define in cin>>
#define out cout<<
using namespace std;
const int infi=1e9+7;
void printVector(vector<int> v){
    for(int i=0;i<(int)v.size();i++)
        cout<<v[i]<<" ";
    out endl;
}

void printArray(int arr[],int n)
{
   for(int i=0;i<n;i++)cout<<arr[i]<<' ';
cout<<endl;
}
 set<pair<int,int>> primeset;
 vi prime_number;
void SieveOfEratosthenes(int n)
{
    bool prime[n+1];
    memset(prime, true, sizeof(prime));

    for (int p=2; p*p<=n; p++)
    {
        if (prime[p] == true)
        {
        for (int i=p*p; i<=n; i += p)
                prime[i] = false;
        }
    }
    for (int p=2; p<=n; p++)
       if (prime[p])
           primeset.insert(mkp(p,1));
}
ll modExp(ll base, ll power) {
    if (power == 0) {
        return 1;
    } else {
        ll cur = modExp(base, power / 2); cur = cur * cur; cur = cur % MOD;
        if (power % 2 == 1) cur = cur * base;
        cur = cur % MOD;
        return cur;
    }
}
//for making unordered_map with pair
struct hash_pair {
    template <class T1, class T2>
    size_t operator()(const pair<T1, T2>& p) const
    {
        auto hash1 = hash<T1>{}(p.first);
        auto hash2 = hash<T2>{}(p.second);
        return hash1 ^ hash2;
    }
};
int32_t main()
{
fastio;
int t=1;
//in t;
int tt=1;
while(t--){
int n;in n;
int ans=(n/500)*1000;
n=n-(n/500)*500;
ans+=(n/5)*5;
out ans;
}
    return 0;
}

/*
google kick start
  cout << "Case #" << tt << ": "<<ans<<endl;
*/


Measured memory_bytes: 256
#include <stdio.h>

int main(){
	int N;
	scanf("%d",&N);
	int X[100001];
	int Y[100001];
	int T[100001];
	X[0]=0;
	Y[0]=0;
	T[0]=0;
	int i;
	for(i=1;i<=N;i++){
		scanf("%d",&T[i]);
		scanf("%d",&X[i]);
		scanf("%d",&Y[i]);
	}
	int c;
	c=0;
	int d;
	int t;
	for(i=1;i<=N;i++){
		d=(X[i]-X[i-1])+(Y[i]-Y[i-1]);
		t=T[i]-T[i-1];
		if(d>t){
			c=1;
			break;
		}
		if((t-d)%2!=0){
			c=1;
			break;
		}
	}
	if(c==0){
		printf("Yes");
	}else{
		printf("No");
	}
}

Measured memory_bytes: 1280
#include <iostream>
using namespace std;
int main(){
	int q1, b, c1, c2, q2;
	while(cin >> q1, q1) {
		cin >> b >> c1 >> c2 >> q2;
		int k1, k2;
		bool f = 1;
		k1 = b/c1;
		if(k1>q2) k1 = q2;
		for(int i = k1; i>0; --i) {
			k2 = (b-c1*i)/c2;
			if(i+k2>=q1) {
				cout << i << " " << k2 << endl;
				f = 0;
				break;
			}
		}
		if(f) cout << "NA" << endl;
	}
}

Measured memory_bytes: 1160
#include <bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(),(x).end()
#define YES() printf("YES\n")
#define NO() printf("NO\n")
#define isYES(x) printf("%s\n",(x) ? "YES" : "NO")
#define Yes() printf("Yes\n")
#define No() printf("No\n")
#define isYes(x) printf("%s\n",(x) ? "Yes" : "No")
#define isIn(x,y,h,w) (x >= 0 && x < h && y >= 0 && y < w)

#define int long long
//using ll = long long;
using P = pair<int,int>;

ostream &operator<<(ostream &os,const P &p){ return os << "(" << p.first << "," << p.second << ")"; }

template<class T> T &chmin(T &a,const T &b){ return a = min(a,b); }
template<class T> T &chmax(T &a,const T &b){ return a = max(a,b); }
 
const int INF=1e+18;
const double EPS=1e-9;
const int MOD=1000000007;

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

template<long long mod = 1000000007>
struct modint{
	long long a;

	modint() : a(0){}
	modint(long long t){
		a = t % mod;
		if(a < 0) a += mod;
	}

	operator long long() const{ return a; }

	bool operator==(const modint &x) const{ return a == x.a; }
	bool operator!=(const modint &x) const{ return a != x.a; }

	modint operator-() const{ return modint(a ? (mod - a) : 0); }
	modint operator~() const{ return pow(mod - 2); }

	modint operator+(const modint &x) const{ return modint(*this) += x; }
	modint operator-(const modint &x) const{ return modint(*this) -= x; }
	modint operator*(const modint &x) const{ return modint(*this) *= x; }
	modint operator/(const modint &x) const{ return modint(*this) /= x; }

	modint &operator+=(const modint &x){
		a += x.a;
		if(a >= mod) a -= mod;
		return *this;
	}
	modint &operator-=(const modint &x){
		a -= x.a;
		if(a < 0) a += mod;
		return *this;
	}
	modint &operator*=(const modint &x){
		a = a * x.a % mod;
		return *this;
	}
	modint &operator/=(const modint &x){
		a = a * (~x).a % mod; 
		return *this;
	}

	friend ostream &operator<<(ostream &os,const modint &x){
		return os << x.a;
	}
	friend istream &operator>>(istream &is,modint &x){
		long long t;
		is >> t;
		x = modint(t);
		return is;
	}

	modint pow(long long x) const{
		modint ret = 1,tmp = a;
		for(;x;tmp *= tmp,x >>= 1){
			if(x & 1) ret *= tmp;
		}
		return ret;
	}
};

vector<int> G[200010];
int n,vs[200010];
modint<> ans,zen;

void dfs(int v,int par){
	vs[v] = 1;
	ans += zen / modint<>(2);
	for(int to : G[v]){
		if(to == par) continue;
		dfs(to,v);
		ans -= modint<>(2).pow(vs[to]) - modint<>(1);
		vs[v] += vs[to];
	}
	ans -= modint<>(2).pow(n - vs[v]);
}

signed main(){
	cin >> n;
	zen = modint<>(2).pow(n);
	for(int i = 0;i < n - 1;i++){
		int a,b;
		cin >> a >> b; a--;b--;
		G[a].push_back(b);
		G[b].push_back(a);
	}
	dfs(0,-1);
	cout << ans / zen << endl;
}

Measured memory_bytes: 22016
#include <bits/stdc++.h>
using namespace std;
#define FOR(i, o, n) for (auto i = (o); (i) < (n); ++(i))
#define FOR1(i, n) FOR(i, 1, n+1)
#define REP(i, n) FOR(i, 0, n)
#define REPR(i, n) for (auto i = (n)-1; (i) >= 0; --i)
#define REPI(itr, v) for (auto itr = v.begin(); itr != v.end(); ++itr)
#define REPIR(itr, v) for (auto itr = v.rbegin(); itr != v.rend(); ++itr)
#define fi first
#define se second
#define ll long long
#define int long long
#define V2(name, h, w) vector<vector<int> > name((h), vector<int>(w));

#define dl(line) cerr << "RUN: until " << (line) << "th line." << endl
#define dv(name, value) cerr << (name) << " is " << (value) << endl
#define da(v)  cerr << "["; REPI(itr, v){cerr << *itr << (itr != --v.end() ? ", " : "");} cerr << "]" << endl


void solve(long long N, long long M){
  vector<int> v(105);
  FOR1(i, 101) {
    v.at(i+1) = v.at(i) + i;
  }
  cout << v.at(N) + v.at(M) << endl;
}

signed main(){
  long long N;
  scanf("%lld",&N);
  long long M;
  scanf("%lld",&M);
  solve(N, M);
}


Measured memory_bytes: 256