Max-heap
Execution time limit is 1 second
Runtime memory usage limit is 128 megabytes
Given array of integers. Rearrange its elements so that to get a max-heap.
Input
First line contains number of elements . Second line contains integers, no more than by absolute value.
Output
Print array that corresponds to max-heap.
Examples
Input #1
Answer #1
Submissions 361
Acceptance rate 60%