Crossing the Railways
1776E3500· legendary gm4s1024 MB⌨ stdin/stdout
Examples
Sample 1of 4
Input
4 3 5 11 2 13 4 12 3 23 4 3
Output
0
Sample 2of 4
Input
3 3 12 22 10 11 6 28 12 3
Output
2
Sample 3of 4
Input
8 4 13 21 4 15 13 11 5 26 13 21 9 310 13 31 10 411 13 4
Output
2
Sample 4of 4
Input
1 1 2 21 2 1
Output
-1
58%
1776E.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)