АВТ
Language:

Remote Training on Programming

Problems On-line status Contests FAQ
For authors:
Register  ||  Login
 
Hello, Guest! Login or register.

470. Divide into pairs

Time Limit: 1 seconds
Memory Limit:16384KB
Points:10
View Problem Statistics Submit Problem added Undefined

Дано N чисел . Определите, можно ли их разбить на пары так, чтобы произведения во всех парах были одинаковы.

Входные данные
В первой строке - четное число N (2 <= N <= 100 000). Далее идут N целых чисел в диапазоне от 1 до 109, разделенные пробелами и/или переводами строк.

Выходные данные
Строка Yes или No

Пример входных данных
6
2 1 102 68 3 204
Пример результата
Yes
Пояснение к примеру
2*102 = 1*204 = 68*3

View Problem Statistics Submit Author/source:
Sorted Problems / Mathematics / Theory of numbers /
35. Continued fraction 470. 41. Divisibility 880. Doubling and increment 15. Factorials
Problems from Contests / Trainings of Vologda STU / Training 28.10.2010 /
41. B - Divisibility 470. 99. D - Joke
We can all benefit by doing occasional "toy" programs, when artificial restrictions are set up, so that we are forced to push our abilities to the limit. The art of tackling miniproblems with all our energy will sharpen our talents for the real problems. Donald E. Knuth.
time generating 0.046 sec.
© Copyright VSTU, AVT, Nosov D.A.