#K42297. Minimum Deliveries

    ID: 27056 Type: Default 1000ms 256MiB

Minimum Deliveries

Minimum Deliveries

You are given a number of test cases T. For each test case, the first input is an integer n representing the number of customers, followed by n integers which denote the expected delivery times for each customer.

To satisfy a customer, a delivery must be made at their expected time. However, if multiple customers expect delivery at the same time, a single delivery can serve all of them. Thus, the minimum number of deliveries needed for each test case is equal to the number of distinct delivery times.

This can be mathematically expressed as:

\[ D = \left| \{ a_1, a_2, \ldots, a_n \} \right| \]

where \(a_1, a_2, \ldots, a_n\) are the delivery times for the customers.

inputFormat

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

T
n
a1 a2 ... an
... (repeated T times)

Where:

  • T is the number of test cases.
  • For each test case, n denotes the number of customers, followed by n space-separated integers representing the expected delivery times.

outputFormat

For each test case, output a single integer on a new line: the minimum number of deliveries required (i.e. the count of distinct expected delivery times).

## sample
1
3
1 2 3
3

</p>