Time limit 2000/4000/4000/4000 ms. Memory limit 65000/65000/65000/65000 Kb. Question by Ibrahim Mesecan.
Bitonic Sequence
Question:
Bitonic sequence is a sequence which first
increases and then decreases. Write a program
that reads a series of numbers. Then, by placing
the biggest number to the middle, it converts this series
into a bitonic sequence. Note that from
the same series, there can be many
sequences giving the bitonic property.
Input specification
You will be given an integer (n) where
0 ≤ n ≤ 10,000. Then, you will be given n integers
where each of the numbers is less than 1e8.
Output specification
Place the biggest number to the middle of the list.
Then, the first part of list will increase,
and the second part will decrease.
Sample Input I
5
7
3
6
5
9
|
Sample Input II
10
19
11
3
5
9
0
4
7
9
18
|
Sample Output I
3 5 9 7 6
or, 3 6 9 7 5
both comply the bitonic sequence property.
|
Sample Output II
0 4 7 11 18 19 9 9 5 3
|
Для отправки решений необходимо выполнить вход.
|