|
||||||||||
TripleTime Limit: 5000/3000 MS (Java/Others) Memory Limit: 125536/65536 K (Java/Others)Total Submission(s): 2110 Accepted Submission(s): 817 Problem Description Given many different integers, find out the number of triples (a, b, c) which satisfy a, b, c are co-primed each other or are not co-primed each other. In a triple, (a, b, c) and (b, a, c) are considered as same triple. Input The first line contains a single integer T (T <= 15), indicating the number of test cases. In each case, the first line contains one integer n (3 <= n <= 800), second line contains n different integers d (2 <= d < 105) separated with space. Output For each test case, output an integer in one line, indicating the number of triples. Sample Input
Sample Output
Source | ||||||||||
|