Codeforces Round 216 (Div. 2)
D
Valera and Fools
Codeforces
2200
原题
← CE →
翻译中…

One fine morning, $*n*$ fools lined up in a row. After that, they numbered each other with numbers from $1$ to $*n*$, inclusive. Each fool got a unique number. The fools decided not to change their numbers before the end of the fun.

翻译中…

Every fool has exactly $*k*$ bullets and a pistol. In addition, the fool number $*i*$ has probability of $*p*_{*i*}$ (in percent) that he kills the fool he shoots at.

翻译中…

The fools decided to have several rounds of the fun. Each round of the fun looks like this: each currently living fool shoots at another living fool with the smallest number (a fool is not stupid enough to shoot at himself). All shots of the round are perfomed at one time (simultaneously). If there is exactly one living fool, he does not shoot.

翻译中…

Let's define a situation as the set of numbers of all the living fools at the some time. We say that a situation is possible if for some integer number $*j*$ ($0 ≤ *j* ≤ *k*$) there is a nonzero probability that after $*j*$ rounds of the fun this situation will occur.

翻译中…

Valera knows numbers $*p*_{1}, *p*_{2}, ..., *p*_{*n*}$ and $*k*$. Help Valera determine the number of distinct possible situations.

翻译中…

Input

翻译中…

The first line contains two integers $*n*, *k*$ ($1 ≤ *n*, *k* ≤ 3000$) — the initial number of fools and the number of bullets for each fool.

翻译中…

The second line contains $*n*$ integers $*p*_{1}, *p*_{2}, ..., *p*_{*n*}$ ($0 ≤ *p*_{*i*} ≤ 100$) — the given probabilities (in percent).

翻译中…

Output

翻译中…

Print a single number — the answer to the problem.

翻译中…

Note

翻译中…

In the first sample, any situation is possible, except for situation ${1, 2}$.

翻译中…

In the second sample there is exactly one fool, so he does not make shots.

翻译中…

In the third sample the possible situations are ${1, 2}$ (after zero rounds) and the "empty" situation ${}$ (after one round).

翻译中…

In the fourth sample, the only possible situation is ${1, 2, 3}$.

翻译中…

样例

Input #1
3 3
50 50 50
Output #1
7
InputCopy OutputCopy
Input #2
1 1
100
Output #2
1
InputCopy OutputCopy
Input #3
2 1
100 100
Output #3
2
InputCopy OutputCopy
Input #4
3 3
0 0 0
Output #4
1
InputCopy OutputCopy
题目信息
题号
369D
时间限制
1 s
内存限制
256 MB
标签
DFS 及类似
动态规划
图论
最短路

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。