#C5266. Unique Sorted Gifts
Unique Sorted Gifts
Unique Sorted Gifts
You are given an integer \( n \) and a list of \( n \) integers representing gift values. Your task is to remove any duplicate gift values, sort the unique values in ascending order, and then output the sorted list. The solution should be efficient and work correctly even when there are many gifts.
Input format: The first line contains the integer \( n \). The second line contains \( n \) space-separated integers representing the list of gifts.
Output format: Output a single line with the sorted list of unique integers, separated by spaces.
Example:
Input: 5 4 1 2 3 3</p>Output: 1 2 3 4
Ensure your code reads from standard input (stdin) and writes to standard output (stdout).
inputFormat
The first line contains a single integer \( n \) (the number of gifts). The second line contains \( n \) space-separated integers representing the gift values.
outputFormat
Output the unique gift values in ascending order in one line, with each number separated by a space.
## sample5
4 1 2 3 3
1 2 3 4