repl不讓我存哭哭
#include <bits/stdc++.h>
using namespace std;
int main(){
int x, n, count = 0;
cin >> x >> n;
int a[n];
for(int i = 0;i < n;i++){
cin >> a[i];
}
sort(a,a+n);
for(int i = 0;i < n;i++){
if(a[i] < x){
count++;
}
}
for(int i = 0;i < n;i++){
if(count > n-count){//往左走比較多
cout << count << " " << a[0];
break;
}
else{
cout << n-count << " " << a[n-1];
break;
}
}
return 0;
}