Problem
- You are given an array A of length N.
A pair is said to be good if . Here GCD denotes the greatest common divisor and LCM denotes Least Common Multiple
- Find the total number of good pairs present in the given array.
Input Format
- The first line of input will contain a single integer T, denoting the number of test cases.
- The first line of each test case contains an integer N- the length of the array A.
- The second line of each test case contains N space-separated integers A1,A2,....AN
Output Format
- For each test case, output on a new line the total number of such good pairs possible in the given array.
Constraints
- The sum of over all test cases won't exceed .
Input
- 5 2 5 9 5 1 5 5 5 9 8 2 5 5 2 9 9 9 12 4 12 12 18 18 5 12 15 10 5 9
Output
- 0 3 5 2 0
Explanation:
Test case : No good pair is present.
Test case : The good pairs are: and . To elaborate, .
Test case : The good pairs are: and . To elaborate, .
Test case : The good pair are: and . To elaborate, .
Test case : No good pair is present.