틀린 풀이
#include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <queue>
using namespace std;
typedef long long ll;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL); cout.tie(NULL);
int n;
cin >> n;
ll x;
cin >> x;
vector<ll> C;
int answer = 0;
for (int i = 0; i < n; i++) {
ll k;
cin >> k;
if (k >= x) answer++;
else C.push_back(k);
}
sort(C.begin(), C.end());
int remain = 0;
int l = 0; int r = C.size() - 1;
while (l < r) {
ll d1 = C[l];
ll d2 = C[r];
if ((d1 + d2) >= (x / 2)) {
answer++;
l++; r--;
}
else {
remain++;
l++;
}
}
if (l == r) remain++;
answer += (remain / 3);
cout << answer;
}