cf/mirror

Two Permutations (Easy Version)

CF
1882E12400· grandmaster2s256 MB⌨ stdin/stdout

Examples

Sample 1of 3
Input
3 5
2 1 3
5 2 1 4 3
Output
2
3 4
2 4
Sample 2of 3
Input
4 4
3 4 2 1
2 4 1 3
Output
5
4 2
3 3
1 4
3 2
4 1
Sample 3of 3
Input
2 2
1 2
2 1
Output
-1
1882E1.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)