#C14305. Merge and Sort Unique Integers

    ID: 43940 Type: Default 1000ms 256MiB

Merge and Sort Unique Integers

Merge and Sort Unique Integers

You are given two lists of integers. Your task is to merge these two lists, remove any duplicates, and output the resulting unique integers in sorted order. Let \(n\) and \(m\) be the sizes of the first and second lists respectively. The final sorted list should contain only unique elements and be in ascending order.

inputFormat

The input consists of four lines:

  • The first line contains an integer \(n\) representing the number of elements in the first list.
  • The second line contains \(n\) space-separated integers. If \(n = 0\), this line will be empty.
  • The third line contains an integer \(m\) representing the number of elements in the second list.
  • The fourth line contains \(m\) space-separated integers. If \(m = 0\), this line will be empty.

outputFormat

Output the resulting list of unique integers sorted in increasing order, with each element separated by a space. If the resulting list is empty, output an empty line.

## sample
0

3
1 2 3
1 2 3

</p>