Help me in solving ELECTN problem

My issue

how to count the number of eligible voters from the given input.

My code

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

int main() {
	int T;
	cin>>T;
	
	while(T--){
	    int N,X;
	    cin>>N>>X;
	    
	    int array[N];
	    cin>> array[N];
	    
	    int eligible =0;
	    
	    if(array[N]>=X){
	     
	     eligible++;
	     
	     cout<< eligible<<endl;
	    }
	    
	}
	
	
	return 0;
}

Problem Link: Elections in Chefland Practice Coding Problem - CodeChef

@amanarora2105
refer following c++ code for better understanding of the logic

// HALA MADRID 2024 BEST
#include <bits/stdc++.h>
using namespace std;

int main() {
	int t;
	cin>>t;
	while(t--){
	    int n,age;  cin>>n>>age;
	    int count = 0;
	    for(int i=0;i<n;i++){
	        int a;  cin>>a;
	        if(a>=age) count++;
	    }
	    cout<<count<<endl;
	}
	return 0;
}