编程介的小学生 2017-10-27 15:59 采纳率: 0.4%
浏览 831
已采纳

All Kill

Problem Description
Give nonnegative integers x1…n which are less than 32677, calculate yi,j=xi×xjmod32677. HazelFan wants to know how many sextuples (a,b,c,d,e,f) are there, satisfies gcd(ya,b,yc,d)=gcd(yc,d,ye,f)=gcd(ye,f,ya,b)=1, module 230.

Input
The first line contains a positive integer T(1≤T≤5), denoting the number of test cases.
For each test case:
The first line contains a positive integer n(1≤n≤2×105).
The second line contains n nonnegative integers x1...n(0≤xi<32677).

Output
For each test case:
A single line contains a nonnegative integer, denoting the answer.

Sample Input
2
1
1
5
1 2 3 4 5

Sample Output
1
1087

  • 写回答

1条回答 默认 最新

  • threenewbee 2017-11-14 10:43
    关注
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?