WIRED - Wired
You have a sussy electrical box which has four colours on the left side and four colours on the right side (the colours are represented by numbers 1 to 4).
Determine a wiring which matches up the colours on the left side to the colours on the right side if they're the same colour.
Input
You are given an integer T
representing the number of test cases.
For each test case, you are give two lines:
The first line will contain four space-separated integers representing the left-side colours.
Similarly, the second line will contain four space-separated integers representing the right-side colours.
Output
Output four space-separated integers for each test case, representing the position that a wire on the left side should be wired to on the right side.
i.e. the line a b c d
means the first colour on the left side gets wired to the a
-th colour on the right side and so on.
Input 1 2 1 3 4 2 2 4 3 1 1 2 3 4 1 2 3 4 Output 1 4 3 2 1 1 2 3 4
Explanation
For the first test case, we must match the first colour on the left side to the fourth colour on the right side (matching the colour 1 to the colour 1). Similarly, we also match the second left to the third right, the third left to the second right and the fourth left to the first right.
Added by: | jslew |
Date: | 2022-09-20 |
Time limit: | 1s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All |