АВТ
Language:

Remote Training on Programming

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

234. Order!

Time Limit: 1 seconds
Memory Limit:1000KB
Points:5
View Problem Statistics Submit Problem added Undefined

Дано число N (1 <= N <= 100) и N различных целых положительных чисел от 1 до 1000. Расположите эти N чисел в таком порядке, чтобы для любых двух различных чисел a и b выполнялось условие: если a делится на b, то a стоит левее b.

Пример ввода

5

23 2 4 6 12

Пример вывода

12 4 6 2 23

 


View Problem Statistics Submit Author/source:
Problems from Contests / School olympiads of Vologda region / City School Olympiad 2005-2006 /
233. Matrix Rotation 234. 232. Sentences 230. Timetable 235. Triangles
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.094 sec.
© Copyright VSTU, AVT, Nosov D.A.