#t257. 明明的随机数
明明的随机数
Mingming's Random Numbers
Problem Description
Mingming wants to invite some classmates to do a survey. To keep the experiment objective, he first used a computer to generate random integers between and (). For duplicated numbers, only one copy is kept and the rest are removed; each distinct number corresponds to a different student's ID. Then these numbers are sorted in ascending order, and Mingming will go to the students in that order to do the survey. Please help him with the "de-duplication" and "sorting" work.
Input Format
There are two lines of input. The first line is a positive integer, the number of generated random numbers.
The second line contains positive integers separated by spaces, the generated random numbers.
Output Format
The output also has two lines. The first line is a positive integer , the number of distinct random numbers.
The second line contains positive integers separated by spaces, the distinct random numbers sorted in ascending order.
Sample Input
10
20 40 32 67 40 20 89 300 400 15
Sample Output
8
15 20 32 40 67 89 300 400
Hint
NOIP 2006, popularization group, problem 1.