Responsive image

问题 1856 --All Kill

1856: All Kill

时间限制: 8 Sec  内存限制: 128 MB
提交: 2  解决: 2
[提交][状态][讨论版][命题人:]

题目描述

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.
 

输入描述

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).
 

输出描述

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

样例输入

2
1
1
5
1 2 3 4 5

样例输出

1
1087

来源

 

[提交][状态]
ACM算法攻关部
  • Anything about this OnlineJudge, Please Contact Administrator. Click add QQ

    OJ system based on HUSTOJ Project , UI based on Twitter Bootstrap

    Copyright 2016 ACM算法攻关部
    关于网站改版