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=1x = 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 nn people at the polling station. Each person brought a number aia_i. When the ii-th person enters the voting booth, they choose a candidate that is a divisor of the number aia_i. Let the chosen candidate be pip_i.

After everyone has voted, we get an array of votes [p1,p2,…,pn][p_1, p_2, \ldots, p_n].

Egor really likes the number xx and considers the voting ideal if x⋅lcm(p1,p2,…,pn)x \cdot {lcm}(p_1, p_2, \ldots, p_n)∗^{\text{∗}} = p1⋅p2⋅…⋅pnp_1 \cdot p_2 \cdot \ldots \cdot p_n. Help him find the number of different†^{\text{†}} arrays pp modulo 109+710^9 + 7 that are ideal.

∗^{\text{∗}}lcmlcm — least common multiple.

†^{\text{†}}Two arrays of votes are considered different if there exists an index ii where the two arrays have different elements.

这是该问题的简单版本。唯一的区别是 x=1x = 1。

在买完他最喜欢的汽水“Zola Cero”回家的路上,Egor 发现萨兰斯克正在举行“最佳数字”职位的选举。

投票站共有 nn 人。每人带了一个数字 aia_i。当第 ii 个人进入投票间时,他们选择一个能整除数字 aia_i 的候选人。设所选候选人为 pip_i。

所有人投票结束后,我们得到一个投票数组 [p1,p2,…,pn][p_1, p_2, \ldots, p_n]。

Egor 非常喜欢数字 xx,当满足 x⋅lcm(p1,p2,…,pn)x \cdot {lcm}(p_1, p_2, \ldots, p_n)∗^{\text{∗}} = p1⋅p2⋅…⋅pnp_1 \cdot p_2 \cdot \ldots \cdot p_n 时,他认为此次投票是理想的。请帮助他计算模 109+710^9 + 7 意义下,有多少种不同的†^{\text{†}} 理想投票数组 pp。

∗^{\text{∗}}lcmlcm — 最小公倍数。

†^{\text{†}}若存在某个下标 ii,使得两个投票数组在该位置上的元素不同,则认为这两个投票数组不同。

输入格式

The first line contains a single integer tt (1≤t≤1041 \leq t \leq 10^4) — the number of test cases.

Then tt test cases follow.

The first line of each test case contains two integers nn and xx (1≤n≤1051 \leq n \leq 10^5, x=1x = 1) — the number of voters at the polling station and Egor's favorite number.

The second line of each test case contains nn integers: a1,a2,…,ana_1, a_2, \dots, a_n (1≤ai≤5⋅1051 \leq a_i \leq 5 \cdot 10^5) — the numbers brought by the voters.

It is guaranteed that the sum of nn over all test cases does not exceed 10510^5.

第一行包含一个整数 tt(1≤t≤1041 \leq t \leq 10^4)——测试用例的数量。

接下来是 tt 个测试用例。

每个测试用例的第一行包含两个整数 nn 和 xx(1≤n≤1051 \leq n \leq 10^5,x=1x = 1)——投票站的选民人数以及 Egor 最喜欢的数字。

每个测试用例的第二行包含 nn 个整数:a1,a2,…,ana_1, a_2, \dots, a_n(1≤ai≤5⋅1051 \leq a_i \leq 5 \cdot 10^5)——各位选民所携带的数字。

保证所有测试用例中 nn 的总和不超过 10510^5。

输出格式

For each test case, output the number of ways modulo 109+710^9 + 7 to vote so that the resulting array of votes satisfies the condition.

对于每个测试用例,输出满足条件的投票方案数对 109+710^9 + 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测评打分。不知道怎么写?

首页