BETA
Count divisors of product of array elements
Submissions: 838   Accuracy:

17.52%

  Difficulty: Medium
       

Given an array with N elements, the task is to find the count of factors of a number X which is product of all array elements.

Input:
The first line of input contains an integer T denoting the number of test cases. Then T test cases follow. Each test case consists of two lines. First line of each test case contains an Integer N denoting size of array and the second line contains N space separated elements.

Output:
For each test case, print the count of factors of X in new line.

Constraints:
1<=T<=100
1<=N<=100
1<=A[i]<=100

Example:
Input:

2
3
2 4 6
3
3 5 7

Output:
10

8

Explanation:

Input : 2 4 6
Output : 10
2 * 4 * 6 = 48, the factors of 48 are 
1, 2, 3, 4, 6, 8, 12, 16, 24, 48 whose count is 10.

Input : 3 5 7
Output : 8
3 * 5 * 7 = 105, the factors of 105 are 
1, 3, 5, 7, 15, 21, 35, 105 whose count is 8.

** For More Input/Output Examples Use 'Expected Output' option **

Contributor: Arun Tyagi
Author: arun03


Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.