CF893E.Counting Arrays
普及+/提高
通过率:0%
时间限制:3.00s
内存限制:256MB
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
You are given two positive integer numbers x and y. An array F is called an y-factorization of x iff the following conditions are met:
- There are y elements in F, and all of them are integer numbers;
.
You have to count the number of pairwise distinct arrays that are y-factorizations of x. Two arrays A and B are considered different iff there exists at least one index i (1 ≤ i ≤ y) such that A__i ≠ B__i. Since the answer can be very large, print it modulo 109 + 7.
给你两个正整数 x 和 y。若数组 F 满足以下条件,则称其为 x 的一个 y-因式分解(y-factorization):
- F 中恰好包含 y 个元素,且所有元素均为整数;
。
你需要计算 x 的互不相同的 y-因式分解数组的个数。两个数组 A 和 B 被视为不同,当且仅当存在至少一个下标 i(满足 1≤i≤y),使得 Ai=Bi。由于答案可能非常大,请将结果对 109+7 取模后输出。
输入格式
The first line contains one integer q (1 ≤ q ≤ 105) — the number of testcases to solve.
Then q lines follow, each containing two integers x__i and y__i (1 ≤ x__i, y__i ≤ 106). Each of these lines represents a testcase.
第一行包含一个整数 q(1≤q≤105)—— 表示需要处理的测试用例数量。
接下来是 q 行,每行包含两个整数 xi 和 yi(1≤xi,yi≤106)。每一行代表一个测试用例。
输出格式
Print q integers. i-th integer has to be equal to the number of y__i-factorizations of x__i modulo 109 + 7.
输出 q 个整数。其中第 i 个整数必须等于 x__i 的 y__i-因子分解的个数对 109+7 取模的结果。
输入输出样例
输入#1
2 6 3 4 2
输出#1
36 6
说明/提示
In the second testcase of the example there are six y-factorizations:
- { - 4, - 1};
- { - 2, - 2};
- { - 1, - 4};
- {1, 4};
- {2, 2};
- {4, 1}.
在示例的第二个测试用例中,共有六种 y-分解:
- { - 4, - 1};
- { - 2, - 2};
- { - 1, - 4};
- {1, 4};
- {2, 2};
- {4, 1}。
输入解题思路,AI测评打分。不知道怎么写?