#P9473. [yLOI2022] 西施江南
[yLOI2022] 西施江南
Background
When I face Jiangnan, it is like meeting Xishi’s face.
A clear fragrance should be sent to the shore; lotus flowers are before the fresh rain.
Bright wrists part the pearl curtains; pearl dew stirs the waves, and the pearls and jade gather in.
A natural scene of meeting and parting; she once spoke with a gentle smile.
The tracks on the flat grass are still shallow; without rhyme it turns into lake fields.
Though the gardens and woods are crafted and classical, that lovely figure cannot be embedded.
Who can crown the poems? The long streets are dim; layer after layer of gates are closed.
It seems there are soft hands遮目 (zhe mu) covering the eyes; in the empty valley, only the tiptoes remain.
Yin Lin, “Xishi Jiangnan”.
Problem Description
Given positive integers , let be the greatest common divisor of these numbers, and let be the least common multiple of these numbers. Please determine whether is equal to .
Input Format
This problem contains multiple groups of testdata within a single test point.
The first line contains an integer , which represents the number of testdata groups. For each group, the input format is as follows:
The first line of each group contains an integer , indicating the number of integers.
The second line of each group contains integers, where the -th integer is .
Output Format
For each group, output one line with a string representing the answer.
- If $l \times g = a_1 \times a_2 \times \dots \times a_n$, output .
- Otherwise, output .
3
2
2 3
3
2 3 4
3
3 8 35
Yes
No
Yes
见附加文件中的 C2.in
见附加文件中的 C2.ans
Hint
Constraints
Let denote the sum of within a single test point, i.e., .
- For of the data, it is guaranteed that .
- For of the data, it is guaranteed that .
- For of the data, it is guaranteed that .
- For of the data, it is guaranteed that .
- For of the data, it is guaranteed that , , .
Hint
There are millions of testdata; clear the first one first.
If you do not clear for multiple tests, two lines of tears for a zero score.
If clearing is not done properly, TLE will always follow.
Translated by ChatGPT 5