Problem:


Score : 200 points

Problem Statement

We have held a popularity poll for N items on sale. Item i received A_i votes.

From these N items, we will select M as popular items. However, we cannot select an item with less than \dfrac{1}{4M} of the total number of votes.

If M popular items can be selected, print Yes; otherwise, print No.

Constraints

1 \leq M \leq N \leq 100

1 \leq A_i \leq 1000

A_i are distinct.

All values in input are integers.

Input

Input is given from Standard Input in the following format:

N M
A_1 ... A_N

Output

If M popular items can be selected, print Yes; otherwise, print No.

Sample Input 1

4 1
5 4 2 1

Sample Output 1

Yes

There were 12 votes in total. The most popular item received 5 votes, and we can select it.

Sample Input 2

3 2
380 19 1

Sample Output 2

No

There were 400 votes in total. The second and third most popular items received less than \dfrac{1}{4\times 2} of the total number of votes, so we cannot select them. Thus, we cannot select two popular items.

Sample Input 3

12 3
4 56 78 901 2 345 67 890 123 45 6 789

Sample Output 3

Yes



Sample input:
4 1
5 4 2 1


Sample output:
Yes

Submission status: Runtime Error

Solution code:
nm=input().split()
vote=[int(i) in input().split()]
n=int(nm[0])
m=int(nm[1])
selectable=0
for v in vote:
  if v < 4*m:
    continue
  else:
    selectable+=1
if selectable>=m:
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

Solution code:
N,M = input().split()
A = list(map(int,input().split()))
tv = sum(A)
i,count=0,0
while(i<N and count!=M):
  if(A[i]>int(tv/4*int(M))):
    count+=1
if(count==M):
  print("YES")
else:
  print("NO")

Submission status: Runtime Error

Solution code:
n,m=map(int,input().split())
a=[int(i) for i in input().split()]
count=0
 
A=sum(a)//(4*m)
for i in a:
  if a[i]>=A:
    count+=1
if count>=m:
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

Solution code:
import math

n, m = map(int, input().split())
A = 0
arr = [int(x) for x in input().split()]
A = sum(arr)
x = A/(4 * m)
count = 0
for i in range(n):
	if arr[m] >= x:
		count +=1
	else: break
if count >= m:
	print("Yes")
else: print("No")

Submission status: Runtime Error

Solution code:
n,m=map(int,input().split())
a=[int(i) for i in input().split()]
count=0

A=sum(a)//(4＊m)
for i in range(n):
  if a[i]>A:
    count+=1
if count>=m:
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

Solution code:
n, m = map(int, input().split())
a = list(map(int, input().split()))

a.sorted(reverse=True)
if a[m-1] >= (sum(a)*(1/(4*m))):
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
import math

n, m = map(int, input().split())
sum = 0
arr = [int(x) for x in input().split()]
for i in range(n):
	sum += arr[i]
x = math.ceil(sum/(4 * m))
count = 0
for i in range(m):
	if arr[m] >= x:
		count +=1
	else: break
if count >= m:
	print("Yes")
else: print("No")

Submission status: Runtime Error

Solution code:
n, m = map(int, input().split())
sum = 0
arr = [int(x) for x in input().split()]
for i in range(n):
	sum += arr[i]
x = sum/(4 * m)
count = 0
for i in range(m):
	if arr[m] >= x:
		count +=1
	else: break
if count >= m:
	print("Yes")
else: print("No")

Submission status: Runtime Error

Solution code:
N, M = map(int,input().split())
A = list(map(int,input().split()))
S = sum(A)
cnt = 0
for a in A:
	if a >= S / (4*M):
	cnt += 1
if cnt >= M:
	print("Yes")
else:
	print("No")

Submission status: Runtime Error

Solution code:
N, M = map(int,input().split())
A = list(map(int,input().split()))
S = sum(A)
cnt = 0
for a in A:
 if a >= S / (4*M):
 cnt += 1
if cnt >= M:
 print("Yes")
else:
 print("No")

Submission status: Runtime Error

Solution code:
n, m = map(int, input().split())
A = list(map(int, input().split()))
A.sort(reverse=True)
if A[m] > sum(A)/4/m:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
def getInput():
    return [int(i) for i in input().rstrip().split(' ')]
N, M = getInput()
A = getInput()
_4M = math.ceil(sum(A) / (4*M))
A.sort(reverse=True)
cnt = 0
for i in A:
    if i >= _4M:
        cnt += 1
print('Yes') if cnt >= M else print('No')

Submission status: Runtime Error

Solution code:
b,c=map(int,input().split())
a=list(map(int,input().split()))
d=sum(a)
new_a=sorted(a)
e=-1
f=0
g=4*c

while new_a[e] >= d/g:
    e=e-1
    f=f+1
    try:
        break

if f >= c:
    print("Yes")
else :
    print("No")

Submission status: Runtime Error

Solution code:
n,m = list(map(int,input().split()));
a = list(map(int,input().split()));
 
a.sort(reverse = True);
 
i = 0;
while 4*m*a[i] >= sum(a) and i < n:
    i += 1;
 
if i >= m :
    print('Yes');
else :
    print('No');

Submission status: Runtime Error

Solution code:
n,m = list(map(int,input().split()));
a = list(map(int,input().split()));
 
a.sort(reverse = True);
 
i = 0;
while a[i] >= sum(a)//(4*m) and i < n:
    i += 1;
 
if i >= m :
    print('Yes');
else :
    print('No');

Submission status: Runtime Error

Solution code:
b,c=map(int,input().split())
a=list(map(int,input().split()))
d=sum(a)
new_a=sorted(a)
e=-1
f=0
g=4*c

while new_a[e] >= d/g:
    e=e-1
    f=f+1
    try:
        continue

if f >= c:
    print("Yes")
else :
    print("No")

Submission status: Runtime Error

Solution code:
n,m = map(int,input().split())
a = list(map(int,input().split()))
ans = 0
s = sum(a)
for i in range(a):
    if i >= s/(4*m):
        ans += 1
if ans >= m:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
N, M = map(int,input().split())
2 A = list(map(int,input().split()))
3 S = sum(A)
4 cnt = 0
5 for a in A:
6 if a >= S / (4*M):
7 cnt += 1
8 if cnt >= M:
9 print("Yes")
10 else:
11 print("No")

Submission status: Runtime Error

Solution code:
b, c = map(int, input().split())
a = list(map(int, input().split()))
d = sum(a)
new_a = list(reversed(sorted(a)))
e = 0
f = 0
g = 4*c
while new_a[e] >= d/g:
    e = e+1
    if e == n:
        break
    f = f+1
if f >= c:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
b, c = map(int, input().split())
a = list(map(int, input().split()))
d = sum(a)
new_a = list(reversed(sorted(a)))
e = 0
f = 0
g = 4*c
while new_a[e] >= d/g:
    e = e+1
    f = f+1
if f >= c:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
n,m=map(int,input().split())
l=list(map(int,input().split()))
c=0
s=sum(l)
for i in l:
  if 4*m*i<=s:
    c+=1
if m<=c:
  print("Yes")
else
  print("No")

Submission status: Runtime Error

Solution code:
n,m=map(int,input().split())
a=list(map(int,input().split()))
for x in a:
  if x >= sum(a)/(4*m):
  	res += x

if res >= m:
  print('Yes')
else:
  print('No')

Submission status: Runtime Error

Solution code:
# your code goes here
N,M = map(int,input().split())
A = list(map(int,input().split()))
T = 0
C = 0
Y = "Yes"
E = "No"
for i in range(N):
    T += A[i]
for i in range(N):
    if (A[i]*4*M) > T:
        C += 1
    if C = M:
        print(Y)
        break
if C < M:
    print(E)

Submission status: Runtime Error

Solution code:
M, N = map(int, input().split())
A = list(map(int, input().split()))
A.sort(reverse=True)　
S = sum(A)
if A[M-1] >=  S / 4M
print('Yes')
else:
    ('No')

Submission status: Runtime Error

Solution code:
n, m = [int(x) for x in input().split()]
sousuu = 0
kakutoku = 0
x = [0]*n

x = [int(y) for y in input().split()]

sousuu = sum(x)

for k in x:
    if x > (sousuu/(4*m)):
        kakutoku += 1

if kakutoku >= m:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
N, M = map(int, input().split())
A = list(map(int, input().split()))
vote_sum = sum(A)
cnt = 0
y = "Yes"
n = "no"

for i in range(N):
	if (A[i]*4*M) >= T:
		cnt += 1

if cnt >= M:
	print(y)
else:
	print(n)

Submission status: Runtime Error

Solution code:
n, m = [int(x) for x in input().split()]
sousuu = 0
kakutoku = 0
x = [0]*n

x = [int(y) for y in input().split()]

sousuu = sum(x)

for k in x:
    if int(x) > (sousuu/(4*m)):
        kakutoku += 1

if kakutoku >= m:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
N,M = map(int,input().split())
score = list(map(int,input().split()))
score = sorted(score,reverse=True)
if score[M−１]*4*M < sum(score):
    print("No")
else:
    print("Yes")

Submission status: Runtime Error

Solution code:
n,m=map(int,input().split())
a=list(map(int,input().split()))

new_a=sorted(a,reverse=True)
sums=sum(a)

if new_a[m-1]>=sums/(b*4):
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
#def calc():
    #summ  = sum(A)
    #print(summ)
    
    #low = summ / (4*M)
    #print(low)

    #newlist = [i for i in A if i >= low]
    #print(newlist)

    #num = len(newlist)
    #print(num)

    #if M <= num:
        #print ("Yes")
    #else:
        #print ("No")

N, M = map(int,input().split())
A = list(map(int, input.split()))

#N, M = 5, 2
#A = [110, 2, 20, 10, 0]
#calc()

S = sum(A)
cnt = 0
for i in A:
    if i >= S / (4*M):
        cnt += 1
if cnt >= M:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
n,m=(map(int,input().split()))
a=list(map(int,input().split()))

new_a=sorted(a,reverse=True)
sums=sum(a)

if new_a[m-1]>sums/(b*4):
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
def calc():
    summ  = sum(A)
    #print(summ)
    
    low = summ / (4*M)
    #print(low)

    newlist = [i for i in A if i >= low]
    #print(newlist)

    num = len(newlist)
    #print(num)

    if M <= num:
        print ("Yes")
    else:
        print ("No")

N, M = map(int,input().split())
A = list(map(int, input.split()))

#N, M = 5, 2
#A = [110, 2, 20, 10, 0]
calc()

Submission status: Runtime Error

Solution code:
N, M = [int(i) for i in input().split()]
A = [int(i) for i in input().split()]
total = sum(A)
print('Yes' if len(1 for a in A if a * 4 * M >= total) >= M else 'No')

Submission status: Runtime Error

Solution code:
N,M = map(int,input().split())
A = list(map(int,input().split()))



def check(A,M):
    flag = 0
    sumOfA = 0
    for i in A:
        sumOfA+=A
    condition = sumOfA/(4*M)
    if(M==1 and max(A)>condition):
        return "Yes"
    for i in A:
        if(i <= condition):
            continue
        else:
            flag+=1
            if(flag==M):
                return "Yes"
    return "No"

print(check(A,M) else "No")

Submission status: Runtime Error

Solution code:
n, m = map(int, input().split())
a = list(map(int, input().split()))

a.sort(reverse=True)

vote = sum(a)

if a[m-1] => vote*1/(4*m):
  print('Yes')
else:
  print('No')

Submission status: Runtime Error

Solution code:
n, m = input().split()
m = int(m)
a = list(map(int, input().split()))
num_list = a
# 1 / (4 * M)
# N = len(A)
z = sum(a)
w = (1 / (4 * m))
if num_list[m] >= z * w:
    print("Yes")
else:
    print('No')

Submission status: Runtime Error

Solution code:
def calc():
    summ  = sum(A)
    #print(summ)
    
    low = summ / (4*M)
    #print(low)

    newlist = [i for i in A if low <= i]
    #print(newlist)

    num = len(newlist)
    #print(num)

    if M > num:
        print ("No")
    else:
        print ("Yes")

N, M = map(int,input().split())
A = list(map(int, input.split()))


#N, M = 10, 10
#A = list(range(1, 11))
calc()

Submission status: Runtime Error

Solution code:
def main():
  n, m = map(int, input().split())
  l = list(map(int, input().split()))
  d = sum(l) / 4 / m
  l.sort()
  for i in l:
    if l[i] < d:
      print ("No")
      return
  print ("Yes")
  return

if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
N, M = map(int, input().split())
votes = list(map(int, input().split()))
min_votes: float = sum(votes) * 1.0 / (4*M)
votes_greater_than_min = list(filter(lambda x: x >= min_votes, votes))
if len(votes_greater_than_min) >= M:
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

Solution code:
n, m = map(int, input().split())
a = list(map(int, input().split())).sort()
sum_ = 0
for i in a:
    sum_ +=i
if(a[m-1]>(sum_/4*m)):
    print('Yes')
else: print('No')

Submission status: Runtime Error

Solution code:
N,M= map(int,input().split())
A = list(map(int, input().split()))
count=0
for i in range(M):
    if A.sort(reverse=True)[i]>=(sum(A)/4*M):
        count=count+1
if count==M:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
n, m = map(int, input().split())
acc = n+m
arr = list(map(int, input().split()))
sums = 0
count = 0
for i in arr:
    sums = sums + i
check = (1 / (4*m))*sums
for i in arr:
    if i < check:
        count += 1
    else:
        if i == sums
            count = 0
            break
        continue
if count >= 1:
    print("No")
else:
    print("Yes")

Submission status: Runtime Error

Solution code:
# your code goes here
N,M = map(int,input().split())
A = list(map(int,input().split()))
T = 0
C = 0
Y = "Yes"
N = "No"
for i in range(N):
    T += A[i]
for i in range(N):
    if C > M:
        print(Y)
        break
    if (A[i]*4*M) > T:
        C += 1
if C < M:
    print(N)

Submission status: Runtime Error

Solution code:
list = input().split()
A = input().split()

for i in range(len(A)):
  A[i] = int(A[i])
  
N = int(list[0])
M = int(list[1])

tmp = []
for i in tmp_list:
  if i >= sum(tmp_list) / (4 * int(M)):
    tmp.append(i)
if len(tmp) >= M:
  print("Yse")
else:
  print("No")

Submission status: Runtime Error

Solution code:
a, b = map(int,input().split())
c = list(map(int,input().split()))

tmp = []

d = 1 / sum(c) * b

while c:
    e = c.pop()
    if e % 2 == 0:
        tmp.append(e)
while tmp:
    c.append(tmp.pop())

ns = []
for f in c:
    try:
        ns.append(int(f))
	except ValueError:
        pass   
  
if f <= b:
  print('Yes')
else:
  print('No')

Submission status: Runtime Error

Solution code:
n,m = map(int,input().split()) #nは総数、ｍは選ぶ数
a = map(int,input().split()) #aは得票数
G = sum(a) #総得票数
num = 1/(4*G)
s = 
yesman = 0
while a(:n)
if s >= num:
  yesman = yesman + 1
  
if yesman >= m:
  print("Yes")
else : print("No")

Submission status: Runtime Error

Solution code:
n,m = input().split()
n = int(n)
m = int(m)
list1 = []
sum = 0
for i in range(0,n):
  element = int(input())
  sum = sum + element
  list1.append(element)
result = sum//(4*m)
count = 0
for j in range(0,n):
  if list1[j] >= result:
    count = count+1
if m < count:
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

Solution code:
n,m = input().split()
n = int(n)
m = int(m)
list1 = []
sum = 0
for i in range(0,n):
  element = int(input())
  sum = sum + element
  list1.append(element)
result = sum//(4*m)
count = 0
for j in range(0,n):
  if list1[j] >= result:
    count = count+1
if m < count:
  print("YES")
else:
  print("NO")

Submission status: Runtime Error

Solution code:
N, M = int(input().split()
Ai = []
for i in range (N):
    A = int(input())
    Ai.append(A)
    if A >= (1/(4*M)):
        print("Yes")
    else:
        print("No")

Submission status: Runtime Error

Solution code:
N, M = map(int, input().split())
A = list(set((map(int, input().split()))))
vote = []
for Ai in A:
	if Ai > (1 / (4 * M) * sum(A)):
      vote.append(Ai)
if len(vote) >= M:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
def calc():
    summ  = sum(A)
    low = summ / (4*M)

    num = len([i for i in A if low <= i])

    if M > num:
        print ("No")
    else:
        print ("Yes")

N, M = map(int,input().split())
A = list(map(int, input.split()))

calc()

Submission status: Runtime Error

Solution code:
n,m = map(n,m = map(int,input().split())
a = list(map(int,input().split()))

s = sum(a)
u = s / (4*m)
c = 0
for i in a:
    if i >= u: c += 1

if c >= m: print('Yes')
else : print('No')

Submission status: Runtime Error

Solution code:
n,m = map(int, input().split())
a = sorted(list(map(int, input().split())),reverse=True)
s = 0
for i in range(m):
    if a[i]*4*m > sum(a):
        s += 1
if s = m:
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

Solution code:
N, M= map(int, input().split())
a = list(map(int, input().split()))

list_sum = sum(a)
num = list_sum * (1/(4*M))
judge = True
count = -1
list_count = len(a)


while judge == True:
    if a[count] <= num:
        count -= 1
    else:
        judge = False

if M < N - (count*-1):
    print('No')
else:
    print('Yes')

Submission status: Runtime Error

Solution code:
N,M = map(int,input().split())
A = lsit(set((map(int,input().split()))))
print(A)
vote=[]
for Ai in A:
    if Ai>(1/(4*M)*sum(A)):
        vote.append(Ai)
if len(vote)>=M:
    print("yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
top=0
sum=0
asp=0
n,m=list(map(int,input().split()))
a=list(map(int,input().split()))

for i in range(n):
    sum=sum+int(a[i-1])
    if a[i-1]<a[i] or i==1:
        top=int(a[i-1])

asp=float(1-(1/(4*m)))
asc=float((1/(4*m))
if top>sum*asp or top/asp>sum:
    print("No")
else:
    print("Yes")

Submission status: Runtime Error

Solution code:
# your code goes here
N,M = map(int,input().split())
A = list(map(int,input().split()))
T = 0
C = 0
Y = [Yes]
N = [No]
for i in range(N):
    T += A[i]
for i in range(N):
    if C > M:
        print(Y)
        break
    if (A[i]*4*M) > T:
        C += 1
if C < M:
    print(N)

Submission status: Runtime Error

Solution code:
N, M = map(int, input().split())
A = list(set((map(int, input().split()))))
print(A)
vote=[]
for Ai in A:
  if ai > (1/ (4*M) * sum(A)):
    vote.append(Ai)
if len(vote) >= M:
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

Solution code:
b,c=map(int,input().split())
a=list(map(int,input().split()))
d=sum(a)
new_a=sorted(a)
e=-1
f=0
g=4*c

while new_a[e] >= d/g:
    e=e-1
    f=f+1

if f >= c:
    print("Yes")
else :
    print("No")

Submission status: Runtime Error

Solution code:
N, M = map(int, input().split())
A = list(set((map(int, input().split()))))
print(A)
vote = []
for Ai in A:
    if Ai > (1 / (4 * M) * sum(A)):
        vote.append(Ai)
if len(vote) >= M:
    print("Yes")
else:
    print("No")



N, K = map(int, input().split())
Nj = N
while True:
    Ni = Nj
    Nj = abs(Ni - K)
    if Ni > N:
        print(N)
        break
    elif Nj > Ni:
        print(Ni)
        break
    elif K == 1 or Nj == K:
        print(0)
        break
    else:
        continue

Submission status: Runtime Error

Solution code:
import sys
n,m = map(int,input().split())
l = list(map(int,input().split()))
l.sort(reverse=True)
sum1 = sum(l)/(4*m)
for i in range(m):
    if l[i] < sum1:
        print('No')
        sys.exit()
    else:
        l[i] == l[i+1]
print('Yes')

Submission status: Runtime Error

Solution code:
import sys

N, M = map(int, input().split())
A = list(map(int, input().split()))

total_votes = sum(A)
threshold = total_votes * (1 / (4 * M))

chooseable = 0

for a in A:
  if a >= threshold:
    chooseable += 1
    if chooseable >= M:
      print("Yes")
      sys.exit(1)

print("No")

Submission status: Runtime Error

Solution code:
top=0
sum=0
asp=0
n,m=list(map(int,input().split()))
a=list(map(int,input().split()))

for i in range(n):
    sum=sum+a[i-1]
    if a[i-1]<a[i] or i==1:
        top=a[n-1]
asp=1-(1/(4*m))
    if top>sum*asp:
        print("No")
    else:
        print("Yes")

Submission status: Runtime Error

Solution code:
N, M = map(int, input().split())
A = list(map(int, input().split()))
check = ((1 / (4 * M)) * sum(A))
x = 0
for item in A:
    if item < check:
        x += 1
ans = N - x
if ans >= M :
    print('Yes')
else:
    print('No')N, M = map(int, input().split())
A = list(map(int, input().split()))
check = ((1 / (4 * M)) * sum(A))
x = 0
for item in A:
    if item < check:
        x += 1
ans = N - x
if ans >= M :
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

Solution code:
top=0
sum=0
def sort(a,n):
    for i in range(n):
        sum=sum+a[i-1]
        if a[i-1]<a[i] or i==1:
            top=a[n-1]
asp=0
def am(m):
    asp=1-(1/(4*m))
    if top>sum*asp:
        print("No")
    else:
        print("Yes")

n,m=list(map(int,input().split()))
a=list(map(int,input().split()))

sort(a,n)
am(m)

Submission status: Runtime Error

Solution code:
top=0
sum=0
def sort(a,n)
    for i in range(n):
        sum=sum+a[i-1]
        if a[i-1]<a[i] or i==1:
            top=a[n-1]
asp=0
def am(m):
    asp=1-(1/(4*m))
    if top>sum*asp:
        print("No")
    else:
        print("Yes")

n,m=list(map(int,input().split()))
a=list(map(int,input().split()))

sort(a,n)
am(m)

Submission status: Runtime Error

Solution code:
b,c=map(int,input().split())
a=list(map(int,input().split()))
d=sum(a)
new_a=sorted(a)
e=-1
f=0
g=4*c
while new_a[e] >= d/g:
    e=e-1
    f=f+1
if f >= c:
    print("Yes")
else :
    print("No")

Submission status: Runtime Error

Solution code:
import random

N=random.randrange(100)
M=random.randrange(100)
Ai=random.randrange(1000)
li=random.sample(list(range(0, Ai)), k=N)
li.sort(reverse=True)
li_sum=sum(li)

Ml=0
for A in li:
    if A < (li_sum/(4*M)):
        break
    else:
        Ml+=1

if M <= Ml:
    print("yes")
else:
    print("no")

Submission status: Runtime Error

Solution code:
N, M = map(int, input().split())
l = list(map(int, input().split()))  

S = sum(l)

lr = [i for i in l if i >= S/4M]

if len(lr) >= M:
  	print("Yes")
else:
  	print("No")

Submission status: Runtime Error

Solution code:
items,select = input().split()
x = [int(items) for x in input().split()]
for u in x:
    if 1 <= select <= items <= 1000 and (1 <= u <= 1000 for u in x):
        if u > (1 / (4 * int(select))*sum(x)):
            print("No")
            break
        else:
            print("Yes")
            break

Submission status: Runtime Error

Solution code:
N,M = input().split()
space = []
for i in range (N) :
    A = input()
    space.append(A)
if M in space :
    print("yes")
else:
    print("no")

Submission status: Runtime Error

Solution code:
num1 = int(input().split())
num2 = list(map(int, input().split())    
            
            
sorted(num2,reverse=True)            
N=num1[0]
M=num1[1]
A=num2[M-1]

if A<N/M/4:
    print('No')
else:
    print('Yes')

Submission status: Runtime Error

Solution code:
#!/usr/bin/env python
import sys

if __name__ == '__main__':

    NM = input().split()
    nums = input().split()

    numsl = []
    for _,a in enumerate(nums):
        numsl.append(int(a))

    N = NM[0]
    M = NM[1]
    sum = 0

    if N <= 100:
        print('No')
        sys.exit()
    if 1 <= M:
        print('No')
        sys.exit()
    if M <= N:
        print('No')
        sys.exit()

    for i,a in enumerate(nums):
        sum = sum + int(a)

    numsr = sorted(numsl,reverse=True)

    y = 0
    for i,a in enumerate(nums):
        if int(a) >= int(numsr[int(M)-1]):
            if int(a) > int(sum)//(4*int(M)):
                y = y + 1

    if y >= int(M):
        print('Yes')
    else:
        print('No')

    sys.exit()

Submission status: Runtime Error

Solution code:
N, M = input().split()
N= int(N)
M = int(M)
itemList = input().split()
itemList.sort()
index = -1
answer = true
for i in range(M):
  if itemList[index] < (N*(1/(4*M))):
    answer = false
    break
  index -= 1
  
if answer:
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

Solution code:
n, m = map(int, input().split())
a = list(map(int, input().split()))
num_list = a
# 1 / (4 * M)
# N = len(A)
z = sum(a)
w = (1 / (4 * m))
if num_list[m] >= z * w:
    print("Yes")
else:
    print('No')

Submission status: Runtime Error

Solution code:
num1 = int(input().split())
num2 = sorted(map(int, input().split())

N=num1[0]
M=num1[1]
A=num2[M-1]

if A<N/M/4:
    print('No')
else:
    print('Yes')

Submission status: Runtime Error

Solution code:
def calc():
    summ  = sum(A)
    low = summ / (4*M)
    high = 1000

    num = len([i for i in A if low <= i])
    #print(num)

    if M > num:
        print ("No")
    else:
        print ("Yes")

N, M = map(int,input().split())
A = list(map(int, input.split()))


#N, M = 5, 2
#A = list(range(1, 6))
calc()

Submission status: Runtime Error

Solution code:
N=input(int("Enter the number of N"))
print(N)
M=input(int("Enter the number of M"))
print(M)
x = int(input("Enter an integer:"))
total = 0
sum = 0
while (0 <= x):
    if sum <= 1000:
        x += 1
        sum += (int(input("Enter an integer:")))
    elif sum >= 1000:
        break 
print(x)
if (1<=M<=N<=100 and N>1/4M):
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
n, m = map(int, input().split())
a = list(map(int, input().split()))
num_list = a
# 1 / (4 * M)
# N = len(A)
z = sum(num_list)
w = (1 / (4 * m))
if num_list[m] >= z * w:
    print("Yes")
else:
    print('No')

Submission status: Runtime Error

Solution code:
n = list(map(int,input().split()))
vote = list(map(int,input().split()))
a = sum(vote)/(4*n[1])
result = 0
for i in range(n[0]):
  if vote[i]=>a:
    result += 1
if result<n[1]:
  print('No')
else:
  print('Yes')

Submission status: Runtime Error

Solution code:
b,c=map(int,input().split())
a=list(map(int,input().split()))
d=sum(a)
new_a=sorted(a)
e=-1
f=0
g=4*c
while new_a[e] >= d/g:
    e=e-1
    f=f+1
if f = c:
    print("Yes")
else :
    print("No")

Submission status: Runtime Error

Solution code:
def calc():
    summ  = sum(A)
    low = summ / (4*M)
    high = 1000

    newlist = [i for i in A if low <= i < high]
    #print(newlist)

    lot = len(newlist)

    if M > lot:
        print ("No")
    else:
        print ("Yes")

N, M = map(int,input().split())
A = list(map(int, input.split()))


#N, M = 10, 2
#A = list(range(1, 11))
calc()

Submission status: Runtime Error

Solution code:
N,M=(int(x) for x in input().split())
As=[int(x) for x in input().split()]
p = sum(As)/4M
ov = [1 if x>=p else 0 for x in As]
if sum(ov)>=M:
  print('Yes')
else:
  print('No')

Submission status: Runtime Error

Solution code:
import math

N, M = map(int, input().split())
arrayA = input().split()
convertedArray = [int(ele) for ele in arrayA]
count = 0
total = sum(convertedArray)
con = math.floor((1 / (4 * M)) * total)
for A in convertedArray:
	if A > con:
    	count += 1
if count <= M:
	print('No')
else:
	print('Yes')

Submission status: Runtime Error

Solution code:
N, M = map(int, input().split())
a_list =  list(map(int, input().split()))
a_total = sum(a_list)
ld = sorted(a_list, reverse = True)
for i in ld[:M]:
    if i < (1/(4*M))*a_total:
    	print("No")
        break
else:
    print("Yes")

Submission status: Runtime Error

Solution code:
n, m = map(int, input().split())
a = num_list
num_list = list(map(int, input().split()))
# 1 / (4 * M)
# N = len(A)
z = sum(num_list)
 
if num_list[m] >= z *  {1 / (4 * m)}:
  print("Yes")
else:
  print('No')

Submission status: Runtime Error

Solution code:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

import itertools

n, m = map(int, readline().split())
a = list(map(int, readline().split()))
sum_a = sum(a)
cumsum = list(itertools.accumulate(a))
ans = [0] * n
cnt = 0
if cumsum[m] / sum_a >= 1 / (n * m):
    cnt += 1
for i in range(1, n - m + 1):
    if (cumsum[m + i - 1] - cumsum[i - 1]) / sum_a >= 1 / (n * m):
        cnt += 1
    if cnt >= m:
        print('Yes')
        exit()
if cnt >= m:
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

Solution code:
num1 = int(input().split())
num2 = list(map(int, input().split()))

sorted(num2, reverse=True)
N=num1[0]
M=num1[1]
A=num2[M-1]

if A<N/M/4:
    print('No')
else:
    print('Yes')

Submission status: Runtime Error

Solution code:
N, M = map(int, input().split())
a_list =  list(map(int, input().split()))
a_total = sum(a_list)
ld = sorted(a_list, reverse = True)
for i inld[:M]:
    i < (1/(4*M))*a_total:
        print("No")
else:
    print("Yes")

Submission status: Runtime Error

Solution code:
n, m = map(int, input().split())
a = list(map(int, input().split()))
z = sum(a)
 
if a[m] >= z *  {1 / (4 * m)}:
  print("Yes")
else:
  print('No')

Submission status: Runtime Error

Solution code:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

import itertools

n, m = map(int, readline().split())
a = list(map(int, readline().split()))
sum_a = sum(a)
cumsum = list(itertools.accumulate(a))
ans = [0] * n
cnt = 0
if cumsum[m] / sum_a < 1 / (n * m):
    for i in range(m):
        ans[i] -= 1
for i in range(1, n - m + 1):
    if (cumsum[m + i - 1] - cumsum[i - 1]) / sum_a < 1 / (n * m):
        for j in range(i, m + 1):
            ans[j] -= 1
for i in range(n):
    if ans[i] == 0:
        cnt += 1
if cnt >= m:
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

Solution code:
import sys
sys.setrecursionlimit(10**3)

N, M= map(int, input().split())

A = [int(input()) for i in range(N)]

B = []
for i in range(len(A)):
    if A[i] > sum(A)/4/M:
        B.append(1)
    else:
        B.append(0)

if sum(B) >= M:
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

Solution code:
items,select = input().split()
list1 = []
for i in range(int(items)):
    u = int(input())
    list1.append(u)
for u in list1:
    if u > (1 / (4 * int(select)) * sum(list1)):
        print("No")
        break
    else:
        print("Yes")
        break

Submission status: Runtime Error

Solution code:
n, m = map(int, input().split())
a = list(map(int, input().split()))
# 1 / (4 * M)
# N = len(A)
z = sum(a)
 
if a[m] >= z *  {1 / (4 * m)}:
  print("Yes")
else:
  print('No')

Submission status: Runtime Error

Solution code:
def calc():
    summ  = sum(A)
    low = summ * 1 / 4*M
    high = 1000

    newlist = [i for i in A if low <= i < high]

    lot = len(newlist)

    if M > lot:
        print ("No")
    else:
        print ("Yes")

N, M = map(int,input().split())
A = list(map(int, input.split()))


#N, M = 10, 2
#A = list(range(1, 12))
calc()

Submission status: Runtime Error

Solution code:
import sys

sys.setrecursionlimit(10**6)

N, M= map(int, input().split())

A = [int(input()) for i in range(N)]

B = []
for i in range(len(A)):
    if A[i] > sum(A)/4/M:
        B.append(1)
    else:
        B.append(0)

if sum(B) >= M:
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

Solution code:
N,M = map(int, input().split())
A=list(map(int, input().split()))
A.sort(reverse=True)

count = 0

for i in range(N-1):
	if A[i]<(0.25/M*sum(A)):
		break
	else:
		count +=1
	if count == M:
		break

if N ==1
	print("Yes" if A[0]>0 else "No")
else:
	print("Yes" if count >=M else "No")

Submission status: Runtime Error

Solution code:
arrayNM = list(map(int, input().split()))
array = list(map(int, input().split()))
soutoku = 0
for num in array:
  soutoku += num
tokuhyousuu = soutokuku / (4 * float(array[1]))
ninnkiCounter = 0
for num in array:
  if (float(num) >= tokuhyousuu):
    ninnkiCounter += 1
    

if (arrayNM[1] <= ninnkiCounter):
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

Solution code:
n, m = [int(x) for x in input().split()]
a = [int(x) for x in input().split()]

a.sort()
a.reverse()
print('Yes' if (a[m] >= (sum(a) / (4 * m))) else 'No')

Submission status: Runtime Error

Solution code:
import numpy as np

tmp = list(map(int, input().split()))

N = tmp[0]
M = tmp[1]

i = list(map(int, input().split()))

i = np.array(i)

i = np.sort(i)[::-1]

souwa = np.sum(i)

if i[M] < (souwa * (1/(4*M))):
    print("No")
else:
    print("Yes")
# print(i[0]) #出力：i_1
# print(i[1]) #出力：i_2