ZUMA - ZUMA

题意翻译

【题目描述】 祖玛游戏是这样的:有一列$N$ 个有颜色的珠子,如果触碰连续$K$ 个同色的珠子,那么它们就会消失,其余的珠子按照原来顺序接在一起。 现在你每次可以发射任意颜色的珠子,发射在任意位置(开头、结尾以及任意两个之间)。 注意,如果有连续$K$ 个或更多同色的珠子,你可以不立即消去他们。 问最少需要几发可以消掉所有的珠子。 【输入格式】 第一行$N,K$ 第二行$N$ 个数$a_i$,不同的数表示不同的颜色 【输出格式】 一个答案。 【数据规模】 对于所有数据,$1≤N≤100,2≤K≤5,1≤ai≤100$

题目描述

One day Mirko, while he was walking through the high grass, stumbled upon a sequence of N colored marbles. Soon he noticed that if he touches K or more consecutive marbles of the same color, they start to twinkle and then he could wish them to magically vanish, although he doesn't have to do that immediately (see 2. sample). Fortunately, Mirko brought an inexhaustible supply of marbles from home, so he can insert a marble of any color anywhere in the array (at the beginning, between any two existing marbles, or at the end). Help Mirko find the smallest number of marbles he must insert into the sequence before he could make all of the marbles vanish

输入输出格式

输入格式


The first line of input contains two integers N (1

输出格式


The output should contain only one line with a single integer number - the minimal number of marbles Mirko has to insert to achive the desired effect.

输入输出样例

输入样例 #1

2 5
1 1

输出样例 #1

3

输入样例 #2

10 4
3 3 3 3 2 3 1 1 1 3

输出样例 #2

4