Yet Another Minimization Problem
868F2500· grandmaster2s256 MB⌨ stdin/stdout
Examples
Sample 1of 3
Input
7 31 1 3 3 3 2 1
Output
1
Sample 2of 3
Input
10 21 2 1 2 1 2 1 2 1 2
Output
8
Sample 3of 3
Input
13 31 2 2 2 1 2 1 1 1 2 2 1 1
Output
9
58%
868F.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)