0139. Simple Sorting

Имя входного файла: sort.in
Имя выходного файла: sort.out
Ограничение по времени: 1 s
Ограничение по памяти: 64 megabytes

You are given an unsorted array of 32-bit integer numbers. Your task is to sort this array and kill possible duplicated elements occuring in it.

Input file

The first line of the input file contains an integer number N representing the quantity of numbers in this array (1 ≤ N ≤ 65536). Next N lines contain N 32-bit integer numbers (one number per each line) of the original array.

Output file

Output file should contain at most N numbers sorted in descending order if the value of N was even, otherwise the numbers are to be sorted in ascending order. Every number in the output file should occure only once.

Examples:

sort.insort.out
6 8 8 7 3 7 78 7 3


Источник: Petrozavodsk Summer 2003. Blitz Kontest, Monday, August 25
Автор: Andrew Lopatin, Nick Durov

Обсудить       Отправить решение



Версия для печати