#C9340. Minimum Watering Days

    ID: 53423 Type: Default 1000ms 256MiB

Minimum Watering Days

Minimum Watering Days

You are given several test cases. In each test case, there are N plants, and each plant requires a specific amount of water. The watering machine can water any number of plants in one day provided that they all require the same amount of water.

Your task is to determine the minimum number of days required to water all the plants exactly. It turns out that the minimum number of days is equal to the number of distinct water requirements among the plants. In other words, if the water requirements in a test case are given by the list \(a_1, a_2, \dots, a_N\), then the answer is:

\(\text{days} = |\{a_1, a_2, \dots, a_N\}|\)

Note: The input is provided via stdin and the solution should output the answer for each test case to stdout on separate lines.

inputFormat

The first number in the input is \(T\), the number of test cases. Each test case is described as follows:

  • An integer \(N\) representing the number of plants.
  • \(N\) integers representing the water amount required by each plant.

This input is read from stdin and all numbers are space or newline separated.

outputFormat

For each test case, output a single integer on a new line representing the minimum number of days required to water all plants exactly.

This output should be written to stdout.

## sample
3
4
10 15 20 25
3
7 14 21
6
2 2 2 2 2 2
4

3 1

</p>