CF2236F1.Elections in Saransk (easy version)
普及+/提高
通过率:0%
时间限制:4.00s
内存限制:256MB
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
This is the easy version of the problem. The only difference is that x=1
On the way home after buying his favorite soda "Zola Cero", Egor saw that elections for the position of "Best Number" are taking place in Saransk.
There are n people at the polling station. Each person brought a number ai. When the i-th person enters the voting booth, they choose a candidate that is a divisor of the number ai. Let the chosen candidate be pi.
After everyone has voted, we get an array of votes [p1,p2,…,pn].
Egor really likes the number x and considers the voting ideal if x⋅lcm(p1,p2,…,pn)∗ = p1⋅p2⋅…⋅pn. Help him find the number of different† arrays p modulo 109+7 that are ideal.
∗lcm — least common multiple.
†Two arrays of votes are considered different if there exists an index i where the two arrays have different elements.
这是该问题的简单版本。唯一的区别是 x=1。
在买完他最喜欢的汽水“Zola Cero”回家的路上,Egor 发现萨兰斯克正在举行“最佳数字”职位的选举。
投票站共有 n 人。每人带了一个数字 ai。当第 i 个人进入投票间时,他们选择一个能整除数字 ai 的候选人。设所选候选人为 pi。
所有人投票结束后,我们得到一个投票数组 [p1,p2,…,pn]。
Egor 非常喜欢数字 x,当满足 x⋅lcm(p1,p2,…,pn)∗ = p1⋅p2⋅…⋅pn 时,他认为此次投票是理想的。请帮助他计算模 109+7 意义下,有多少种不同的† 理想投票数组 p。
∗lcm — 最小公倍数。
†若存在某个下标 i,使得两个投票数组在该位置上的元素不同,则认为这两个投票数组不同。
输入格式
The first line contains a single integer t (1≤t≤104) — the number of test cases.
Then t test cases follow.
The first line of each test case contains two integers n and x (1≤n≤105, x=1) — the number of voters at the polling station and Egor's favorite number.
The second line of each test case contains n integers: a1,a2,…,an (1≤ai≤5⋅105) — the numbers brought by the voters.
It is guaranteed that the sum of n over all test cases does not exceed 105.
第一行包含一个整数 t(1≤t≤104)——测试用例的数量。
接下来是 t 个测试用例。
每个测试用例的第一行包含两个整数 n 和 x(1≤n≤105,x=1)——投票站的选民人数以及 Egor 最喜欢的数字。
每个测试用例的第二行包含 n 个整数:a1,a2,…,an(1≤ai≤5⋅105)——各位选民所携带的数字。
保证所有测试用例中 n 的总和不超过 105。
输出格式
For each test case, output the number of ways modulo 109+7 to vote so that the resulting array of votes satisfies the condition.
对于每个测试用例,输出满足条件的投票方案数对 109+7 取模的结果。
输入输出样例
输入#1
4 4 1 2 3 1 4 2 1 2 4 6 1 3 9 1 6 4 5 7 1 1 2 3 67 13 8 8
输出#1
8 4 40 64
说明/提示
null
输入解题思路,AI测评打分。不知道怎么写?