#C5669. Distinct Prime Factors
Distinct Prime Factors
Distinct Prime Factors
You are given a list of integers. For each test case, your task is to compute the number of distinct prime factors that compose the product of the given integers. In other words, if the product is \(P = a_1 \times a_2 \times \cdots \times a_n\), you need to count the number of distinct prime numbers that divide \(P\).
Note: If an element is 1, it does not contribute any prime factor. The input is given in multiple test cases, and each test case should be processed separately.
Example:
Input: 1 5 2 3 5 7 11</p>Output: 5
inputFormat
The input is read from standard input.
The first line contains an integer \(T\) representing the number of test cases. For each test case:
- The first line contains an integer \(N\) representing the number of elements in the array.
- The next line contains \(N\) space-separated integers.
outputFormat
For each test case, output a single integer on a new line representing the number of distinct prime factors of the product of the array elements.
## sample2
3
2 4 8
3
3 5 10
1
3
</p>