#P8778. [蓝桥杯 2022 省 A] 数的拆分
[蓝桥杯 2022 省 A] 数的拆分
Problem Description
Given positive integers , for each determine whether it can be written in the form , where are positive integers, and are integers with and .
Input Format
The first line contains an integer , representing the number of queries.
The next lines each contain a positive integer .
Output Format
For each query, if can be written in the form described in the statement, output yes; otherwise output no.
7
2
6
12
4
8
24
72
no
no
no
yes
yes
no
yes
Hint
Sample Explanation
The th, th, and th numbers can be written as:
$$\begin{aligned} &a_{4}=2^{2} \times 1^{2} ; \\ &a_{5}=2^{3} \times 1^{2} ; \\ &a_{7}=2^{3} \times 3^{2} 。 \end{aligned}$$Constraints and Notes
For of the testdata, .
For of the testdata, .
For of the testdata, .
For all testdata, .
Lanqiao Cup 2022 Provincial Contest, Group A, Problem I.
Translated by ChatGPT 5