Problem C
Kaffi
Languages
en
is
Bóas is constructing a new university building and is
planning out a room to store chairs in. This room can be as
tall as he pleases but due to how the other rooms are planned
out it must be exactly
Bóas wants the storage room to be organized, so all the
chairs in a given stack must be the same colour. There is also
only space for
![\includegraphics[width=35em]{mynd-1}](/problems/fkhi19.kaffi/file/statement/en/img-0001.png)
A possible solution to sample input
Input
The first line of the input contains two integers,
Output
The only line of the output should contain the minimum disorganization Bóas can achieve.
Sample Input 1 | Sample Output 1 |
---|---|
5 23 21 14 24 7 17 |
9 |
Sample Input 2 | Sample Output 2 |
---|---|
5 23 13 19 19 30 1 |
10 |