cf/mirror

Dynamic Problem Scoring

CF
773B2000· candidate master2s256 MB⌨ stdin/stdout

Examples

Sample 1of 4
Input
2
5 15 40 70 115
50 45 40 30 15
Output
2
Sample 2of 4
Input
3
55 80 10 -1 -1
15 -1 79 60 -1
42 -1 13 -1 -1
Output
3
Sample 3of 4
Input
5
119 119 119 119 119
0 0 0 0 -1
20 65 12 73 77
78 112 22 23 11
1 78 60 111 62
Output
27
Sample 4of 4
Input
4
-1 20 40 77 119
30 10 73 50 107
21 29 -1 64 98
117 65 -1 -1 -1
Output
-1
773B.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)