cf/mirror

Shortest Path

CF
59E2000· candidate master3s256 MB⌨ stdin/stdout

Examples

Sample 1of 3
Input
4 4 1
1 2
2 3
3 4
1 3
1 4 3
Output
2
1 3 4
Sample 2of 3
Input
3 1 0
1 2
Output
-1
Sample 3of 3
Input
4 4 2
1 2
2 3
3 4
1 3
1 2 3
1 3 4
Output
4
1 3 2 3 4
59E.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)
loading graph engine…