http://acm.nyist.net/JudgeOnline/problem.php?pid=71
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<set>
#include<iterator>
using namespace std;
int main()
{
int t;
scanf("%d",&t);
int arr[310];
while(t--)
{
int n,val,temp;
scanf("%d%d",&val,&n);
for(int i=1;i<=n;i++)
{
scanf("%d",arr+i);
}
sort(arr+1,arr+n+1);
int sum=n;
for(int i=1,k=n;i<k;)
{
if(arr[i]+arr[k]<=val)
{
i++;
k--;
sum--;
}
else {
k--;
}
}
printf("%d\n",sum);
}
}