Economic Difficulties
1263F2400· grandmaster3s256 MB⌨ stdin/stdout
Examples
Sample 1of 3
Input
364 1 1 4 26 5 341 1 13 4 2
Output
5
Sample 2of 3
Input
464 4 1 1 13 2 6 566 6 1 1 15 4 3 2
Output
6
Sample 3of 3
Input
5141 1 11 2 14 14 13 7 12 2 5 6 19 8 3 10 4161 1 9 9 2 5 10 1 14 3 7 11 6 12 28 16 13 4 15
Output
17
58%
1263F.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)
loading graph engine…