cf/mirror

King's Path

CF
242C1800· expert2s256 MB⌨ stdin/stdout

Examples

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