#C8433. Merge Orb Sets

    ID: 52415 Type: Default 1000ms 256MiB

Merge Orb Sets

Merge Orb Sets

You are given t test cases. In each test case, you are provided with two sets of orbs represented by their integer values. Let the first set be \(S_1\) with \(n\) elements and the second set be \(S_2\) with \(m\) elements. Your task is to merge the two sets by computing the union \(S_1 \cup S_2\) and then remove any orb that appears in both sets (i.e. the intersection \(S_1 \cap S_2\)). In other words, the final set is given by:

[ \text{FinalSet} = (S_1 \cup S_2) \setminus (S_1 \cap S_2) ]

If the resulting set is empty, print Empty Set. Otherwise, print the elements of the final set sorted in ascending order and separated by a single space.

inputFormat

The input is read from standard input (STDIN) and is structured as follows:

  1. The first line contains an integer t representing the number of test cases.
  2. For each test case:
    1. The first line contains two integers n and m denoting the number of elements in the first and second orb sets, respectively.
    2. The second line contains n space-separated integers representing the elements of the first set. If n = 0, this line will be empty.
    3. The third line contains m space-separated integers representing the elements of the second set. If m = 0, this line will be empty.

outputFormat

For each test case, output a single line to standard output (STDOUT) with the following:

  • If the resulting set is not empty, print the sorted unique elements (after removing common elements) separated by a single space.
  • If the resulting set is empty, print Empty Set.
## sample
3
3 3
1 2 3
3 4 5
4 3
10 20 30 40
5 10 15
2 2
100 200
200 300
1 2 4 5

5 15 20 30 40 100 300

</p>