Prime Frequency

All submissions for this problem are available.
Ramakrishnan aka Ram loves prime numbers. He is always interested in solving and setting problems on primes. His brother Sanju has been given the responsibility of setting the problems for ITRIX Online Programming Contest. Sanju decides to set a problem on math for which he asked Ram to help him. If Ram gave a problem which impresses Sanju, Sanju will present him a gift. Ram loves gifts too. Ram also knows that Sanju loves arrays. So, he decided to create a problem using arrays and primes.
Ram introduces a new term called "Prime frequency". Prime frequency of a number is defined as the amount of contribution of prime numbers to that number. For example:
i) 2
Prime frequency of '2' is 1.
ii) 14
14 can be expressed as 2 * 7. Prime frequency of '14' is 2.
iii) 30
30 can be expressed as 2 * 3 * 5. Prime frequency of '30' is 3.
Note: Prime frequency of '1' is 0.
Product of an array is the product of all the numbers in the array.
Prime frequency of an array is defined as the prime frequency of the product of the array.
Ex: Array {2, 3, 5}
Product of the array = 2 * 3 * 5 = 30
Prime frequency of the array = Prime frequency of 30 = 3
Now the question which Ram puts forth is "Given an array, find the prime frequency of it."
Input
The first line consists of 't', the number of test cases.
The first line of each testcase consists of 'n', the number of elements in the array.
The second line of each testcase consists of the elements of the array.
Constraints
1 <= t <= 500
1 <= n <= 10^6
1 <= a[i] <= 10^5
Output
For each testcase, output a single line containing the required answer.
Example
Input: 2 3 2 3 5 4 2 4 6 8 Output: 3 8
Author:  lakshmi8 
Tags  lakshmi8 
Date Added:  19022016 
Time Limit:  1 sec 
Source Limit:  50000 Bytes 
Languages:  C, CPP14, JAVA, PYTH, PYTH 3.6, PYPY, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, SCALA, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, PERL6, SCM chicken, PYP3, CLOJ, FS 
Comments
 Please login at the top to post a comment.
SUCCESSFUL SUBMISSIONS
Fetching successful submissions
HELP
If you are still having problems, see a sample solution here. 