#C11050. Unique Sorted Even Numbers
Unique Sorted Even Numbers
Unique Sorted Even Numbers
You are given an integer \( n \) and a list of \( n \) integers. Your task is to output all the unique even numbers from the list in ascending order.
Input Format: The first line contains an integer \( n \). The second line contains \( n \) integers separated by spaces.
Output Format: Print the unique even numbers in ascending order separated by a single space. If there are no even numbers, output nothing.
Example:
Input: 5 1 2 3 4 4</p>Output: 2 4
Make sure your solution reads from standard input and prints to standard output.
inputFormat
The input consists of two lines:
- The first line contains an integer n, representing the number of elements in the list.
- The second line contains n space-separated integers.
outputFormat
Print a single line containing the unique even numbers from the input list in ascending order separated by a single space. If there are no even numbers, print an empty line.## sample
5
1 2 3 4 4
2 4