#K84287. Minimal Operations

    ID: 36386 Type: Default 1000ms 256MiB

Minimal Operations

Minimal Operations

You are given an array of integers and your task is to determine the minimum number of operations required to make the array "good". An array is considered good if all its elements are non-positive (i.e. less than or equal to zero).

In one operation, you can remove one positive integer from the array. However, if the same positive number appears multiple times, it only counts as a single unique operation. Thus, the minimum number of operations required is exactly the number of unique positive integers in the array.

Example:

Input:
3
4
1 2 4 3
5
0 0 0 0 0
6
0 5 10 15 20 25

Output: 4 0 5

</p>

In the first test case, the array [1, 2, 4, 3] has 4 unique positive numbers, so the answer is 4. In the second test case, there are no positive numbers, so the answer is 0. In the third test case, there are 5 unique positive numbers, so the answer is 5.

inputFormat

The input is read from standard input (stdin) and has the following format:

  • The first line contains an integer T denoting the number of test cases.
  • For each test case, the first line contains an integer n — the size of the array.
  • The second line contains n space-separated integers representing the array elements.

outputFormat

For each test case, output a single integer on a new line — the minimum number of operations required (i.e. the number of unique positive integers in the array).

## sample
3
4
1 2 4 3
5
0 0 0 0 0
6
0 5 10 15 20 25
4

0 5

</p>