King is getting ready for a war. He know his strengths and weeknesses so he is taking required number of soldiers with him. King can only defeat enemies with strongest and weakest power, and one soldier can only kill one enemy. Your task is to calculate that how many soldiers are required by king to take with him for the war.
First line of input contains T, number of test cases. First line of each test case consists of a single integer N, which denotes the number of soldiers in the enemies army. Second line of each test case consists of N space separated integers A1, A2,...,An representing the of power of soldiers of enemies army.
A single integer representing the number of soldiers, king will take with him for the war.
1 <= T <= 100
1 <= N <= 106
1 <= Ai <= 1018
1 2 5
If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.