O-Factorial
You are given an array of positive integers: A = (A1, A2, .... An).
Your task is to find the maximum possible X such that the product of all numbers from A is equal to X! * Y, for some positive integer Y.
InputIn the first line you are given the number of test cases T (T <= 10).
Next, T pairs of lines follow. In the first line of each pair there is an integer N (1 <= N <= 100000) - the number of integers in A. In the second line you are given the elements of A : Ai (1 <= Ai <= 100000).
Next, T pairs of lines follow. In the first line of each pair there is an integer N (1 <= N <= 100000) - the number of integers in A. In the second line you are given the elements of A : Ai (1 <= Ai <= 100000).
OutputFor every test case, in a separate line, print the maximum possible X.
Input:
3
5
1 2 6 60 56
6
11 19 43 6 13 25
1
24Output:
8
3
4Explanation
Test 1 : The product of all numbers is 40320 or 8! * 1, so the answer is 8.
Test 2 : The product of all numbers is 17524650 or 3! * 2920775 so the answer is 3.
Test 3 : 24 or 4!*1 so the answer is 4.
Submit solution
Coming laterThe grading service will be connected in a later migration step. You can inspect the task and your previous results now.