[原创]“玲珑杯”ACM比赛 Round #9 A – Check-in Problem [因子个数]【数论】

2017-02-10 21:31:20 Tabris_ 阅读数：440

https://blog.csdn.net/qq_33184171/article/details/54974236

----------------------------------------------------------------------------------------------------------.
A – Check-in Problem
Time Limit：5s Memory Limit：128MByte

Submissions：921 Solved：55

DESCRIPTION

A positive integer x is called p-bizarre number if the number of the divisors of x is p exactly.
Your task is testing whether the given positive integer n is a p-bizarre number or not.

INPUT

The first line contains a positive integer T, which represents there are T test cases.
The following is test cases. For each test case:
The only one line contains a positive integer n and an odd prime p.
1≤T≤10^5,1≤n≤10^18,2< p≤10^9

OUTPUT

For each test case, output in one line, print “YES” (without quote) if n is a p-bizarre number, print “NO” (without quote) otherwise.

SAMPLE INPUT

3
9 3
971528476274196481 7
150094635296999121 37

SAMPLE OUTPUT
YES
NO
YES
----------------------------------------------------------------------------------------------------------.

$n = p_1^{a_1}\times p_2^{a_2}\times p_3^{a_3}\times ...\times p_r^{a_r}$

input里面又说
The only one line contains a positive integer n and an odd prime p.

----------------------------------------------------------------------------------------------------------.