2 sec, 256 M
Your friend Antip Verbiage is waiting for the date with his classmate Ilona Magazine. He wants to present her an array of 2∙N numbers. He wants the minimal difference between any two consecutive numbers be as maximal as possible. But what a doubt! The sequence he bought is sorted! Help him to rearrange the numbers in the sequence.
Input. The first line contains a natural number N (1 ≤ N ≤ 500). The next line contains 2∙N sequence elements (from 1 to 1000000) sorted in ascending order.
Output. If required difference is greater than 1, output it at the first line and a new sequence at the second one. (If there are many right sequences output the most attractive for Ilona in your opinion one) Print the only line “Forever Ilona” otherwise.
1 2 3 10
1 3 10 2
1 2 2 10
Idea – Arthur Leonidovich Maximov
KBIS Software Developer