MJs Boast

Problem Statement

There are N students in a class, where the ith student has a score of Ai.

The ath student will boast if and only if the number of students scoring less than or equal Ai, is greater than the number of students scoring greater than Ai.

Find the number of students who will boast.

Input Format

  • The first line contains T the number of test cases. Then the test cases follow.
  • The first line of each test case contains a single integer N the number of students.
  • The second line of each test case contains N integers A1 A2 AN the scores of the students.

Output Format

  • For each test case, output in a single line the number of students who will boast.

Constraints

  • 1 ≤ T ≤ 1000
  • 1 ≤ N ≤ 100000
  • 1 ≤ Ai ≤ 1000000
Sample Input
Sample Output

Solution

Solution Not Available

Comments

Load Comments