stablegradients/pie-gem5-bysrc huggingface dataset:
// Original C++ solution (slower):
#include <bits/stdc++.h>

using namespace std;



#define pb push_back

#define eb emplace_back

#define ff first

#define ss second

#define endl '\n'

#define int long long

typedef long long li;

const int N = 1e5 + 10;

int n;

int a[N];

int dp[N];

int k;

int solve(int i){



	if(i>=n-1)

		return 0;

	if(dp[i]!=INT_MAX)

		return dp[i];



//	dp[i] = abs(a[i] - a[i-1]) + solve(i+1);

	for(int j = 1 ; j <= k ; ++j){

		if(i+j>=n)

			break;

		dp[i] = min(dp[i] , abs(a[i]-a[i+j]) + solve(i+j));



	}

	return dp[i];

}

signed main(){

	cin>>n>>k;

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

		cin>>a[i];

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

		dp[i] = INT_MAX;

	//cout<<dp[0]<<" "<<dp[1]<<endl;

	cout<<solve(0)<<endl;

}

// Optimized solution to the same problem (faster):
#include <bits/stdc++.h>

using namespace std;



#define pb push_back

#define eb emplace_back

#define ff first

#define ss second

#define endl '\n'

#define boost ios::sync_with_stdio(false) ; cin.tie(NULL); cout.tie(NULL);

typedef long long li;

const int INF = 1e9 + 12;

#define int long long

const int N = 1e5 + 10;

int dp[N];

signed main(){



	int n,k;

	cin>>n>>k;

	int a[n];



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

		cin>>a[i];

	fill(dp,dp+n,INF);

	dp[0] = 0;

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



		for(int j = i + 1 ; j <= i+k ; ++j)

			if(j < n)

				dp[j] = min(dp[j] , dp[i] + abs(a[i]-a[j]));

	}



	cout<<dp[n-1]<<endl;

}

// Fastest known solution for this problem:
#include <iostream>

#include <array>

#include <vector>

#include <iomanip>

#include <string>

#include <cmath>

#include <array>

#include <algorithm>

#include <queue>

#include <map>

using namespace std;



typedef  pair<int,int> P;

typedef long long LL;



const LL  INF=1<<31;







int main(){

     int n,k;

     cin>>n>>k;

     int h[100000];

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

          cin>>h[i];

     }

     LL dp[100001];



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

           dp[i]=INF;

      }

            dp[0]=0;

            dp[1]=abs(h[0]-h[1]);







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

          dp[i]=dp[i-1]+abs(h[i-1]-h[i]);

          for(int j=2;j<=k;++j){



               if(j<=i)dp[i]=min(dp[i],dp[i-j]+abs(h[i-j]-h[i]));

          }

     }     



     cout<<dp[n-1]<<endl;





}
// Original C++ solution (slower):
#include <iostream>

#include <limits.h>

using namespace std;

int mod(int n)

{

	if(n>=0) return n;

	return -1*n;

}

int mini(int a, int b)

{

    if(a<b) return a;

    return b;

}

int cost3(int n, int h[], int k)

{

	int a[n],i;

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

		a[i] = INT_MAX;

	if(n==1)

		return 0;

	if(n==2)

		return mod(h[0]-h[1]);

	a[n-1]=0;

	a[n-2]=mod(h[n-1]-h[n-2]);

	for(i=n-3;i>=0;i--)

		for(int j = i+1;j<min(n,i+k+1);j++)

			a[i] = mini(a[i],mod(h[i]-h[j])+a[j]);

	return a[0];

}

 

int main()

{

	int n,k;

	cin >> n >> k;

	int i,h[n];

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

		cin >> h[i];

	cout << cost3(n,h,k);

	return 0;

}

// Optimized solution to the same problem (faster):
#include <cstdio>

#include <algorithm>

#include <vector>

using namespace std;

 

int n,dp[100005],a[100005],k; 

int main(){

	scanf("%d%d",&n,&k);

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

		scanf("%d",&a[i]);

	}

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

		dp[i]=dp[i-1]+abs(a[i]-a[i-1]);

		for (int j=max(1,i-k);j<i;j++){

			dp[i]=min(dp[i],dp[j]+abs(a[i]-a[j])); 

		}

	}

	printf("%d\n",dp[n]);

	return 0;

} 

// Fastest known solution for this problem:
#include <iostream>

#include <array>

#include <vector>

#include <iomanip>

#include <string>

#include <cmath>

#include <array>

#include <algorithm>

#include <queue>

#include <map>

using namespace std;



typedef  pair<int,int> P;

typedef long long LL;



const LL  INF=1<<31;







int main(){

     int n,k;

     cin>>n>>k;

     int h[100000];

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

          cin>>h[i];

     }

     LL dp[100001];



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

           dp[i]=INF;

      }

            dp[0]=0;

            dp[1]=abs(h[0]-h[1]);







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

          dp[i]=dp[i-1]+abs(h[i-1]-h[i]);

          for(int j=2;j<=k;++j){



               if(j<=i)dp[i]=min(dp[i],dp[i-j]+abs(h[i-j]-h[i]));

          }

     }     



     cout<<dp[n-1]<<endl;





}
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

int main(){

	int num[100005],k,ans=0;

	int n;

	cin>>n;

	cin>>k;

	for (int i=1;i<=n;i++)

	{

		cin>>num[i];

	}

	for (int i=1;i<=n;i++)

	{

		if(num[i]>=k)

		{

			ans++; 

		}

	}

	cout<<ans;

	return 0; 

}

// Optimized solution to the same problem (faster):
#include<stdio.h>

int main(){

	int i,m,k,t=0,cnt=0;

	scanf("%d %d",&m,&k);

	int a[m];

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

		scanf("%d",&a[i]);

	}

		for(i=0;i<m-1;i++){

		if(a[i]>a[i+1]){

			t=a[i+1];

			a[i+1]=a[i];

			a[i]=t;

		}

	}

	if(a[m-1]<k){

		printf("0");

	}else{

	

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

		if(a[i]>=k)

		cnt++;

	}

	printf("%d",cnt);

}

	return 0;

}

// Fastest known solution for this problem:
#include <bits/stdc++.h>

using namespace std ;

 

int main()

{

  int n , k , a , answer ;

  cin >> n >> k ;

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

  {

    cin >> a ;

    if(a >= k)

      answer++ ;

  }

  cout << answer << endl ;

}
// Original C++ solution (slower):
/*

the top of the losers

*/

#include <bits/stdc++.h>

#include <ext/pb_ds/assoc_container.hpp>

#include <ext/pb_ds/tree_policy.hpp>

#define sz(v)   ((int)(v).size())

#define  all(v)    ((v).begin()),((v).end())

#define  allr(v)    ((v).rbegin()),((v).rend())

#define   pb         push_back

#define   mp         make_pair

#define    Lcm(a,b)  ((a*b)/(__gcd(a,b)))

#define    X            real()

#define    Y            imag()

#define    clr(v,d)      memset( v, d ,sizeof(v))

#define   angle(n)      atan2((n.imag()),(n.real()))

#define   vec(a,b)       ((b)-(a))

#define   length(a)      hypot( (a.imag()),(a.real()) )

#define   normalize(a)      (a)/(length(a))

#define    dp(a,b)          (((conj(a))*(b)).real())

#define    cp(a,b)          (((conj(a))*(b)).imag())

#define    lengthsqrt(a)       dp(a,a)

#define    rotate0( a,ang)    ((a)*exp( point(0,ang) ))

#define    rotateA(about,p,ang)   (rotate0(vec(about,p),ang)+about)

#define    lcm(a,b)                ((a*b)/(__gcd(a,b)))

#define    reflection0(m,v)         (conj((v)/(m))*(m))

#define     reflectionA(m,v,p0)     (conj( (vec(p0,v))/(vec(p0,m)) ) * (vec(p0,m)) ) + p0

#define     same(p1,p2)               ( dp(  vec(p1,p2),vec(p1,p2)) < eps )

#define     point                    complex<double>

#define     point        complex<double>

#define    cp(a,b)          (((conj(a))*(b)).imag())

#define    PI  acos(-1)

typedef  long long     ll ;

typedef  unsigned long long     ull ;

const double eps= (1e-9);

using namespace std;

using namespace __gnu_pbds;

int dcmp(long double a,long double b){   return fabsl(a-b)<=eps ? 0: (a>b)? 1:-1  ;}

int getBit(ll num, int idx) {return ((num >> idx) & 1ll) == 1;}

int setBit1(int num, int idx) {return num | (1<<idx);}

ll setBit0(ll num, int idx) {return num & ~(1ll<<idx);}

ll flipBit(ll num, int idx) {return num ^ (1ll<<idx);}

int countNumBit1(int mask) {int ret=0; while (mask) 	{mask &= (mask-1);++ret;	}return ret;}

void GO(){ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);}





int main(){

      GO();

      int n,k;

      cin>>n>>k;

      int cnt=0;

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

        int no;

        cin>>no;

        if(no>=k)

            cnt++;

      }

      cout<<cnt<<endl;



}


// Optimized solution to the same problem (faster):
#include <stdio.h>



int main()

{

    int n,k,ans=0;

    scanf("%d%d",&n,&k);

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

    {

        int x;

        scanf("%d",&x);

        if(x>=k)ans++;

    }

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

    return 0;

}

// Fastest known solution for this problem:
#include <bits/stdc++.h>

using namespace std ;

 

int main()

{

  int n , k , a , answer ;

  cin >> n >> k ;

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

  {

    cin >> a ;

    if(a >= k)

      answer++ ;

  }

  cout << answer << endl ;

}
// Original C++ solution (slower):




#include <bits/stdc++.h>

#include <ext/pb_ds/assoc_container.hpp>

#include <ext/pb_ds/tree_policy.hpp>

using namespace std;

using namespace __gnu_pbds;

 

#define watch(x) cout<<(#x)<<"="<<(x)<<'\n'

#define mset(d,val) memset(d,val,sizeof(d))

#define setp(x) cout<<fixed<<setprecision(x)

#define forn(i,a,b) for(int i=a;i<b;i++)

#define fore(i,a,b) for(int i=a;i<=b;i++)

#define pb push_back

#define mp make_pair

#define F first

#define S second

#define INF ll(1e18)

#define MOD 998244353

#define pqueue priority_queue

#define fbo find_by_order

#define ook order_of_key

typedef long long ll;

typedef pair<ll,ll> ii;

typedef vector<ll> vi;

typedef vector<ii> vii;

typedef long double ld;

typedef tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update> pbds;

 

#define MAXN 1000000007

 

 

int main() {

	ios_base::sync_with_stdio(0); cin.tie(0);

	ll k,x;

	cin>>k>>x;

	if ((k+x)>=100001) {

		for (ll i=x-k+1;i<=100000;i++) {

			cout<<i<<' ';

		}

	}

	else {

		if ((x-k)<=-100000) {

			for (ll i=-100000;i<x+k;i++) {

				cout<<i<<' ';

			}

		}

		else {

			for (ll i=x-k+1;i<x+k;i++) {

				cout<<i<<' ';

			}

		}

	}

}


// Optimized solution to the same problem (faster):
////sfef

#include<stdio.h>

int main(){



int k,x,i,p,q,r;

scanf("%d %d",&k,&x);

p=(x-(k-1));

q=(x+(k-2));

r=(x+(k-1));

if(k==1)

{

    printf("%d",x);

}

else{

    for(i=p;i<=q;i++)    

    {

        printf("%d ",i);

    }

    printf("%d",r);

}



return 0;

}


// Fastest known solution for this problem:
#include <bits/stdc++.h>

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

using namespace std;



int main(void) {

	int k, x;

	cin >> k >> x;

	for (int i = x-k+1; i < x+k; i++) {

		if (i == x+k) cout << i << endl;

		else cout << i << " ";

	}

	return 0;

}
// Original C++ solution (slower):
#include <iostream>

#include <cstring>

#include <algorithm>

using namespace std;



int arr[105];

int ans[105];

int main() {

  int n;

  cin >> n;

  string f;

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

    cin >> arr[i];

  }



  int r = n;

  int cntr = 1;

  while (r > 0){

    int flag = -1;

    for (int i = r; i >= 1; i--){

      if (arr[i] == i){

        flag = i;

        break;

      }

    }

    if (flag == -1){

      cout << "-1" << endl;

      return 0;

    }

    ans[cntr] = flag;

    cntr++;

    for (int i = flag; i < r; i++){

      arr[i] = arr[i+1];

    }

    r--;

  }



  for (int i = n; i >= 1; i--){

    cout << ans[i] << endl;

  }



}

// Optimized solution to the same problem (faster):
#include<cstdio>



using namespace std;



int a[101];

int b[101];

int main(){

	int n;

	scanf("%d",&n);

	for(int i=1;i<=n;i++)

		scanf("%d",&a[i]);

	for(int i=n;i;i--){

		int o=0;

		for(int j=1;j<=i;j++)

			if(a[j]==j)o=j;

		if(o==0){

			printf("-1\n");

			return 0;

		}

		b[++b[0]]=o;

		for(int j=o;j<i;j++)

			a[j]=a[j+1];

	}

	for(int i=b[0];i;i--)

		printf("%d\n",b[i]);

}

// Fastest known solution for this problem:
#include <bits/stdc++.h>



#define CEIL(a,b) ((a) / (b) + ((a) % (b) == 0 ? 0 : 1))



using namespace std;

using ll = long long;

using pii = pair<int, int>;

using pipipii = pair<ll, pair<int, pii>>;



constexpr int MOD = 1'000'000'007;

constexpr int INF = 1'000'000'001;

constexpr ll LLINF = 4'000'000'000'000'000'001;

// constexpr int INF = 2147483647; // 2 * 1e9

// constexpr ll LLINF = 9223372036854775807; // 9 * 1e18



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

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



int main(){

    ios::sync_with_stdio(false);

    cin.tie(nullptr);

    cout << fixed << setprecision(10);

    int n;

    cin >> n;

    vector<int> b(n);

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

        cin >> b[i];

    }

    vector<int> ans(n);

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

        for(int j = (int)b.size() - 1; j >= 0; --j){

            if(j+1 == b[j]){

                ans[i] = j+1;

                b.erase(b.begin() + j);

                goto SUCCESS;

            }

        }

        cout << "-1\n";

        return 0;

        SUCCESS:;

    }

    for(int i = n-1; i >= 0; --i){

        cout << ans[i] << "\n";

    }

    return 0;

}
// Original C++ solution (slower):
#include <bits/stdc++.h>                  

#include <stdio.h>



#define f first

#define s second

#define pb push_back

#define ppb pop_back

#define mp make_pair



using namespace std;



typedef long long ll;

typedef long double ld;

typedef unsigned long long ull;



const int N = 1e5 + 123, inf = 1e9 + 123, mod = 1e9 + 7;

const ll INF = 1e18;



int dp[N], a[N];



int main() {

	cin.tie(0);

	cout.tie(0);

	ios_base::sync_with_stdio(0);

	int n, k;

	cin >> n >> k;

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

		cin >> a[i];

	}             

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

		dp[i] = inf;

	}

	dp[1] = 0;

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

		for (int j = 1; j <= min(i - 1, k); j++) {

			dp[i] = min(dp[i], dp[i - j] + abs(a[i] - a[i - j]));

		}

	}                                                

	cout << dp[n];

	return 0;       	

}                               

// Optimized solution to the same problem (faster):
#include<stdio.h>

#include<stdlib.h>

#include<math.h>





typedef long long ll;





ll *mem, *inp, dist, min_dist, N;

int k;



int main()

{

    ll i, j;

    scanf("%lld%d", &N, &k);



    mem =(ll*) malloc(N * sizeof(ll));

    inp =(ll*) malloc(N * sizeof(ll));



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

        scanf("%lld", inp+i);

    }



    *(mem+N-2) = llabs(*(inp+N-2) - *(inp+N-1));



    for(i = 3; i<=k+1 && i<=N; ++i)

        *(mem+N-i) = llabs(*(inp+N-i) - *(inp+N-1));



    for(i = N-(k+2); i>=0; --i){



        min_dist = llabs(*(inp+i) - *(inp+i+1)) + *(mem+i+1);

        for(j = 2; j<=k && i+j<N; ++j){

            dist = llabs(*(inp+i) - *(inp+i+j)) + *(mem+i+j);

            if (dist < min_dist) min_dist = dist;

        }



        *(mem+i) = min_dist;

    }



    printf("%lld\n", *mem);



    return 0;

}








// Fastest known solution for this problem:
#include <iostream>

#include <array>

#include <vector>

#include <iomanip>

#include <string>

#include <cmath>

#include <array>

#include <algorithm>

#include <queue>

#include <map>

using namespace std;



typedef  pair<int,int> P;

typedef long long LL;



const LL  INF=1<<31;







int main(){

     int n,k;

     cin>>n>>k;

     int h[100000];

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

          cin>>h[i];

     }

     LL dp[100001];



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

           dp[i]=INF;

      }

            dp[0]=0;

            dp[1]=abs(h[0]-h[1]);







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

          dp[i]=dp[i-1]+abs(h[i-1]-h[i]);

          for(int j=2;j<=k;++j){



               if(j<=i)dp[i]=min(dp[i],dp[i-j]+abs(h[i-j]-h[i]));

          }

     }     



     cout<<dp[n-1]<<endl;





}
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

#define ff first

#define ss second

#define ll long long int

#define pii pair<int,int>

#define pll pair<ll,ll>

#define mem(x) memset(x, 0, sizeof x)

#define mem1(x) memset(x, -1, sizeof x)

#define MX 100005

ll arr[MX], dp[MX],n;

//ll rec(ll i, ll score)

//{

//    if(i==n-1) return score;

//    else if(i>=n) return 1e9;

//    else if(dp[i]<score && dp[i]!=-1) return dp[i];

//    else if(!i || dp[i]==-1 || score<dp[i])

//    {

//        ll ret1=1e9, ret2=1e9;

//        if(i+1<=n-1) ret1= rec(i+1, score+llabs(arr[i+1]-arr[i]));

//        if(i+2<=n-1) ret2= rec(i+2, score+llabs(arr[i+2]-arr[i]));

//        return dp[i]=min(ret1,ret2);

//    }

//}

int main()

{

    ll i,j,k,l, m;

    scanf("%lld %lld",&n,&k);

    for(i=0; i<n; i++) scanf("%lld",&arr[i]);

    for(i=1; i<n; i++) dp[i]=1e9;

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

    {

        ll len=i+k;

        for(j=i+1; j<n && j<=len; j++)dp[j]=min(dp[j], dp[i]+llabs(arr[i]-arr[j]));

    }

    printf("%lld\n",dp[n-1]);

    return 0;

}


// Optimized solution to the same problem (faster):
#include<cstdio>

#include<cmath>

#include<algorithm>

using namespace std;

const int maxn=1e5 + 5;

int main()

{

	int dp[maxn];

	int h[maxn];

	int n,k;

	while(~scanf("%d %d",&n,&k)){

		for(int i=1;i<=n;i++)

			scanf("%d",&h[i]);

		dp[1] = 0;

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

	    	dp[i]=1e9;

			for(int j=1;j<=k;j++){

				if(i==j) break;

			    dp[i]=min(dp[i],dp[i-j]+abs(h[i-j]-h[i]));

				}

	}

	printf("%d\n",dp[n]);

	}

	return 0;

}


// Fastest known solution for this problem:
#include <iostream>

#include <array>

#include <vector>

#include <iomanip>

#include <string>

#include <cmath>

#include <array>

#include <algorithm>

#include <queue>

#include <map>

using namespace std;



typedef  pair<int,int> P;

typedef long long LL;



const LL  INF=1<<31;







int main(){

     int n,k;

     cin>>n>>k;

     int h[100000];

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

          cin>>h[i];

     }

     LL dp[100001];



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

           dp[i]=INF;

      }

            dp[0]=0;

            dp[1]=abs(h[0]-h[1]);







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

          dp[i]=dp[i-1]+abs(h[i-1]-h[i]);

          for(int j=2;j<=k;++j){



               if(j<=i)dp[i]=min(dp[i],dp[i-j]+abs(h[i-j]-h[i]));

          }

     }     



     cout<<dp[n-1]<<endl;





}
// Original C++ solution (slower):
#include<cstdio>

#include<iostream>

#include<cmath>

#include<stack>

#include<cstring>

#include<algorithm>

using namespace std;

int n,k;

int h[100005];

int dp[100005];



int main()

{

memset(dp, 0x3f ,sizeof dp);

scanf("%d %d",&n,&k);

for( int i = 1 ; i <= n ; i++) scanf("%d",&h[i]);

dp[1] = 0;

for( int i = 1 ; i <= n ; i++)

{

	for(int j = 1 ; j <= k; j++)

	dp[i+j] = min(dp[i+j],dp[i]+abs(h[i] - h[i+j]));

}

printf("%d",dp[n]);



	return 0;

}






// Optimized solution to the same problem (faster):
#include<cstdio>

#include<cmath>

#include<cstring>

#include<iostream>

#include<algorithm>

#include<cstdlib>

using namespace std;

int N,K,h[100005],dp[100005];

int main(){

	scanf("%d%d",&N,&K);

	for(int i = 1;i <= N;i++)

		scanf("%d",&h[i]);

	dp[1] = 0;dp[2] = abs(h[2] - h[1]);

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

		dp[i] = 0x3f3f3f3f;

		for(int j = K;j >= 1;j--){

		if(i-j>0)

			dp[i] = min(dp[i],dp[i-j]+abs(h[i]-h[i-j]));

		}

	}

	printf("%d\n",dp[N]);

	return 0;

}

// Fastest known solution for this problem:
#include <iostream>

#include <array>

#include <vector>

#include <iomanip>

#include <string>

#include <cmath>

#include <array>

#include <algorithm>

#include <queue>

#include <map>

using namespace std;



typedef  pair<int,int> P;

typedef long long LL;



const LL  INF=1<<31;







int main(){

     int n,k;

     cin>>n>>k;

     int h[100000];

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

          cin>>h[i];

     }

     LL dp[100001];



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

           dp[i]=INF;

      }

            dp[0]=0;

            dp[1]=abs(h[0]-h[1]);







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

          dp[i]=dp[i-1]+abs(h[i-1]-h[i]);

          for(int j=2;j<=k;++j){



               if(j<=i)dp[i]=min(dp[i],dp[i-j]+abs(h[i-j]-h[i]));

          }

     }     



     cout<<dp[n-1]<<endl;





}
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;



int n,k,h,sum;



int main()

{

	cin>>n>>k;

	

	for(int i=1; i<=n; i++)

		{

			cin>>h;

			if(h>=k)sum++;

		}

	

	cout<<sum<<endl;

	

	return 0;

}

// Optimized solution to the same problem (faster):
#include<stdio.h>

int main()

{

    int del[100000];

    int i,k,n,sum=0;

    scanf("%d",&n);

    scanf("%d",&k);

    for(i=1;i<=n;i++)

    {

        scanf("%d",&del[i]);

    }

    for(i=1;i<=n;i++)

    {

        if(del[i]>=k)

            sum++;

    }

    printf("%d",sum);

}


// Fastest known solution for this problem:
#include <bits/stdc++.h>

using namespace std ;

 

int main()

{

  int n , k , a , answer ;

  cin >> n >> k ;

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

  {

    cin >> a ;

    if(a >= k)

      answer++ ;

  }

  cout << answer << endl ;

}
// Original C++ solution (slower):
#include <bits/stdc++.h>



using namespace std;

#define ll long long int

#define X first

#define Y second

const int MAXN = 1e5 + 5;

ll n, dp[MAXN], arr[MAXN], k;



ll solve(int idx = 1)

{

	if (idx > n) return 0;



	ll &ret = dp[idx];

	if (~ret) return ret;

	ret = 0;



	if (idx < n) ret = solve(idx + 1) + abs(arr[idx] - arr[idx + 1]);

	for (int i = idx + 2; i <= min(idx + k, n); i++)

		ret = min(ret, solve(i) + abs(arr[idx] - arr[i]));



	return ret;

}



int main()

{

	cin >> n >> k;

	for (int i = 1; i <= n; i++)

		cin >> arr[i];

	memset(dp, -1, sizeof dp);

	cout << solve() << endl;

	return 0;

}

// Optimized solution to the same problem (faster):
#include <bits/stdc++.h>



using namespace std;

#define ll long long int

#define X first

#define Y second

const int MAXN = 1e5 + 5;

int n, dp[MAXN], arr[MAXN];





int main()

{

	int k;

	cin >> n >> k;

	for (int i = 1; i <= n; i++)

		cin >> arr[i];



	dp[1] = 0;

	dp[2] = abs(arr[1] - arr[2]);

	for (int i = 3; i <= n; i++)

	{

		dp[i] = 1e9 + 100;

		for (int j = i - 1; j >= max(1, i - k); j--)

			dp[i] = min(abs(arr[i] - arr[j]) + dp[j], dp[i]);

	}

	cout << dp[n] << endl;

	return 0;

}


// Fastest known solution for this problem:
#include <iostream>

#include <array>

#include <vector>

#include <iomanip>

#include <string>

#include <cmath>

#include <array>

#include <algorithm>

#include <queue>

#include <map>

using namespace std;



typedef  pair<int,int> P;

typedef long long LL;



const LL  INF=1<<31;







int main(){

     int n,k;

     cin>>n>>k;

     int h[100000];

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

          cin>>h[i];

     }

     LL dp[100001];



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

           dp[i]=INF;

      }

            dp[0]=0;

            dp[1]=abs(h[0]-h[1]);







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

          dp[i]=dp[i-1]+abs(h[i-1]-h[i]);

          for(int j=2;j<=k;++j){



               if(j<=i)dp[i]=min(dp[i],dp[i-j]+abs(h[i-j]-h[i]));

          }

     }     



     cout<<dp[n-1]<<endl;





}