cf/mirror

Mysterious Crime

CF
1043D1700· expert1s256 MB⌨ stdin/stdout

Examples

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