/ OPS / 题库 /

Zuma

Zuma

#描述#
One day Mirko, while he was walking through the high grass, stumbled upon a
sequence of N colored marbles.
<BR>
<BR>
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 3. sample).
<BR>
<BR>
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).
<BR>
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 ≤ N ≤ 100) and K (2 ≤ K ≤
5) - the number of marbles in the initial sequence and the minimal number
of consecutive marbles of the same color he could wish to vanish.
The next line contains exactly N integers between 1 and 100 (inclusive),
separated by one space. Those numbers represent colors of marbles in the
sequence Mirko found.

##输出格式##
The output should contain only one line with a single integer number - the
minimal number of marbles Mirko has to insert to achieve the desired effect.

#样例1#
##样例输入1##

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

##样例输出1##

3
2
4

#限制#
1000ms
32768KB

#提示#

#来源#

信息

ID
1805
难度
5
分类
category1 点击显示
标签
递交数
0
已通过
0
通过率
?
上传者