当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

5656:CA Loves GCD

题目描述
CA is a fine comrade who loves the party and people; inevitably she loves GCD (greatest common divisor) too.
Now, there are $N$ different numbers. Each time, CA will select several numbers (at least one), and find the GCD of these numbers. In order to have fun, CA will try every selection. After that, she wants to know the sum of all GCDs.
If and only if there is a number exists in a selection, but does not exist in another one, we think these two selections are different from each other.
输入解释
First line contains $T$ denoting the number of testcases.
$T$ testcases follow. Each testcase contains a integer in the first time, denoting $N$, the number of the numbers CA have. The second line is $N$ numbers.
We guarantee that all numbers in the test are in the range [1,1000].
$1 \le T \le 50$
输出解释
$T$ lines, each line prints the sum of GCDs mod $100000007$.
输入样例
2
2
2 4
3
1 2 3
输出样例
8
10
来自杭电HDUOJ的附加信息
Recommend wange2014

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-5656

最后修改于 2020-10-25T23:24:34+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
6000/3000MS(Java/Others) 262144/262144K(Java/Others)