Array mapping
Statement
Goal
The goal is to reorder the first array according to the second array.Input
Line 1: An integer n
Line 1: n integers separated by spaces, representing an array
Line 2: n integers separated by spaces, representing an array
Line 1: n integers separated by spaces, representing an array
Line 2: n integers separated by spaces, representing an array
Output
Line 1: n integers separated by spaces
Constraints
1 ≤ n ≤ 24
Example
Input
3 1 2 3 2 3 1
Output
2 3 1
Game modes
Reverse
Test cases
Test 1 Test
Input
3
1 2 3
2 3 1
Output
2 3 1
Validator 1 Validator
Input
3
1 2 3
3 1 2
Output
3 1 2
Test 2 Test
Input
9
1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7 8 9
Output
1 2 3 4 5 6 7 8 9
Validator 2 Validator
Input
8
1 2 3 4 5 6 7 8
1 2 3 4 5 6 7 8
Output
1 2 3 4 5 6 7 8
Test 3 Test
Input
9
2 8 1 9 6 7 3 5 4
5 8 3 9 1 7 6 2 4
Output
6 5 1 4 2 3 7 8 9
Validator 3 Validator
Input
9
8 2 1 9 6 7 3 5 4
5 8 3 9 1 7 6 2 4
Output
6 5 1 4 8 3 7 2 9
Test 4 Test
Input
15
13 5 4 1 3 15 9 14 12 7 10 11 6 2 8
11 9 12 10 7 15 13 6 5 14 1 4 8 2 3
Output
10 12 11 7 9 8 6 15 3 2 13 1 14 5 4
Validator 4 Validator
Input
16
13 5 4 1 16 3 15 9 14 12 7 10 11 6 2 8
11 9 12 16 10 7 15 13 6 5 14 1 4 8 2 3
Output
7 14 10 8 12 15 2 11 3 16 6 13 1 9 5 4
Solution language
Solution
Stub generator input