#K44777. Consolidate Lists
Consolidate Lists
Consolidate Lists
You are given k lists of integers. Your task is to consolidate these lists into a single sorted list with no duplicate elements. The lists might be unsorted and may even be empty.
The input is read from stdin and the result must be output to stdout as a single line of space-separated integers in ascending order. If the consolidated list is empty, output an empty line.
Note: The first number in the input indicates the number of lists, followed by k lines. Each of these lines starts with an integer n (the number of integers in that list), followed by n space-separated integers.
inputFormat
The input begins with a line containing a single integer k, the number of lists. The following k lines each start with an integer n (the number of elements in that list) followed by n integers separated by spaces.
outputFormat
Output a single line containing the unique integers sorted in ascending order, separated by a space. If there are no integers, output an empty line.## sample
3
4 1 3 5 7
5 2 4 6 8 10
3 1 4 9
1 2 3 4 5 6 7 8 9 10