#K38917. Unique Tables Problem

    ID: 26305 Type: Default 1000ms 256MiB

Unique Tables Problem

Unique Tables Problem

You are given an integer \( M \) representing the number of table numbers, followed by \( M \) space-separated integers. Your task is to produce a sorted list of the unique table numbers in ascending order.

For example, if \( M = 5 \) and the list is 3 3 5 2 5, the unique sorted list will be 2 3 5.

This problem tests your ability to work with arrays, remove duplicates using set-like operations, and perform simple sorting. All formulas are expressed in LaTeX format, for example:

Sorted unique set = \( sorted(\{elements\}) \)

inputFormat

The input is provided on standard input (stdin) as follows:

  • The first line contains an integer \( M \) — the number of table numbers.
  • The second line contains \( M \) space-separated integers representing the table numbers. If \( M = 0 \), the second line will be empty.

outputFormat

Print on standard output (stdout) a single line containing the unique table numbers sorted in ascending order, separated by a space. If there are no table numbers, output nothing.

## sample
5
3 3 5 2 5
2 3 5