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()))
A.sort(reverse=True)
sum_A=sum(A)
count=0
for i in range(M):
    if A[i]/sum_A>=1/(4*M):
        count+=1

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

Solution (Python):
n, m = map(int, input().split())
L = list(map(int, input().split()))
a = 0
for i in range(len(L)):
  a = a + L[i] 
a = a / (4*m) 
nL = sorted(L, reverse=True)
if a <= nL[m-1]:
  print("Yes")
else:
  print("No")

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

for i in a:
    ALL+=i


for i in range(m):
    if a[i]>=ALL/(4*m):
        cnt+=1
        if cnt==m:
            print("Yes")
    else:
        print("No")
        break

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

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

Solution (Python):
import bisect, collections, copy, heapq, itertools, math, string
import sys
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return map(int, sys.stdin.readline().rstrip().split())
def LI(): return list(map(int, sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())


def main():
    N, M = MI()
    A = LI()
    a = sum(A) / (4 * M)
    A.sort()
    cnt = bisect.bisect_left(A, a)
    if N - cnt >= M:
        print('Yes')
    else:
        print('No')
if __name__ == "__main__":
    main()

Solution (Python):
import sys
sys.setrecursionlimit(10**9)

def mi(): return map(int,input().split())
def ii(): return int(input())
def isp(): return input().split()
def deb(text): print("-------\n{}\n-------".format(text))

INF=10**20
def main():
    N,M=mi()
    A=list(mi())

    sum_vote = sum(A)
    count = 0
    for a in A:
        if a >= sum_vote / (4*M):
            count +=1 
    
    print("Yes" if count >= M else "No")



if __name__ == "__main__":
    main()

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())
l = list(map(int, input().split()))
c = 0
for index in l:
  if index >= sum(l)/(4*m):
    c += 1
print("Yes" if c >= m else "No")

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

Solution (Python):
import numpy as np
n, m = map(int, input().split())
A = np.array(list(map(int, input().split())))
print("Yes" if np.sum(A >= np.sum(A)/(4*m)) >= m else "No")

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

Solution (Python):
count = 0
n, m = map(int, input().split())
a = list(map(int, input().split()))
for i in range(n):
    if a[i] >= sum(a)/4/m:
        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()))

cnt = 0
s = 0

for i in range(N):
    s += A[i]

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

print(['No', 'Yes'][N - cnt >= M])

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

k = sum(A) / (4*M)
print('Yes' if [a >= k for a in A].count(True) >= M else 'No')

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

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

for a in A:
  if a>=lim:
    ans+=1
    
if ans>=M:
  print("Yes")
else:
  print("No")

Solution (Python):
n, m = map(int, input().split())
a = sorted(map(int, input().split()))[::-1]
i = 0
for j in range(n):
    i = i + a[j]
x = i / (4 * m)
print("Yes" if a[m - 1] >= x else "No")

Solution (Python):

def main():
    n, m = map(int, input().split())
    A_array = list(map(int, input().split()))
    
    tmp_A_array = [x for x in A_array if x >= sum(A_array)/(4*m)]
    
    
    if len(tmp_A_array) >= m:
        print("Yes")
    else:
        print("No")
    
main()

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

Solution (Python):
from decimal import Decimal

n,m = map(int, input().split())
A = list(map(int, input().split()))
line = Decimal(sum(A) / (4 * m))
cnt = 0
for a in A:
    if a >= line:
        cnt += 1
    if cnt >= m:
        print('Yes')
        break
else:
    print('No')

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


s = sum(a)
needed = s/4/m if s%(4*m) == 0 else s//(4*m)+1

for i in range(m):
    if a[i] < needed:
        print("No")
        break
else:
    print("Yes")

Solution (Python):
n, m = map(int, input().split())
a = sorted(map(int, input().split()), reverse = True)
total = sum(a)
cnt = 0
for i in a:
  if i * 4 * m >= total:
    cnt += 1
  else:
    break
if cnt >= m:
  print("Yes")
else:
  print("No")

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

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

Solution (Python):

def main():
    N, M = map(int, input().split())
    A = sorted([int(x) for x in input().split()], reverse=True)

    level = sum(A) / (4 * M)
    if A[M - 1] < level:
        print('No')
    else:
        print('Yes')


if __name__ == '__main__':
    main()

Solution (Python):
from decimal import Decimal
n,m = map(int,input().split())
A = list(map(int,input().split()))
border = float(sum(A)/(4*m))
border2 = str(border)
border3 = Decimal(border2)
ans = 0
judge = 0
for i in range(n):
  if A[i] >= border3:
    ans+=1
if ans >= m:
  print("Yes")
else:
  print("No")

Solution (Python):
from decimal import Decimal
n,m = map(int,input().split())
A = list(map(int,input().split()))
border = float(sum(A)*(1/(4*m)))
border2 = str(border)
border3 = Decimal(border2)
ans = 0
judge = 0
for i in range(n):
  if A[i] >= border3:
    ans+=1
if ans >= m:
  print("Yes")
else:
  print("No")

Solution (Python):
def main():
    n,m = map(int, input().split())
    a = list(map(int,input().strip().split()))
    t = sum(a)
    c = 0
    for aa in a:
        if aa >= t / (4*m):
            c += 1
    if c >= m:
        print("Yes")
        return 
    else:
        print("No")
        return
main()

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

cnt = 0
sumA = sum(A)
for a in A:
  if a >=  sumA / 4 / M:
    cnt += 1
if cnt >= M:
  print('Yes')
else:
  print('No')

Solution (Python):
def solve():
    N,M = [int(i) for i in input().split()]
    A = [int(i) for i in input().split()]
    total = sum(A)
    threshold = float(total) / (4*M)
    cnt = 0
    for num in A:
        if num >= threshold:
            cnt += 1
    if cnt >= M:
        print("Yes")
    else:
        print("No")

if __name__ == "__main__":
    solve()

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

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

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

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

Solution (Python):

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

Solution (Python):
n,m=map(int, input().split())
c = 1 / (4*m)
ans = 0
l = [int(x) for x in input().split()]
l.sort(reverse=True)

for i in range(m):
    if l[i] < sum(l)*c:
        print("No")
        ans += 1
        break

if ans == 0:
    print("Yes")

Solution (Python):
import numpy as np
p,q= input().split()
a,b =(int(p), int(q))
ans_list = input().split()
ans_list =np.array(ans_list).astype(float)

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

if ans_list[b-1] >= sum(ans_list)/4/b:
    print('Yes')
else:
    print('No')

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

if len([i for i in a if i >= sum(a)/(4*m)]) >= m:
    print("Yes")
else:
    print("No")

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

Solution (Python):
n,m=map(int,input().split())
A=list(map(int,input().split()))
B=sorted(A,reverse=True)
sum=0
for i in range(n):
    sum+=B[i]
if 4*m*B[m-1]<sum:
    print("No")
else:
    print("Yes")

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

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

    A = sorted(A)[::-1]
    s = sum(A)
    cnt = 0
    for i in range(M):
        if s<=4*M*A[i]:
            cnt += 1
    if cnt==M:
        print("Yes")
    else:
        print("No")

Solution (Python):
n, m = input().split()
n = int(n)
m = int(m)
c=0

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

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

i = 0
s = 0
sum = sum(a)

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

if s >= m:
    print('Yes')

else:
    print('No')

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

Solution (Python):
if __name__ == '__main__':
    N, M = map(int, input().split())
    A = list(map(int, input().split()))
    total = sum(A)
    threshold = total / (4*M)
    count = sum([a>=threshold for a in A])
    if count >= M:
        print('Yes')
    else:
        print('No')

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

Solution (Python):
def main():
  n,m = list(map(int,input().split()))
  a = list(map(int,input().split()))
  ans=0
  num=sum(a)
  
  for i in range(0,n):
    if a[i] >= num/(4*m):
      ans+=1
      if ans==m:
        break
  if ans >= m:
    print("Yes")
  else:
    print("No")
  
main()

Solution (Python):
n,m =map(int,input().split())
a = list(map(int,input().split()))
cnt=0;s=0;
for i in range(n):
  s += a[i]

for i in a:
  if i *4*m>=s: cnt +=1
  if cnt >= m:
    print("Yes")
    break
  
else:
  print("No")

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

Solution (Python):


N, M = map(int, input().split())  
a = sorted(list(map(int, input().split())),reverse=True)
x = sum(a)
q = x / (4 * M)
b =[]
for i in range(M):
    b.append(a[i])
b = sorted(b)
for j in b:
    if j < q:
        print('No')
        exit()
print('Yes')

Solution (Python):
n,m = map(int,input().split())
a = list(map(int, input().split()))
s = 0
for i in a:s+=i

ans = 0
for i in a:
    if(i >= s/(4*m)):
        ans+=1
if(ans >= m):print("Yes")
else:print("No")

Solution (Python):
n, m = map(int, input().split())
lst = [int(i) for i in input().split()]

s = 0
for i in range(n):
  s += lst[i]
count = 0
for i in range(n):
  if lst[i] * 4 * m >= s:
    count += 1
if count >= 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(' ')]
th = sum(A) / (4 * M)
print('Yes' if len([a for a in A if a >= th]) >= M else 'No')

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

Solution (Python):
NN = input().split()
N = int(NN[0])
M = int(NN[1])
AA = input().split()
total1 = 0
total2 = 0
for i in AA:
  total1 += int(i)
for i in AA:
  if float(i) >= total1/(4*M):
    total2 +=1
if total2 >= M:
  print('Yes')
else:
  print('No')

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

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

Alst.sort(reverse = True)
k = sum(Alst) / M
if Alst[M-1] < k/4:
    print('No')
else:
    print('Yes')

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

allvote=0
allvote=sum(A)


c=0
for a in A:
    if a>=allvote/(4*k) :
        c+=1

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

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

Solution (Python):
n ,m = map(int, input().split())
a = list(map(int,input().split()))
ans = 0
refer = sum(a) / (4*m)

for ni in range(n):
    if a[ni] >= refer:
        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.sort()
A.reverse()
if A[M - 1] * 4 * M < sum(A):
    print("No")
else:
    print("Yes")

Solution (Python):
N, M = map(int, input().split())
A = list(map(int,input().split()))
A.sort()
total=sum(A)
i=0
flg="Yes"
while i < M:
    if A.pop() < total/(4*M):
        flg="No"
        break
    i += 1
print(flg)

Solution (Python):
N, M = list(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 = list(map(int,input().split()))
a.sort()

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

Solution (Python):
word = list(map(int,input().split()))
score = list(map(int,input().split()))
score.sort()
score.reverse()
gokei = 0
for i in range(word[0]):
    gokei += score[i]
if score[word[1]-1]*4*word[1] >= gokei:
    print('Yes')
else:
    print('No')

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

cnt = 0

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

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

Solution (Python):
n,m=map(int,input().split())
a=list(map(int,input().split()))
cnt=0
suma=sum(a)
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())
lis = sorted(list(map(int, input().split())), reverse=True)
limit = sum(lis) / (4 * m)
if lis[m -1 ] >= limit:
    print('Yes')
else:
    print('No')

Solution (Python):
n, m = map(int, input().split())
lis = sorted(list(map(int, input().split())), reverse=True)
limit = sum(lis) / (4 * m)
judge = 'Yes'
for i in range(m):
    if lis[i] < limit:
        judge = 'No'
        break
print(judge)

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

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

sumA = sum(A)

ans = 0
for a in A:
  if 4 * a * m >= sumA:
    ans += 1
    
if ans >= m:
  print("Yes")
else:
  print("No")

Solution (Python):
import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)

N, M = mapint()
As = list(mapint())

cnt = 0
ALL = sum(As)
for a in As:
    if 4*M*a>=ALL:
        cnt += 1

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

Solution (Python):
N,M,*A = map(int, open(0).read().split())
A.sort()
if A[-M]*4*M >= sum(A):
    print('Yes')
else:
    print('No')

Solution (Python):
import numpy as np
N, M = map(int, input().split())
A = np.array(list(map(int, input().split())))
A.sort()
A = A[::-1] / A.sum()


ans = 'Yes' if A[M - 1] >= 1 / 4 / M else 'No'
print(ans)

Solution (Python):
import sys
import math

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

s = sum(a)
a.sort(reverse=True)
border = s / (4 * m)

ans = True

for i in range(m):
    if (a[i] >= border):
        pass
    else:
        ans = False
        break

if (ans):
    print("Yes")
else:
    print("No")

Solution (Python):
def main():
    n,m = map(int, input().split())
    a = sorted(list(map(int, input().split())),reverse = True)
    all = sum(a)
    cnt = 0
    for i in(a):
        if(i * 4 * m >= all and cnt < m):
            cnt += 1
    if cnt >= m:
        print('Yes')
    else:
        print('No')
main()

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

Solution (Python):
n,m = map(int, input().split())
A = sorted(list(map(int, input().split())))[::-1]

x = 1/(4*m) * sum(A)
cnt = 0
for a in A:
    if a >= x: cnt += 1
    else: break
print("Yes" if cnt >= m else "No")

Solution (Python):




import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
from collections import Counter, deque
from collections import defaultdict
from itertools import combinations, permutations, accumulate, groupby, product
from bisect import bisect_left,bisect_right
from heapq import heapify, heappop, heappush
from math import floor, ceil,pi,factorial
from operator import itemgetter
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def LI2(): return [int(input()) for i in range(n)]
def MXI(): return [[LI()]for i in range(n)]
def SI(): return input().rstrip()
def printns(x): print('\n'.join(x))
def printni(x): print('\n'.join(list(map(str,x))))
inf = 10**17
mod = 10**9 + 7

n,m=MI()
lis=LI()
count=0
lis.sort(reverse=True)
total=sum(lis)
for i in range(n):
    if lis[i]*4*m>=total:
        count+=1
if count>=m:
    print("Yes")
else:
    print("No")

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

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

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

Solution (Python):
n, m = map(int, input().split())
a = list(map(int, input().split()))
s = sum(a) / (4 * m)
ans = 0
for aa in a:
    if aa >= s:
        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.sort(reverse=True)
total = sum(a)
flg = True
for i in range(m):
    if a[i] * 4 * m < total:
        flg = False
        
print('Yes') if flg else print('No')

Solution (Python):
N, M = map(int, input().split(' '))
A_ls = list(map(int, input().split(' ')))
A_ls = [i for i in A_ls if i >=  sum(A_ls)  / (4 * M)]

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

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

total = sum(a)

a.sort(reverse=True)
a_m = a[:m]
if a_m[-1] >= total / (4 * m):
  print('Yes')
else:
  print('No')

Solution (Python):
def main():
    N, M = map(int, input().split())
    *A, = map(int, input().split())

    A.sort(reverse=True)

    tot = sum(A)

    cond = A[M - 1] * 4 * M >= tot

    print('Yes' if cond else 'No')


if __name__ == '__main__':
    main()

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

A.sort(reverse=True)
A_list = A[:M]

vote_sum = sum(A)
ans = 0

for i in A_list:
    if i/vote_sum < 1/(4*M):
        print("No")
        break
    else:
        ans +=1
if ans == M:
    print("Yes")

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

A.sort(reverse=True)
A_list = A[:M]

vote_sum = sum(A)
ans = 0

for i in A_list:
    if i/vote_sum < 1/(4*M):
        print("No")
        break
    else:
        ans +=1
if ans == M:
    print("Yes")

Solution (Python):
N,M = list(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 = list(map(int, input().split()))
a = list(map(int, input().split()))
a.sort(reverse=True)
total = sum(a)
ratio = 1 / (4 * m)
print("Yes" if a[m - 1] >= total * ratio else "No")

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

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

A.sort(reverse=True)

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

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

total = sum(A)
base = total  / (4 * M)

filtered = list(filter(lambda x: x >= base, A))

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

Solution (Python):
a,b=map(int,input().split())
c=list(map(int,input().split()))
d=sum(c)/(4*b)
e=[i for i in c if i<d]
if len(e)>a-b:
  print("No")
else:
  print("Yes")

Solution (Python):
x, y = map(int, input().split())
l = list(map(int, input().split()))
count = 0

for i in range(x):
  if l[i] >= sum(l)*(1/(4*y)):
    count += 1
    
if count >= y:
  print("Yes")
else:
  print("No")

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

y = sorted(x, reverse=True)
if y[m-1] >= sum(x)/(4*m):
  print('Yes')
else:
  print('No')

Solution (Python):
import sys
import math
n, m = map(int, sys.stdin.buffer.readline().split())
a = tuple(map(int, sys.stdin.buffer.readline().split()))

lim = math.ceil(sum(a) / (4 * m))
c = sum(1 for aa in a if aa >= lim)
print('Yes' if c >= m else 'No')

Solution (Python):
n, m = map(int, input().split())
a = list(map(int, input().split()))
print('Yes' if len([ai for ai in a[:] if ai >= sum(a) / (4*m)]) >= m else 'No')

Solution (Python):
import sys, bisect, math, itertools, string, queue, copy
import numpy as np
import scipy
from collections import Counter,defaultdict,deque
from itertools import permutations, combinations
from heapq import heappop, heappush
from fractions import gcd
input = sys.stdin.readline
sys.setrecursionlimit(10**8)
mod = 10**9+7
def inp(): return int(input())
def inpm(): return map(int,input().split())
def inpl(): return list(map(int, input().split()))
def inpls(): return list(input().split())
def inplm(n): return list(int(input()) for _ in range(n))
def inplL(n): return [list(input()) for _ in range(n)]
def inplT(n): return [tuple(input()) for _ in range(n)]
def inpll(n): return [list(map(int, input().split())) for _ in range(n)]
def inplls(n): return sorted([list(map(int, input().split())) for _ in range(n)])

n,m = inpm()
a = list(reversed(sorted(inpl())))
s = sum(a)

ans = "Yes"
for i in range(m):
    if a[i] < s/4/m:
        ans = "No"

print(ans)

Solution (Python):
n,m = map(int,input().split())
x = list(map(int,input().split()))
x.sort(reverse = True)
sumx = sum(x)
limit = sumx/4/m

if x[m-1]>=limit:
    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 = map(int, input().split())
a = list(map(int, input().split()))

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

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

Solution (Python):
n, m = map(int,input().split())
a = list(map(int,input().split()))
h = sum(a)/(4*m)
ans = 0

for i in range(n):
    if a[i] < h:
        continue
    else:
        ans += 1

if ans < m:
    print('No')
else:
    print('Yes')

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






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

Solution (Python):
N,M = list(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):





















































global FLAG_LOG
FLAG_LOG = False


def log(value):
    
    
    if FLAG_LOG:
        print(str(value))


def calculation(lines):
    
    
    N, M = list(map(int, lines[0].split()))
    values = list(map(int, lines[1].split()))
    
    
    
    
    
    
    

    values.sort()
    values = values[::-1]

    log(f'values[M-1]=[{values[M-1]}]')
    log(f'1/(4*M)=[{1/(4*M)}]')

    if values[M-1]/sum(values) < 1/(4*M):
        result = 'No'
    else:
        result = 'Yes'

    return [result]



def get_input_lines(lines_count):
    lines = list()
    for _ in range(lines_count):
        lines.append(input())
    return lines



def get_testdata(pattern):
    if pattern == 1:
        lines_input = ['4 1', '5 4 2 1']
        lines_export = ['Yes']
    if pattern == 2:
        lines_input = ['3 2', '380 19 1']
        lines_export = ['No']
    if pattern == 3:
        lines_input = ['12 3', '4 56 78 901 2 345 67 890 123 45 6 789']
        lines_export = ['Yes']
    return lines_input, lines_export



def get_mode():
    import sys
    args = sys.argv
    global FLAG_LOG
    if len(args) == 1:
        mode = 0
        FLAG_LOG = False
    else:
        mode = int(args[1])
        FLAG_LOG = True
    return mode



def main():
    import time
    started = time.time()
    mode = get_mode()
    if mode == 0:
        lines_input = get_input_lines(2)
    else:
        lines_input, lines_export = get_testdata(mode)

    lines_result = calculation(lines_input)

    for line_result in lines_result:
        print(line_result)

    
    
    
    
    
    
    
    
    
    
    



if __name__ == '__main__':
    main()

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

min_limit = sum(A)*(1 / (4*m))
select_ok = 0

for i in A:
  if i >= min_limit:
    select_ok += 1

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

Solution (Python):




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

total = sum(a)
re = m
for i in range(n):
    if (4*m*a[i] >= total):
        re = re -1
        if (re == 0):
            print("Yes")
            exit()
print("No")

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

Solution (Python):


from typing import *
import collections
import itertools
import math
import sys

INF = float('inf')
YES = "Yes"  
NO = "No"  


def solve(N: int, M: int, A: "List[int]"):
    t = sum(A)/4/M
    return [YES, NO][len([a for a in A if a >= t]) < M]


def main():

    sys.setrecursionlimit(10 ** 6)

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  
    M = int(next(tokens))  
    A = [int(next(tokens)) for _ in range(N)]  
    print(f'{solve(N, M, A)}')


if __name__ == '__main__':
    main()

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

a.sort(reverse=True)
if len(list(filter(lambda v: v * 4 * m >= sum(a), a[:m]))) == m:
    print("Yes")
else:
    print("No")

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

a.sort(reverse=True)
sm = sum(a)
if len(list(filter(lambda v: v * 4 * m >= sm, a[:m]))) == m:
    print("Yes")
else:
    print("No")

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

A = sorted(A,reverse=True)

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

Solution (Python):
n,m=map(int,input().split())
A=list(map(int,input().split()))
print("NYoe s"[m<=len([i for i in A if i>=sum(A)/(4*m)])::2])

Solution (Python):
inputValues = [int(i) for i in input().split()]
n = inputValues[0]
m = inputValues[1]
votes = [int(i) for i in input().split()]
total = sum(votes)
cnt = 0
for i in votes:
    if i >= total*(1/(4*m)):
        cnt += 1
        
if cnt >= m:
    print("Yes")
else:
    print("No")

Solution (Python):
import sys
N,M = map(int,input().split())
array = list(map(int,input().split()))

if not ( 1 <= M <= 100 and M <= N <= 100 ): sys.exit()
if not (len(array) == len(set(array))): sys.exit()

count = 0
standard = sum(array) * (1/(4*M))
for I in array:
    if I >= standard:
        count += 1
print('Yes') if count >= M else print('No')

Solution (Python):
N,M = map(int,input().split())
A = list(map(int,input().split()))
A = sorted(A, 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()))
 
cnt=0
 
for i in a:
	if (sum(a)/(4*m))<=i:
		cnt+=1
		if cnt==m:
			print("Yes")
            
if cnt<m:
	print("No")

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

cnt=0

for i in a:
	if (sum(a))*(Fraction(1,4*m))<=i:
		cnt+=1
		if cnt==m:
			print("Yes")
            
if cnt<m:
	print("No")