409607: GYM103643 J P=NP Revisited
Description
After chessbot bugged PurpleCrayon for too long to share the proof for P=NP, PurpleCrayon decided to leave the team! Now he has to find good and original problem ideas and flavor text...
However, it seems that most participants from the last contest found $$$P=NP$$$ to be too easy, so chessbot has buffed the problem to be harder!
Define $$$F(x, y)$$$ as the total number of pairs $$$n, p$$$ $$$(0 \leq n \leq x, 0 \leq p \leq y)$$$ such that $$$p = n \cdot p$$$.
Chessbot wants you to find $$$\prod_{i = 1}^{N} \prod_{j = 1}^{P} F(i, j)$$$ for a given $$$N, P$$$. Since this number may be very large, please find it modulo $$$10^9 +7$$$.
InputThe first line containers an integer $$$T$$$ $$$(1 \leq T \leq 10^4)$$$. Each of the next $$$T$$$ lines contains two integers $$$N, P$$$ $$$(1 \leq N, P \leq 3 \cdot 10^5)$$$ corresponding product chessbot wants you to compute. It is guaranteed that the sum of $$$N$$$ does not exceed $$$3 \cdot 10^5$$$ and that the sum of $$$P$$$ does not exceed $$$3 \cdot 10^5$$$.
OutputOutput $$$T$$$ lines, one integer per line, denoting the desired product modulo $$$10^9 +7$$$.
ExampleInput3 1 1 2 2 33 66Output
3 240 387366933Note
$$$F(1, 1) = 3$$$ for pairs $$$(0, 0), (1, 0), (1, 1)$$$. So the answer for the first testcase is $$$3$$$.
$$$F(1, 1) = 3, F(2, 1) = 4, F(1, 2) = 4, F(2, 2) = 5$$$. The product for those $$$4$$$ numbers is $$$240$$$ which is the answer.
$$$---------------------------------------------$$$
Problem idea: 3366
Problem preparation: 3366
Occurrences: Novice 9, Intermediate 4