Phineas is Building a castle in his backyard to impress Isabella ( strange, isn't it? ). He has got everything delivered and ready. Even the ground floor has been finished. Now is time to make the upper part. This is where the things become interesting. As Ferb is sleeping in the house after a long day painting the fence (and you folks helped him, didn't ya!), Phineas has to do all the work himself. He is good at this, and all he wants you to do is operate the mini crane to lift the stones. Stones for the wall has been cut and ready waiting for you to lift them up.

Now we don't have Ferb to operate the mini crane, in which he is an expert, we got to do the job as quick as possible. We are given the maximum lifting capacity of the crane, and the weight of each stone. Since it's a mini crane, we cannot place more then 2 stones (of any possible size) at a time, or it will disturb the balance of the crane.
we need to find out in how many turns we can deliver the stones to Phineas, who is building the castle.

INPUT:
First line of input gives T, the number of test cases.
For each test case, first line gives M, the maximum lifting capacity of the crane.
first integer N of next line of each test case gives the number of stones, followed by N numbers, specifying the weight of individual stone X.

OUTPUT:
For each test case, print the minimum number of turns the crane is operated for all stones to be lifted.

CONSTRAINTS:
1 ≤ T ≤ 50
1 ≤ M ≤ 1000
1 ≤ N ≤ 1000

SAMPLE INPUT
1
50
3 28 22 48

SAMPLE OUTPUT
2

Explanation

In first turn, 28 and 22 will be lifted together. In second turn 48 will be lifted.
T = int(raw_input())
for i in range(0,T):
	M = int(raw_input())
	
	lst = map(int, raw_input().split())
	N= lst.pop(0)
	"""
	s = raw_input()
	lst = s.split()
	N = int(lst[0])
	lst.pop(0)
	"""
	lst.sort()
	
	j = N - 1
	i = 0
	res = 0
	while ( i <= j):
		if(int(lst[j]) > M):
				j -= 1
		elif(int(lst[i]) + int(lst[j]) > M):
				j -= 1
				res += 1
		else:
			i += 1
			j -= 1
			res += 1
			
	print res