#K66422. Remove Duplicate Employee IDs

    ID: 32417 Type: Default 1000ms 256MiB

Remove Duplicate Employee IDs

Remove Duplicate Employee IDs

You are given multiple test cases. In each test case, the first line contains an integer \(n\) representing the number of employee IDs provided, followed by a line with \(n\) integers that represent the employee IDs. Your task is to remove duplicate IDs while preserving the order of their first occurrence.

Mathematically, if the input list is \(A = [a_1, a_2, \ldots, a_n]\), you need to produce a list \(B\) such that each element appears only once and in the same order as its first appearance in \(A\). That is, if \(B = [b_1, b_2, \ldots, b_k]\) then for every \(b_i\) and for any index \(j < i\), \(b_i \neq b_j\), and the order of elements in \(B\) is the same as in \(A\).

The input is read from STDIN and the output should be printed to STDOUT.

inputFormat

The input starts with a single integer \(T\) denoting the number of test cases. For each test case, the first line is an integer \(n\) which indicates the number of IDs. The next line contains \(n\) space-separated integers representing the employee IDs.

All input is provided via STDIN.

outputFormat

For each test case, output a single line containing the unique employee IDs separated by a space, preserving their original order.

The output should be printed to STDOUT.

## sample
3
5
1 2 2 3 4
7
10 10 10 5 7 5 5
4
9 8 7 6
1 2 3 4

10 5 7 9 8 7 6

</p>