cf/mirror

Triangular Paths

CF
1506F2000· candidate master2s256 MB⌨ stdin/stdout

Examples

Sample 1of 1
Input
4
3
1 4 2
1 3 1
2
2 4
2 3
2
1 1000000000
1 1000000000
4
3 10 5 8
2 5 2 4
Output
0
1
999999999
2
1506F.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)
loading graph engine…