Vasya likes taking part in Codeforces contests. When a round is over, Vasya follows all submissions in the system testing tab.

There are $n$ solutions, the $i$-th of them should be tested on $a_i$ tests, testing one solution on one test takes $1$ second. The solutions are judged in the order from $1$ to $n$. There are $k$ testing processes which test solutions simultaneously. Each of them can test at most one solution at a time.

At any time moment $t$ when some testing process is not judging any solution, it takes the first solution from the queue and tests it on each test in increasing order of the test ids. Let this solution have id $i$, then it is being tested on the first test from time moment $t$ till time moment $t + 1$, then on the second test till time moment $t + 2$ and so on. This solution is fully tested at time moment $t + a_i$, and after that the testing process immediately starts testing another solution.

Consider some time moment, let there be exactly $m$ fully tested solutions by this moment. There is a caption "System testing: $d$%" on the page with solutions, where $d$ is calculated as

$$d = round\left(100\cdot\frac{m}{n}\right),$$

where $round(x) = \lfloor{x + 0.5}\rfloor$ is a function which maps every real to the nearest integer.

Vasya calls a submission interesting if there is a time moment (possibly, non-integer) when the solution is being tested on some test $q$, and the caption says "System testing: $q$%". Find the number of interesting solutions.

Please note that in case when multiple processes attempt to take the first submission from the queue at the same moment (for instance, at the initial moment), the order they take the solutions does not matter.


-----Input-----

The first line contains two positive integers $n$ and $k$ ($1 \le n \le 1000$, $1 \le k \le 100$) standing for the number of submissions and the number of testing processes respectively.

The second line contains $n$ positive integers $a_1, a_2, \ldots, a_n$ ($1 \le a_i \le 150$), where $a_i$ is equal to the number of tests the $i$-th submission is to be run on.


-----Output-----

Output the only integer — the number of interesting submissions.


-----Examples-----
Input
2 2
49 100

Output
1

Input
4 2
32 100 33 1

Output
2

Input
14 5
48 19 6 9 50 20 3 42 38 43 36 21 44 6

Output
5



-----Note-----

Consider the first example. At time moment $0$ both solutions start testing. At time moment $49$ the first solution is fully tested, so at time moment $49.5$ the second solution is being tested on the test $50$, and the caption says "System testing: $50$%" (because there is one fully tested solution out of two). So, the second solution is interesting.

Consider the second example. At time moment $0$ the first and the second solutions start testing. At time moment $32$ the first solution is fully tested, the third solution starts testing, the caption says "System testing: $25$%". At time moment $32 + 24.5 = 56.5$ the third solutions is being tested on test $25$, the caption is still the same, thus this solution is interesting. After that the third solution is fully tested at time moment $32 + 33 = 65$, the fourth solution is fully tested at time moment $65 + 1 = 66$. The captions becomes "System testing: $75$%", and at time moment $74.5$ the second solution is being tested on test $75$. So, this solution is also interesting. Overall, there are two interesting solutions.

Difficulty: MEDIUM_HARD
Tags: Implementation

Starter code:

Solutions:
import math
(n, k) = map(int, input().split())
a = list(map(int, input().split()))
now = [-1] * k
t = [0] * k
nxt = 0
m = 0
intr = [False for i in range(n)]
while m < n:
	for i in range(k):
		if now[i] != 1005 and (now[i] == -1 or t[i] == a[now[i]]):
			if now[i] != -1:
				m += 1
			if nxt == n:
				now[i] == 1005
				t[i] = 1000
			else:
				now[i] = nxt
				nxt += 1
				t[i] = 0
		t[i] += 1
	d = (200 * m + n) // (2 * n)
	for i in range(k):
		if d == t[i]:
			intr[now[i]] = True
print(sum(intr))


(n, k) = list(map(int, input().split()))
lst = list(map(int, input().split()))
cur = []
if n < k:
	k = n
for i in range(k):
	cur.append([1, lst[i]])
t = 0
ans = 0
m = 0
used = [False] * k
while m != n:
	t += 1
	for i in range(len(cur)):
		cur[i][0] += 1
		if cur[i][0] == cur[i][1] + 1 and cur[i][1] != -1:
			m += 1
			used[i] = False
			if k != n:
				cur[i] = [1, lst[k]]
				k += 1
			else:
				cur[i] = [0, -1]
				used[i] = True
	x = 100 * m / n
	if x % 1 >= 0.5:
		x = x // 1 + 1
	else:
		x //= 1
	x = int(x)
	for i in range(len(cur)):
		if cur[i][0] == x and (not used[i]):
			used[i] = True
			ans += 1
print(ans)


(n, k) = list(map(int, input().split()))
a = list(map(int, input().split()))
ns = 0
t = [-1] * k
for i in range(k):
	t[i] = [-1, -1]
u = 0
pr = 0
result = 0
z = 0
s = set()

def okr():
	return int(100 * pr / n + 0.5)
while pr != n:
	pr += z
	ns = okr()
	z = 0
	for i in range(k):
		if t[i] == [-1, -1]:
			if u != len(a):
				t[i] = [u, 1]
				if a[u] == 1:
					if ns == 1:
						if u not in s:
							result += 1
							s.add(u)
					t[i] = [-1, -1]
					z += 1
				u += 1
		else:
			t[i][1] += 1
			if t[i][1] == a[t[i][0]]:
				if t[i][1] == ns:
					if t[i][0] not in s:
						result += 1
						s.add(t[i][0])
				t[i] = [-1, -1]
				z += 1
		if t[i] != [-1, -1] and t[i][1] == ns:
			if t[i][0] not in s:
				result += 1
				s.add(t[i][0])
print(result)


from math import trunc
from collections import defaultdict, deque

def round(x):
	return trunc(x + 0.5)

def main():
	(n, k) = list(map(int, input().split()))
	an = list(map(int, input().split()))
	ts = [0] * (16 * 10 ** 5)
	ts[0] = k
	ds = [0] * (16 * 10 ** 5)
	m = -k
	ready = defaultdict(list)
	sol = [0] * n
	q = deque(list(range(n)))
	for i in range(len(ts)):
		free = ts[i]
		m += free
		ds[i] = round(100 * m / n)
		j = 0
		while q and j < free:
			si = q.popleft()
			ts[i + an[si]] += 1
			sol[si] = i
			j += 1
		if m == n:
			break
	res = 0
	for i in range(n):
		t = sol[i]
		for q in range(an[i]):
			if ds[t + q] == q + 1:
				res += 1
				break
	print(res)
main()


(n, k) = map(int, input().split())
a = list(map(int, input().split()))
p = [[0, 0, 0] for i in range(k)]
j = 0
m = 0
ans = [0] * n
flag = True
while flag:
	flag = False
	t = 0
	for i in range(k):
		p[i][0] += 1
		if p[i][0] == int(m / n * 100 + 0.5):
			ans[p[i][2]] = 1
		if p[i][0] >= p[i][1]:
			if p[i][1] != 0:
				t += 1
			if j >= n:
				p[i] = [0, 0, 0]
			else:
				p[i][0] = 0
				p[i][1] = a[j]
				p[i][2] = j
				j += 1
		if p[i][1] != 0:
			flag = True
	m += t
print(sum(ans))


def r(x):
	return int(x + 0.50000000001)
(n, k) = list(map(int, input().split()))
arr = [int(x) for x in input().split()]
arr = arr[::-1]
sys = [[0, 0, n + 1] for _ in range(k)]
cnt = 0
done = 0
ints = [False] * n
s = len(arr)
c = 0
for i in range(10 ** 8):
	tmp = 0
	for j in range(len(sys)):
		if sys[j][0] >= sys[j][1]:
			if arr:
				sys[j] = [0, arr.pop(), c]
				c += 1
			else:
				sys[j] = [0, 0, n + 1]
		sys[j][0] += 1
	q = r(100 * done / s)
	for j in range(len(sys)):
		if sys[j][1] == 0:
			tmp += 1
		if sys[j][0] == q and sys[j][1] >= sys[j][0]:
			ints[sys[j][2]] = True
	for j in range(len(sys)):
		if sys[j][1] != 0 and sys[j][0] >= sys[j][1]:
			done += 1
	if tmp == len(sys):
		break
d = 0
for i in ints:
	d += i
print(d)


(n, k) = map(int, input().split())
A = list(map(int, input().split()))
import math as m
kl = 0
dl = 0
t = 0
Pr = [0] * k
Nm = [-1] * k
Rz = [False] * n
while dl < n:
	for i in range(k):
		Pr[i] -= 1
		if Pr[i] == -1:
			if Nm[i] != -1:
				dl += 1
			if kl < n:
				Pr[i] = A[kl] - 1
				Nm[i] = kl
				kl += 1
			else:
				Nm[i] = -1
				Pr[i] = -1
	for i in range(k):
		if m.floor(dl / n * 100 + 0.5) == A[Nm[i]] - Pr[i] and Nm[i] != -1:
			Rz[Nm[i]] = True
	t += 1
print(sum(Rz))


(n, k) = list(map(int, input().split()))
a = list(map(int, input().split()))
b = [[0] for i in range(k)]
c = [0] * k
p = [0] * (150 * n + 1)
for i in a:
	m = 0
	for j in range(k):
		if c[j] < c[m]:
			m = j
	b[m].append(b[m][-1] + i)
	c[m] += i
	p[b[m][-1] + 1] += 1
for i in range(1, len(p)):
	p[i] += p[i - 1]
for i in range(len(p)):
	p[i] = (200 * p[i] + n) // (2 * n)
ans = 0
for i in range(k):
	for j in range(1, len(b[i])):
		l = b[i][j - 1]
		r = b[i][j]
		pp = l + 1
		while pp <= r:
			if p[pp] == pp - l:
				ans += 1
				break
			pp += 1
print(ans)