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

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

total_votes = sum(A)

total_votes_checker = lambda M, i, total_votes: (False if i < (1 / (4 * M)) * total_votes else True)

A = list(filter(lambda i: total_votes_checker(M, i, total_votes), A))

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

Solution (Python):
n, m = map(int, input().split())
a = list(map(int,input().split()))
a.sort(reverse=True)
s=sum(a)

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

Solution (Python):
n, m = map(int, input().split())
a = list(map(int, input().split()))
sum=num=0
for i in a:
    sum+=i
for i in a:
    if i*m*4>=sum:
        num+=1
if num>=m:
    print('Yes')
else :
    print('No')

Solution (Python):
n,m=map(int,input().split())
a=list(map(int,input().split()))
a.sort(reverse=1)
s=sum(a)
if a[m-1]>=s/(4*m):print('Yes')
else:print('No')

Solution (Python):
n,m = map(int,input().split())
a = sorted(list(map(int,input().split())))
lim = sum(a)/(4*m)
cnt = 0
for i in a:
  if i >= lim:
    cnt += 1
if cnt >= m:
  print('Yes')
else:
  print('No')

Solution (Python):
import math

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

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

border = sum(A)*(1/(4 * M))

B=[i for i in A if i >= border]

if len(B) >= M:
  print("Yes")
  exit()
print("No")

Solution (Python):
n, m = map(int,input().split())
a = list(map(int,input().split()))
s = sum(a) 
a.sort(reverse=True) 
if a[m-1] >= s*(1/(4*m)):
    print("Yes")
else:
    print("No")

Solution (Python):
def is_popular(products, reference):
	for p in products:
		if p < reference:
			return False
	
	return True


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

a.sort(reverse = True)
reference = sum(a) / (4.0 * m)

if is_popular(a[:m], reference):
	print('Yes')
else:
	print('No')

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

sumA=sum(A)

A.sort(reverse=True)

if A[M-1]>=sumA/4/M:
    print("Yes")
else:
    print("No")

Solution (Python):
N,M = map(int,input().split())
A = list(map(int,input().split()))
sum_po = sum(A)
p = [ i for i in A if i * 4 * M >= sum_po ]
if len(p) >= M :
    print('Yes')
else:
    print('No')

Solution (Python):
M = list(map(int,input().split()))[1]
A = list(map(int,input().split()))
S = sum(A)
ans = 0
for a in A:
    if a >= S / 4 / M:
        ans += 1
if ans >= M:
    print("Yes")
else:
    print("No")

Solution (Python):
n,m = tuple(map(int,input().split()))
arr = [int(x) for x in input().split()]
total = sum(arr)
mm = total /(4*m)
mask  = [ x >= mm for x in arr]
if sum(mask) >= m:
  print("Yes")
else:
  print("No")

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

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

sum_A = sum(A)
count = 0
for i in range(N):
    if A[i] / sum_A >= 1 / (4*M):
        count += 1

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

Solution (Python):
input_line = input().split(" ")
N=int(input_line[0])
M=int(input_line[1])
count=0

input_line = input().split(" ")
total=0
for i in range(len(input_line)):
    total=total+int(input_line[i])

border=total/(4*int(M))

for i in range(len(input_line)):
    if int(input_line[i])>=border:
        count=count+1
    

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

Solution (Python):
n, m = map(int, input().split())
a = list(map(int, input().split()))
ans = "Yes"
 
a.sort(reverse=True)
 
for i in range(m):
    if a[i] < sum(a)*(1/(4*m)):
        ans = "No"
        break
 
print(ans)

Solution (Python):
n, m = map(int, input().split())
a = list(map(int, input().split()))
ans = "Yes"

a.sort(reverse=True)

for i in range(m):
    if a[i] < sum(a)*(1/(4*m)):
        ans = "No"
        break

print(ans)

Solution (Python):
n, m = map(int, input().split())
a = list(map(int, input().split()))
ans = "Yes"

a.sort(reverse=True)

for i in range(m):
    if a[i] < sum(a)*(1/(4*m)):
        ans = "No"
        break

print(ans)

Solution (Python):
def resolve():
    a, b = map(int, input().split())
    input_data = [int(_) for _ in input().split()]
    input_data.sort(reverse=True)
    sum_data = sum(input_data)
    converge = sum_data * (1 / (4 * b))

    if(converge > input_data[b - 1]):
        print("No")
    else:
        print("Yes")


resolve()

Solution (Python):
import numpy as np

def main():
    args1, args2 = input().rstrip().split(' '), input().rstrip().split(' ')
    N, M = int(args1[0]), int(args1[1])
    items = np.array([int(val) for val in args2])
    items = np.sort(items)[::-1]
    items_sum = np.sum(items)
    bottom = items_sum / 4. / M
    
    if(items[M-1] >= bottom):
        print('Yes')
    else:
        print('No')
    
if __name__ == "__main__":
    main()

Solution (Python):
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")

Solution (Python):
def resolve():
    a, b = map(int, input().split())
    input_data = [int(_) for _ in input().split()]
    input_data.sort(reverse=True)
    sum_data = sum(input_data)
    converge = sum_data * (1 / (4 * b))

    if(converge > input_data[b - 1]):
        print("No")
    else:
        print("Yes")
resolve()

Solution (Python):
n,m=map(int,input().split())
a=list(map(int,input().split()))
a.sort()
b=a[::-1]
if b[m-1]<sum(a)/(4*m):
    print("No")
elif True:
    print("Yes")

Solution (Python):
n,m = map(int,input().split())
list = [int(x) for x in input().split()]
sum=0
for i in list:
    sum+=i
resultList = []
for i in list:
    if(sum/4/m <= i):
        resultList.append(i)
if(len(resultList)>=m):
    print('Yes')
else:
    print('No')

Solution (Python):
a,b=map(int,input().split())
n=list(map(int,input().split()))
n.sort()
n.reverse()
if sum(n)/(4*b)>n[b-1]:
  print("No")
else:
  print("Yes")

Solution (Python):


n, m = map(int, input().split())
votes = [int(i) for i in input().split()]
z = sum(votes)
if sum(map(lambda x: x >= z / (4*m), votes)) >= m:
    print('Yes')
else:
    print('No')

Solution (Python):
n, m = map(int, input().split())
a_list = list(map(int, input().split()))
count = 0
suma = sum(a_list)

for i in range(n):
  if a_list[i] >= (suma / (4*m)):
    count += 1
  
if count >= m:
  print("Yes")
else:
  print("No")

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

cnt = 0

for i in range(n):
  if a[i] >= sum(a)/(4*m):
    cnt += 1

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

Solution (Python):
N, M = list(map(int, input().split()))
A = list(map(int, input().split()))
summ = 0
count = 0
for i in range(N):
    summ += A[i]

for i in range(N):
    if A[i] >= summ / (4 * M):
        count += 1

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

Solution (Python):
import sys
input = sys.stdin.readline


n, m = map(int, input().split())
a = list(map(int, input().split()))
suma, cnt = sum(a), 0

for i in range(n):
    if a[i] >= suma / 4 / m:
        cnt += 1

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

Solution (Python):
n,m = map(int,input().split())
s = list(map(int,input().split()))
s.sort(reverse = True)
s1 = s[:m]
if(s1[-1]<sum(s)/(4*m)):
    print("No")
else:
    print("Yes")

Solution (Python):
n,m = map(int,input().split())
s = list(map(int,input().split()))
s.sort(reverse = True)
s1 = s[:m]
if(s1[-1]<sum(s)/(4*m)):
    print("No")
else:
    print("Yes")

Solution (Python):
n,m=map(int,input().split())
a=sorted(list(map(int,input().split())))[::-1]
s=sum(a)/(4*m)
print('Yes' if a[m-1]>=s else 'No')

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

if len([i for i in A if i >= sum(A)/4/N[1]]) >= N[1]:
  print("Yes")
else:
  print("No")

Solution (Python):
n, m = map(int, input().split())
a = list(map(int, input().split()))
a_sum = sum(a)
cnt = 0
for vote in a:
    if vote >= a_sum / (4 * m):
        cnt += 1
if cnt >= m:
    print("Yes")
else:
    print("No")

Solution (Python):
N,M=map(int,input().split())
A = list(map(int, input().split()))
select=0
for i in range(len(A)):
    if A[i]>=sum(A)*(1/(4*M)):
        select+=1
    
def ans(M,select):   
    if M<=select:
         return 'Yes'
    
    else:
         return 'No'

print(ans(M,select))

Solution (Python):
n, m = map(int, input().split())
list_a = list(map(int, input().split()))

total_vote = 0
for a in list_a:
  total_vote += a
count = 0
for a in list_a:
  if a >= total_vote/(4*m):
  	count += 1
if count >= m:
  print('Yes')
else:
  print('No')

Solution (Python):

N, M = map(int, input().split())
A = list(map(int, input().split()))
ans = 0
total = sum(A)
for i in range(N):
    if A[i]*4*M >= total:
        ans += 1
print("Yes" if ans >= M else "No")

Solution (Python):
n, m = map(int, input().split())
a = list(map(int, input().split()))
a.sort(reverse=True)

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

Solution (Python):
from sys import stdin
N, M = [int(_) for _ in stdin.readline().rstrip().split()]
A = sorted([int(_) for _ in stdin.readline().rstrip().split()], reverse=True)
if A[M-1] >= sum(A) / (4*M):
  print('Yes')
else:
  print('No')

Solution (Python):
n,m = [int(x) for x in input().split()]
arr = [int(x) for x in input().split()]
res=0
total = sum(arr)
for x in arr:
  if x>=(1/(4*m))*total:
    res+=1
if res>=m:
  print('Yes')
else:
  print('No')

Solution (Python):

def main():
    n, m = map(int, input().split())
    a = list(map(int, input().split()))
    a.sort(reverse = True)
    s = sum(a)
    for i in range(m-1,-1, -1):
        if a[i]*4*m < s:
            print("No")
            return
    print("Yes")
if __name__ == "__main__":
    main()

Solution (Python):
def resolve():
    n, m = map(int, input().split())
    a = list(map(int, input().split()))
    a = sorted(a, reverse = True)
    total =sum(a)
    if a[m-1] < total/(4*m):
        print("No")
    else:
        print("Yes")
resolve()

Solution (Python):
import bisect
N, M = map(int, input().split())
A = list(map(int, input().split()))
A.sort(reverse = True)
thr = sum(A) / (4*M)
ans = 0
for i in A:
    if i >= thr:
        ans+=1
    else:
        break
if ans >= M:
    print('Yes')
else:
    print('No')

Solution (Python):


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

sum = 0
for i in range(n):
    sum += v[i]
count = 0

for i in range(m):
    if max(v) < (sum/4/m):
        break
    count += 1
    v.remove(max(v))

if count == m:
    print("Yes")
else:
    print("No")

Solution (Python):
n,m = map(int,input().split())
a = list(map(int,input().split()))
a.sort(reverse=True)
s = sum(a)
for i in range(m):
    if a[i] < s/(4*m):
        print("No")
        exit()
print("Yes")

Solution (Python):
t = list(map(int,input().split()))
a = list(map(int,input().split()))
s = sum(a)
count = 0

for i in range(t[0]):
    if a[i] >= s/(4 * t[1]):
        count += 1

if count >= t[1]:
    print("Yes")
else:
    print("No")

Solution (Python):
N,M=map(int, input().split())
A=[int(i) for i in input().split()]
sum=0
for i in range(0, N):
  sum+=A[i]
x=sum/(4*M)
item=0
for i in range(0, N):
  if(A[i]>=x):
    item+=1
if(item>=M):
  print("Yes")
else:
  print("No")

Solution (Python):
num=input().rstrip().split(" ")
N=int(num[0])
M=int(num[1])
date=input().rstrip().split(" ")
sum=0
for i in range(N):
  sum+=int(date[i])
for j in range(len(date)):
  date[j]=int(date[j])
date=sorted(date,reverse=True)
if (sum/4)/M<=int(date[M-1]):
  print("Yes")
else:
  print("No")

Solution (Python):
import numpy as np
N, M = map(int, input().split())
As = np.array(input().split(), dtype=int)

s = As.sum()
th = s / (4 * M)
print("Yes") if (As >= th).sum() >= M else print("No")

Solution (Python):

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


A_list = list(map(int, input().split()))
A_list_sum = sum(A_list)


count = 0
aa = A_list_sum/(4*M)

for  i in range(len(A_list)):
  
  if(A_list[i]>=aa):
    count = count + 1
    
    
if(count >= M):
  print("Yes")
else:
  print("No")

Solution (Python):
n,m = map(int, input().split())
a = list(map(int, input().split()))
a.sort(reverse=True)

if a[m - 1] < sum(a) / (4 * m):
    print("No")
else:
    print("Yes")

Solution (Python):
n, m = map(int, input().split())
a = list(map(int, input().split()))
total = sum(a)

count = 0
judge = lambda x: x >= total * (1 / (4 * m))
for vote in a:
  if judge(vote):
    count += 1
  if count >= m:
    print("Yes")
    exit()
print("No")

Solution (Python):
def main():
  n,m=map(int,input().split())
  a=list(map(int,input().split()))
  total=sum(a)
  a.sort()
  if a[-m]<total/(4*m):
    print("No")
  else:print("Yes")

if __name__ == "__main__":
  main()

Solution (Python):
N, M = [int(i) for i in input().split()]
A = [int(i) for i in input().split()]
minimum_votes = sum(A) * (1 / (4 * M))

eligible_products = [a for a in A if a >= minimum_votes]

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

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

x = (1 / (4 * M)) * sum(A)
A = [a for a in A if a >= x]

print('Yes' if len(A) >= M else 'No')

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

total = sum(A)
boader = total / (4*M)
ans = 0
for a in A:
    if boader <= a:
        ans += 1

print('Yes' if M <= ans else 'No')

Solution (Python):
def main():
    N,M=map(int,input().split())
    str=list(map(int,input().split()))
    cal=sum(str)
    str.sort(reverse=True)

    for i in range(M):
        if str[i]<cal*(1/(4*M)):
            print("No")
            return

    print("Yes")
    return

main()

Solution (Python):
N, M = map(int, input().split())
A = sorted(map(int, input().split()), reverse=True)
total = sum(A)
print('No' if A[M - 1] * (4 * M) < total else 'Yes')

Solution (Python):
size, comp = input().split()
size = int(size)
comp = int(comp)
vote_list = list(map(int, input().split()))
data = len(list(filter(lambda x: x >=(sum(vote_list)/(4*comp)), vote_list)))
print("Yes" if data>=comp else "No")

Solution (Python):
def B():
    NM=list(map(int,input().split()))
    A=list(map(int,input().split()))
    
    sum_A=sum(A)
    ans_list=list(filter(lambda x: x>=sum_A*(1/(4*NM[1])), A))
    
    if len(ans_list)>=NM[1]: print('Yes')
    else : print('No')
        
        
if __name__=='__main__':
    B()

Solution (Python):
def readInts():
  return list(map(int, input().split()))

n,m = readInts()
a = readInts()
s = sum(a)
cnt = 0
for i in range(n):
  if a[i]*4*m >= s:
    cnt += 1
if cnt >= m: print("Yes")
else: print("No")

Solution (Python):
import numpy as np


N,M = map(int,input().split())
A = np.array([int(x) for x in input().split()])
S = sum(A)/(4*M)

if np.count_nonzero(A>=S) >= M:
    print("Yes")
else:
    print("No")

Solution (Python):
n, m = map(int, input().split())
a = list(map(int, input().split()))
Sum = 0
for x in a:
    Sum += x
cnt = sum([1 if i * 4 * m >= Sum else 0 for i in a])
if cnt >= m:
    print("Yes")
else:
    print("No")

Solution (Python):
n, m = map(int, input().split())
a = list(map(int, input().split()))
sum = 0
for x in a:
    sum += x
cnt = 0
for x in a:
    if(x * 4 * m >= sum):
        cnt += 1
        
if cnt >= m:
    print("Yes")
else:
    print("No")

Solution (Python):
import sys


def solve():
    readline = sys.stdin.buffer.readline
    mod = 10 ** 9 + 7
    n, m = list(map(int, readline().split()))
    a = list(map(int, readline().split()))
    sa = sum(a)
    cnt = 0
    for v in a:
        if v >= sa / (4 * m):
            cnt += 1
    print("Yes" if cnt >= m else "No")


if __name__ == '__main__':
    solve()

Solution (Python):
i = input().split()
n = int(i[0])
m = int(i[1])

i2 = input().split()
a = [int(i2) for i2 in i2]
m2 = sum(a) / (4 * m)
c = sum([1 if i3 >= m2 else 0 for i3 in a])
print("Yes" if c >= m else "No", end='')

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

a.sort(reverse=True)
total = sum(a)

if a[m - 1] < 1/(4*m) * total:
    print("No")
else:
    print("Yes")

Solution (Python):
x = input().split()
y = input().split()



a = [int(i) for i in x]
b = [int(i) for i in y]

M = a[1]
s = sum(b)
c = 0
f = False

for i in b:
    if i >= ((1/(4*M)*s)):
        c += 1
    if c == M:
        print("Yes")
        f = True
        break

if not f:
    print("No")

Solution (Python):
N, M = map(int, input().split())
A = sorted(map(int, input().split()))
print("Yes" if A[-M] >= sum(A)/(4*M) else "No")

Solution (Python):
N,M=map(int,input().split())
A=sorted(map(int,input().split()))
print("Yes" if A[-M]>=sum(A)/(4*M) else "No")

Solution (Python):
N, M = map(int, input().split())
A = sorted(map(int, input().split()))[::-1]
print("Yes" if A[M-1] >= sum(A)/(4*M) else "No")

Solution (Python):
N,M=map(int,input().split())
A=sorted(map(int,input().split()))[::-1]
print("Yes" if A[M-1]>=sum(A)/(4*M) else "No")

Solution (Python):
nm = input()
N = int(nm[:nm.index(" ")])
M = int(nm[nm.index(" ")+1:])
A = list(map(int,input().split()))
A.sort()
restriction = 1/(4*M)*sum(A)
string = "Yes"
for i in range(N-1,N-M-1,-1):
	if A[i]<restriction:
		string = "No"
		break;
print(string)

Solution (Python):
def main():
  n,m = [int(x) for x in input().split()]
  a = [int(x) for x in input().split()]
  total = sum(a)
  
  can_be_selected = list(filter(lambda x: x >= total/4/m, a))
  if len(can_be_selected) >= m:
    print("Yes")
  else:
    print("No")

main()

Solution (Python):
n, m = map(int, input().split())
a = sorted(list(map(int, input().split())))[::-1]
for i in range(m):
    if a[i] < sum(a) / (4 * m):
        print("No")
        exit()
    if i == m - 1:
        print("Yes")

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

Solution (Python):
buf = input().split()
n = int(buf[0])
m = int(buf[1])

buf = input().split()
votes = [int(v) for v in buf]

numVotes = sum(votes)

ct = 0
for v in votes:
  if v >= numVotes/4.0/m:
    ct += 1
  if ct >= m:
    break
if ct >= m:
  print('Yes')
else:
  print('No')

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

Solution (Python):
N, M = [int(_) for _ in input().split()]
A = [int(_) for _ in input().split()]

s = sum(A) / 4 / M
c = sum(1 for a in A if a >= s)

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

Solution (Python):
n, m = input().split()
b = input().split()
sum = 0
for x in b:
    sum += int(x)
yy=0
for y in b:
    if int(y) >= sum/(4*int(m)):
        yy+=1
if yy < int(m):
    print("No")
else:
    print("Yes")

Solution (Python):
N,M = map(int,input().split())
arr = list(map(int,input().split()))

res = 0
for i in range(N):
    if arr[i] < (1/(4*M)*sum(arr)):
        res = res
    else:
        res += 1

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

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

Solution (Python):
n,m = map(int, input().split())
al = list(map(int, input().split()))

s = sum(al)
t = s/(4.0*m)
res = 0
for a in al:
    if a>=t:
        res += 1

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

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

Solution (Python):
N, M = list(map(int, input().split()))
As = list(map(int, input().split()))

totalvotes = sum(As)
As.sort()
found = 0
for i in range(len(As)):
    if As[i] >= 1/(4*M)*(totalvotes):
        found += 1

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

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

l.sort()
if l[-M] >= sum(l)/4/M:
    print("Yes")
else:
    print("No")

Solution (Python):
n,m=map(int,input().split())
li=list(map(int,input().split()))
li.sort()
li.reverse()
N=sum(li)
M=m*4
x=int(li[m-1])
if x < N/M:
    print('No')
else:
    print('Yes')

Solution (Python):
nm = input().split(' ')
a = input().split(' ')
total = 0
count = 0

for n in a:
    total += int(n)

for n in a:
    if int(n) >= total / (4 * int(nm[1])):
        count += 1

if count >= int(nm[1]):
    print("Yes")
else:
    print("No")

Solution (Python):
n, m = map(int, input().split())
votes = list(map(int, input().split()))

k = 0

for i in votes:
    if i >= 1/(4*m) * sum(votes):
        k += 1

if k >= m:
    print("Yes")

else:
    print("No")

Solution (Python):
def main():
    N, M = map(int, input().split())
    A = list(map(int, input().split()))
    A.sort(reverse=True)
    total = sum(A)
    threshold = -(-total // (4*M))
    if A[M-1] >= threshold:
        print("Yes")
    else:
        print("No")


if __name__ == "__main__":
    main()

Solution (Python):
N,M=map(int,input().split())
A=[int(x) for x in input().split()]
S=sum(A)
print('Yes' if len([x for x in A if x*4*M>=S])>=M else 'No')

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

if sorted(A,reverse=True)[M-1]<sum(A)/4/M:
    print("No")
else:
    print("Yes")

Solution (Python):
N, M = map(int, input().split())
lst = [int(x) for x in input().split()]
total = sum(lst)
ret = 0
for x in lst:
    if x >= total / (4 * M):
        ret += 1

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

Solution (Python):
N, M = map(int, input().split())
A = list(map(int, input().split()))
soutouhyou = sum(A)
B = 1 / (4 * M)
C = soutouhyou * B
count = 0
for a in A:
  if a >= C:
    count += 1

if count < M:
  print("No")
else:
  print("Yes")

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

count = 0
for i in range(N):
    if sum(A) / (4 * M) <= A[i]:
        count += 1

if M <= count:
    print('Yes')
else:
    print('No')

Solution (Python):
n, m = [int(i) for i in input().split()]
a = list(map(int, input().split()))
a.sort(reverse=True)
if a[m-1] < sum(a) / (4*m):
    print('No')
else:
    print('Yes')

Solution (Python):
N,M = input().split()
N = int(N)
M = int(M)
count = 0
import numpy as np
a = np.array(input().split()).astype(int)
count = len(a[a>=a.sum()*(1/(4*M))])
if count >= M:
    print("Yes")
else:
    print("No")

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

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

Solution (Python):
N,M=map(int,input().split())
A=list(map(int,input().split()))
Change=True
round=1
while Change:
    Change=False
    for i in range(N-1):
        if A[i+1]>A[i]:
            temp=A[i+1]
            A[i+1]=A[i]
            A[i]=temp
            Change=True
    round+=1
popular=A[0:M]
SUM=sum(A)
count=True
for j in range(M):
    if SUM*(1/(4*M))>popular[j]:
        count=False
if(count):
    print("Yes")
else:
    print("No")

Solution (Python):

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


A.sort()



S=sum(A)

if A[-M]>=S/(4*M): 
    print('Yes')
else: 
    print('No')

Solution (Python):
n,m = map(int, input().split())
a=list(map(int, input().split()))
c=sum(a)/(4*m)
b=0
for i in a:
    if i>=c:
        b+=1
if b>=m:
    print('Yes')
else:
    print('No')

Solution (Python):
n,m = map(int,input().split())
Ai = list(map(int,input().split()))

sum = 0

for i in Ai:
	sum += i

S = sorted(Ai,reverse=True)

if S[m-1] >= sum/(4*m):
  print("Yes")
else:
  print("No")

Solution (Python):
n,m=map(int,input().split())
l=list(map(int,input().split()))

ans=0
x=sum(l)
for i in l:
    if i*4*m>=x:
        ans+=1
if ans>=m:
    print('Yes')
else:
    print('No')

Solution (Python):
n,m = map(int,input().split())
a = list(map(int,input().split()))
a = sorted(a, reverse=True)
all = sum(a)

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

Solution (Python):
N, M = [int(i) for i in input().split()]
A = [int(i) for i in input().split()]
sum = 0
for item in A:
  sum += item

for i in range(0, M):
  max = 0
  for item in A:
    if max < item:
      max = item
  if max >= sum/(4*M):
    A.remove(max)

if len(A) == N-M:
  print("Yes")
else:
  print("No")

Solution (Python):
n, m = list(map(int, input().split()))
v = list(map(int, input().split()))
t = sum(v)/(4*m)

ct = 0
for i in v:
    if i>=t:
        ct += 1
        
if ct >= m:
    print("Yes")
else:
    print("No")

Solution (Python):
n, m = map(int, input().split())
products = list(map(int, input().split()))
line = sum(products) / (4 * m)
bools = [1 if i >= line else 0 for i in products]
if sum(bools) >= m:
    print('Yes')
else:
    print('No')

Solution (Python):
numbers = input()
numberVotes, numberItems = numbers.split(" ")

votes = input()
votes = votes.split(" ")
totalVotes = sum([int(x) for x in votes])
thrashold = (totalVotes/(4 * int(numberItems)))
filtered = list(filter(lambda item: int(item) >= thrashold, votes))
x = "No"
if len(filtered) >= int(numberItems):
  x = "Yes"
print(x)

Solution (Python):
import math

N, M = (int(x) for x in input().split(' '))
A = [int(x) for x in input().split(' ')]

limen = math.ceil(sum(A) / ( M * 4))

ans = 0
for row in A:
  if row >= limen:
    ans += 1

print( 'Yes' if ans >= M else 'No' )

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

count = 0
sum_A = sum(A)
for i in range(N):
  if A[i] >= sum_A*(1/(4*M)) :
    count += 1
print('Yes' if count >= M else 'No')

Solution (Python):
N, M = map(int, input().split())
A = list(map(int, input().split()))
all_count = sum(A)
count = 0
for i in A:
    if i >= (all_count / (4*M)):
        count += 1
        
if count >= M:
    print("Yes")
else:
    print("No")

Solution (Python):
N, M = map(int,input().split())
a = list(map(int,input().split()))
a.sort(reverse=True)
if a[M-1] >= sum(a) / (4*M):
	print("Yes")
else:
	print("No")

Solution (Python):
N,M = map(int, input().split())
A = input().split()
A = [int(i) for i in A]

limit = sum(A) / (4*M)
flag = 0

for i in A:
  if i>=limit: flag += 1
    
if flag>=M: print('Yes')
else: print('No')

Solution (Python):
N, M = map(int, input().split())

A = input().split()
A = [int(i) for i in A]

count = 0

for i in A:
    if i >= sum(A)*(1/(4*M)):
        count += 1

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

Solution (Python):
def solve(N,M, array):
    sum_ = sum(array)
    array.sort()

    for i in range(N-1, N-M-1, -1):
        if array[i] < (1/(4*M))*sum_:
            return "No"

    return "Yes"


if __name__=="__main__":
    N, M = map(int, input().split())
    arr = list(map(int, input().split()))

    print(solve(N, M, arr))

Solution (Python):
N, M = map(int, input().split())
A = list(map(int,input().split()))
B = 0

for i in range(N):
    if (A[i] >= sum(A) / (4*M)):
        B +=1

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

Solution (Python):
N, M = map(int, input().split())
A = list(map(int,input().split()))
B = 0
for i in range(N):
  if(A[i] >= sum(A)/(4*M)):
    B += 1
if(B >= M):
  print('Yes')
else:
  print('No')

Solution (Python):



from sys import stdin, stdout

n, m = map(int, stdin.readline().split())
a = sorted(list(map(int, stdin.readline().split())), reverse=True)
items = 0
for item in a:
    if items >= m or item < sum(a) / (4 * m):
        break
    items += 1
if items >= m:
    stdout.write("Yes\n")
else:
    stdout.write("No\n")

Solution (Python):
N,M = (int(i) for i in input().split())
A = [int(i) for i in input().split()]
judge = sum(A)/(4 * M)
result = N
for i in range(N):
    if A[i] < judge:
        result -= 1
    if result < M:
        break
if result >= M:
    print("Yes")
else:
    print("No")

Solution (Python):
n,m=map(int,input().split())
A=list(map(int,input().split()))
S=sum(A)

ans=0
for i in A: 
      if i>=S*(1/(4*m)):
            ans+=1
if ans>=m:
      print('Yes')
else:
      print('No')

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

cnt = 0
for x in A:
    if x >= sum(A) / (4 * M):
        cnt += 1

print("Yes" if cnt >= M else "No")

Solution (Python):
check=True
a,b=map(int,input().split())
l=list(map(int,input().split()))
l.sort()
l.reverse()
point=sum(l)/(4*b)
for i in range(b):
    if l[i]<point:
        check=False
        break
if check:
    print("Yes")
else:
    print("No")

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

x = max(a)
s = 0
for i in a:
    s += i
y = [l for l in a if l >=s/4/m]
if len(y) >=m:
    print('Yes')
else:
    print('No')

Solution (Python):
n,m=map(int,input().split(" "))
lis2=map(int,input().split(" "))

lis2=sorted(lis2,reverse=True)
sum1=sum(lis2)
count=0
for i in range(0,m):
  if(lis2[i]>=((1/(4*m))*sum1)):
    count=0
  else:
    count=1
    break
if(count==1):
  print("No")
else:
  print("Yes")

Solution (Python):
N,M = map(int,input().split())

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

sum_votes = sum(A)

base_line = sum_votes / (4*M)

count = 0

for i in range(N):
    if A[i] >= base_line:
        count += 1

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

Solution (Python):
N,M = list(map(int,input().split()))
A = list(map(int,input().split()))
count=0
min_ = (1/(4*M))*sum(A)

for each in A:
	if each >= min_:
		count+=1
if (count<M):
 	print("No")
else:
	print("Yes")

Solution (Python):
import math
import string
import collections
from collections import Counter
from collections import deque


def readints():
    return list(map(int, input().split()))


def nCr(n, r):
    return math.factorial(n)//(math.factorial(n-r)*math.factorial(r))


def has_duplicates2(seq):
    seen = []
    for item in seq:
        if not(item in seen):
            seen.append(item)
    return len(seq) != len(seen)


def divisor(n):
    divisor = []
    for i in range(1, n+1):
        if n % i == 0:
            divisor.append(i)
    return divisor



dx = [-1, -1, -1, 0, 0, 1, 1, 1]
dy = [-1, 0, 1, -1, 1, -1, 0, 1]

nm = readints()
a = readints()
sum = 0
for i in range(nm[0]):
    sum += a[i]
touhyou = sum*(1/(4*nm[1]))
cnt = 0
for i in range(nm[0]):
    if a[i] >= touhyou:
        cnt += 1
if cnt >= nm[1]:
    print('Yes')
else:
    print('No')