#P5973. [PA 2013] Iloczyn
[PA 2013] Iloczyn
Problem Description
Given positive integers and , determine whether can be factored into a product of distinct positive integers.
Input Format
The first line contains an integer , the number of test cases.
The next lines each contain two integers .
Output Format
Output lines. If can be factored as required, output TAK; otherwise output NIE.
3
15 2
24 4
24 5
TAK
TAK
NIE
Hint
Constraints: for of the testdata, , , .
Translated by ChatGPT 5