cf/mirror

Yet Another Minimization Problem

CF
868F2500· grandmaster2s256 MB⌨ stdin/stdout

Examples

Sample 1of 3
Input
7 3
1 1 3 3 3 2 1
Output
1
Sample 2of 3
Input
10 2
1 2 1 2 1 2 1 2 1 2
Output
8
Sample 3of 3
Input
13 3
1 2 2 2 1 2 1 1 1 2 2 1 1
Output
9
868F.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)