cf/mirror

Palindromic Hamiltonian Path

CF
1569F3000· legendary gm5s256 MB⌨ stdin/stdout

Examples

Sample 1of 3
Input
4 3 3
1 2
2 3
3 4
Output
9
Sample 2of 3
Input
4 6 3
1 2
1 3
1 4
2 3
2 4
3 4
Output
21
Sample 3of 3
Input
12 19 12
1 3
2 6
3 6
3 7
4 8
8 5
8 7
9 4
5 9
10 1
10 4
10 6
9 10
11 1
5 11
7 11
12 2
12 5
12 11
Output
456165084
1569F.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)
loading graph engine…