Solution to the problem number 234 of AceptaelReto - 234.

Any questions do not hesitate to contact.

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

int main()
{
    int cases; cin>>cases;
    while(cases--)
    {
       int n,v; cin>>n>>v;
       int arr[n];
       for(int i=0; i<n;i++) cin>>arr[i];
       sort(arr,arr+n);
       int r = n-1,res=0;
       for(int i=0; i<n && i<r;i++)
            if(arr[i]+arr[r]>=v) { res++; r--; }
       cout<<res<<'\n';
    }
return 0;
}

Don't miss anything.

Keep in touch with Isaac Lozano Osorio!