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()))
t=sum(a)/(4*m)
count=0
for i in a:
    if(i>=t):
        count+=1
        if(count>=m):
            print('Yes')
            exit()
        else:
            continue
    else:
        continue
print('No')

Solution (Python):
N,M=map(int,input().split())
A=sorted(list(map(int,input().split())),reverse=True)
print('YNeos'[M!=sum(map(lambda x: 0 if x<sum(A)*(1/(4*M)) else 1,A[:M]))::2])

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

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

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

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

Solution (Python):
n, m = list(map(int, input().split()))
l = list(map(int, input().split()))
total = sum(l)
ctr=0
for x in l:
    if x>=total/(4*m):
        ctr+=1
if ctr>=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)
M=4*m
s=sum(a)
count=0

for i in range(n):
  if a[i]<s/M:
    a[i]=0

for i in range(m):
  if a[i]!=0:
    count+=1

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

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

s = sum(lst)
l = len([_ for _ in lst if _ >= s * (1/(4*m))])
if l >= m:
    print('Yes')
else:
    print('No')

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

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

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

for i in range(n):
    t+=A[i]
l=0

g=t*(1/(4*m))

c=0
for i in range(m):
    l=A.pop()
    
    if l<g:
        c+=1
    else:
        c+=0
    
if c==0:
    print('Yes')
else:
    print('No')

Solution (Python):
n,m = map(int,input().split())
a = list(map(int, input().split()))
popular = list(filter(lambda e: e>=(1/(4*m))*sum(a),a))
print("Yes" if len(popular) >= m else "No")

Solution (Python):
N,M = map(int,input().split())
A = list(map(int,input().split()))
S = sum(A)
b = 0
c = len(A)
for i in range(c):
    if A[i] >= S/(4*M):
        b += 1

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

Solution (Python):
a,b=map(int,input().split())
l1=list(map(int,input().split()))

l2=list(sorted(l1,reverse=True))
suml=sum(l2)


if suml<=4*b*l2[b-1]:
    
    

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

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

ans = []
for i in range(m) :
  if a[i] < sum(a) / (4 * m) :
    continue
  else :
    ans.append(a[-1])

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

Solution (Python):




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

    cnt = 0

    for a in A:
        if a < sum(A) / (4 * M):
            continue
        else:
            cnt += 1
    print("Yes"if cnt >= M else "No")


if __name__ == "__main__":
    main()

Solution (Python):
i = list(map(int, input().split()))
N = i[0]
M = i[1]
A = list(map(int, input().split()))
A_A = A.copy()
A_A.sort(reverse=True)
count = 0

total = sum(A)
touhyousuu = 1 / (4 * M)
wari = total * touhyousuu

for j in range(M):
    if A_A[j] < wari:
        count += 1


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

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

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

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

if j >= 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)
sumA = sum(A)
K = sumA / (4 * M)
if A[M-1] >= K:
  print('Yes')
else:
  print('No')

Solution (Python):
N, M = map(int, input().split())
votes = sorted(list(map(int,input().split())), reverse=True)

for i in range(M):
  if votes[i] < sum(votes) / (4 * M):
    print("No")
    exit()

print("Yes")

Solution (Python):
import heapq

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


a1 = list(map(lambda x: x*(-1), a))  
heapq.heapify(a1)

flg=0
for i in range(m):
    tmp = -1*(heapq.heappop(a1))
    if(tmp*m*4 >= all):
        continue
    else:
        flg=1
        break
if(flg==0):
    print("Yes")
else:
    print("No")

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

b = sorted(a, reverse=True)
y = m - 1
x = b[y]
z = 4 * m
z *= x
if z >= sum(b):
    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) < 1 / (4 * m):
  print('No')
else:
  print('Yes')

Solution (Python):
i = list(map(int, input().split()))
j = list(map(int, input().split()))
j.sort(reverse=True)
if sum(j)>j[i[1]-1]*4*i[1]:
    print('No')
else:
    print('Yes')

Solution (Python):
n,m=map(int,input().split())
a=[int(ss) for ss in input().split()]
a=sorted(a,reverse=True)
r="Yes"
for ii in range(m):
  if a[ii]<sum(a)/(4*m):
    r="No"
    break
print(r)

Solution (Python):

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



num_sum = sum(num)
thresh = num_sum / (4 * M)


i = 0 
for x in num:
  if float(x) >= thresh:
    
    i += 1

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

Solution (Python):
n,m=map(int,input().split())
l=list(map(int,input().split()))
s=sum(l)
a=[]
for i in l:
    if i>=(s/(4*m)):

        a.append(1)
print('Yes' if len(a) >=m else 'No')

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

e = sum(a)
f = e/4/m
c = 0
a.sort()

for i in range (n):
    if a[i] >= f:
        c = c + 1
    else:
        c = c

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

Solution (Python):
f=lambda:map(int,input().split())
_,m=f()
l=sorted(list(f()))
print(['No','Yes'][l[-m]*4*m>=sum(l)])

Solution (Python):
n, m = map(int, input().split())
x = [int(i) for i in input().split(maxsplit=(n-1))]

sum = 0
count = 0
for i in x:
    sum += i

con = (1/(4*m))*sum

for i in x:
    if i >= con:
        count += 1
    if count == m:
        print('Yes')
        exit()
print('No')

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

a_sum = sum(a)

thr = a_sum/(4*m)
cnt = 0
for i in a:
    if i >= thr:
        cnt += 1

if cnt >= 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)
sum_a = sum(a)

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

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

for i in range(m):
    if a[i]*(4*m) < t:
        print('No')
        exit(0)
print('Yes')

Solution (Python):
n, m = map(int, input(). split())
lstr_a = input().split(" ")
lint_a = [int(n) for n in lstr_a]
alist = sorted(lint_a, reverse = True)
s = sum(alist)
if alist[m-1]>=s/(4*m):
  print("Yes")
else:
  print("No")

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

Solution (Python):
n, m = map(int, input().split())
sum = 0
arr = list(map(int, input().split()))
for a in arr:
    sum += a
count = 0
for a in arr:
    if a >= (sum / (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)
a0 = sum(a)/(4*m)
m-=1
if a[m] >= a0:
  print("Yes")
else:
  print("No")

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

Solution (Python):
N,M=map(int,input().split())
A=list(map(int,input().split()))
AA=sum(A)
count=0
for i in range(len(A)):
    if A[i]>=AA*(1/(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()))
sa = sum(a)

b = [i for i in a if 4*i*m >= sa]

if m <= len(b):
  print('Yes')
else:
  print('No')

Solution (Python):
N,M = map(int,input().split(' '))
An = list(map(int,input().split(' ')))
An.sort(reverse=True)
sum_num = sum(An)
for i in range(M):
    if An[i] < sum_num/(4*M):
        print('No')
        exit(0)
print('Yes')

Solution (Python):
N,M = [int(e) for e in input().split(' ')]
As = [int(e) for e in input().split(' ')]

cnt=0 
epsilon=sum(As)/(4*M)

for Ai in As:
    if Ai >= epsilon:
        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()))
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())) 
 
all = sum(list(A))
p = 1/(4*M)*all
cnt = 0
 
for i in A:
  if i >= p:
    cnt += 1
 
if cnt >= M :
  print('Yes')
else:
  print('No')

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

Solution (Python):
N,M = map(int,input().split())
count= 0
a = [int(i) for i in input().split()]
a_new = sorted(a,reverse=True)
for i in range(M):
    if a_new[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()))
allA = sum(A)
A.sort(reverse=True)
ans = "Yes"
for i in range(m):
    a = A[i]
    div = allA/(4*m)
    if a < div:
        ans = "No"
        break
print(ans)

Solution (Python):
n,m=map(int,input().split())
A=input().split()
AA=[]
for i in range(len(A)):
    AA.append(int(A[i]))

s=sum(AA)

c=0
for i in range(len(AA)):
    if AA[i]>=s/(4*m):
        c+=1

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

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

Solution (Python):
N, M = map(int, input().split())
lis_A = list(map(int, input().split()))
bd = sum(lis_A)/(4*M)
n_above_bd = sum(map(lambda x: x >= bd, lis_A))
if n_above_bd >= M:
    print('Yes')
else :
    print('No')

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

ad=sum(a)

ad=ad/(4*m)


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

Solution (Python):
N, M = map(int, input().split())
a_list = list(map(int, input().split()))
sorted_a_list = sorted(a_list, reverse=True)
border_num = sorted_a_list[M-1]

if border_num >= sum(a_list) /(4*M):
    print('Yes')
else:
    print('No')

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

ok = False
cnt = m
t = sum(a)
for i in range(n):
	if a[i] * 4 * m >= t:
		cnt -= 1
	if cnt == 0:
		ok = True
		break
		
if ok:
	print("Yes")
else:
	print("No")

Solution (Python):


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

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

totalvote = sum(votes)
threshold = totalvote * (1 / (4*m))


votes.sort(reverse=True)


if votes[m-1] < threshold:
    print('No')
else:
    print('Yes')

Solution (Python):

data = input().split()

count = int(data[0])
popular = int(data[1])

datas = input().split()

vote_total = 0

for vote in datas:
    vote_total += int(vote)
    
popular_count = 0

for vote in datas:
    if int(vote) >= vote_total / (4 * popular):
        popular_count += 1

if popular_count >= popular:
    print("Yes")
else:
    print("No")

Solution (Python):
def main():
    from builtins import int, map, list, print
    import sys
    sys.setrecursionlimit(10 ** 6)

    input = sys.stdin.readline
    input_list = (lambda: input().rstrip().split())
    input_number = (lambda: int(input()))
    input_number_list = (lambda: list(map(int, input_list())))

    N, M = input_number_list()
    A = input_number_list()
    total = sum(A)
    cnt = 0
    for a in A:
        if a >= total / (4 * M):
            cnt += 1
    print('YNeos'[cnt < M::2])

if __name__ == '__main__':
    main()

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

th = sum(A)*0.25/M

A.sort(reverse=True)

if A[M-1] >= th:
    print('Yes')
else:
    print('No')

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

Solution (Python):
n,m = map(int,input().split())
a = list(map(int, input().split()))
popular = list(filter(lambda e: e>=(1/(4*m))*sum(a),a))
print("Yes" if len(popular) >= m else "No")

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

Solution (Python):
li = list(map(int, input().split()))
n = li[0]
m = li[1]
k = list(map(int, input().split()))

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

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

Solution (Python):
N,M =map(int,input().split())
vote_list = list(map(int,input().split()))
                 
total=sum(vote_list)
popular_list = list(filter(lambda x: x>=total/(4*M),vote_list ))

if(len(popular_list)<M):
    print("No")
else:
    print("Yes")

Solution (Python):
N, M = input().split()
N = int(N)
M = int(M)
numbers = input().split()
numbers = [int(n) for n in numbers]
thresh = sum(numbers)/(4*M)
selected = list(filter(lambda x: x >= thresh, numbers))
if len(selected) >= M:
    print('Yes')
else:
    print('No')

Solution (Python):
n,m = map(int, input().split())
a = list(map(int, input().split()))
s = sum(a)
b = []
for i in range(n):
    if a[i]*4*m >= s:
        b.append(a[i])
if len(b) < m:
    print("No")
else:
    print("Yes")

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


def main(n, m, a):
    
    x = [new_a for new_a in a if not new_a < sum(a) / (4 * m)]

    

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

    print(res)


main(N, M, A)

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

Solution (Python):
import sys
input = sys.stdin.readline
def main():
    N,M = map(int, input().split())
    A = list(map(int, input().split()))
    A.sort(reverse=True)
    th = (1 / (4*M)) * sum(A)
    ans = "Yes"
    for i in range(M):
        if A[i] < th:
            ans = "No"
            break
    print(ans)
if __name__ == "__main__":
    main()

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

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

a = sorted(a)
a = a[::-1]

p = 1/(4*m)
s=  sum(a)
p = p*s


if( a[m-1] >= p ):
    print("Yes")
else:
    print("No")

Solution (Python):
lismn=input().split()
n=int(lismn[0])
m=int(lismn[1])
lisa=[int(x) for x in input().split()]
count=0
for i in lisa:
  if sum(lisa)/4.0/m <= i:
    count+=1
if m<=count:
  print("Yes")
else:
  print("No")

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

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

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

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

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

ok = 0
for i in range(N):
    if A[i] >=  T / 4 / M:
        ok = ok + 1

if ok >= 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]*m*4>=s:
    print("Yes")
else:
    print("No")

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

Solution (Python):
N, M = map(int, input().split())
A = list(map(int, input().split()))
 
A.sort(reverse=True)
 
total = 0
for a in A:
    total += a

word = "Yes"
for m in range(M):
    if (A[m] * 4 * M < total):
        word = "No"
 
print(word)

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 = list(map(int,input().split()))
A = list(map(int,input().split()))
thresh = sum(A) / (4*M)
print("Yes" if M <= len([i for i in A if i >= thresh]) else "No")

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

c=0
s=sum(l)

for i in range (n):
  if l[i]>=s/(4*m):
    c+=1
    
if c>=m:
  print ('Yes')
else:
  print ('No')

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

if __name__ == "__main__":
    main()

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

box = []
_sum = sum(A)
for a in A:
    if a >= 1/(4*M) * _sum:
      box.append(a)

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

Solution (Python):



import sys


def input():
    return sys.stdin.readline()


def resolve():
    n, m = map(int, input().split())
    a_list = list(map(int, input().split()))

    sum_a = sum(a_list)

    limit = 1 / (4*m)

    sorted_a = sorted(a_list, reverse=True)
    count = 0
    for ai in sorted_a:
        ratio_ai = ai / sum_a

        if ratio_ai >= limit:
            count += 1
            if count >= m:
                print("Yes")
                exit()
            continue
        else:
            print("No")
            exit()



if __name__ == "__main__":
    resolve()

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

a = input().split()
a = [int(a) for a in a]

sum_a = sum(a)

a_can_choose = [True if a >= sum_a / (4 * m) else False for a in a]

print("Yes" if m <= sum(a_can_choose) else "No")

Solution (Python):



def main():
    n, m = map(int, input().split(" "))
    a = [int(s) for s in input().split(" ")]
    total = sum(a)
    lim = total / (4 * m)
    a = sorted(a, reverse=True)
    count = 0
    for i in a:
        if i >= lim:
            count += 1
        else:
            break
    if count >= m:
        print("Yes")
    else:
        print("No")


if __name__ == '__main__':
    main()

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

a.sort(reverse=True)
cnt =0
goukei = sum(a)
for i in range(m):
    if a[i] < (1/(4*m) * goukei):
        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()))
a.sort(reverse=True)
s = sum(a)

limit = s / (4*m)

for i in range(m):
    if a[i] < limit:
        print("No")
        exit()

print("Yes")

Solution (Python):
N,M=map(int,input().split())
list_a=list(map(int,input().split()))
l = sorted(list_a,reverse=True)
s = sum(l)
if l[M-1]<s/(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)
s = sum(a)
b = s / (4*M)

if a[M-1] >= b:
    print("Yes")
else:
    print("No")

Solution (Python):

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

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

cor = []
for a in A:
    if a > sre or a == sre:
        cor.append(a)


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

Solution (Python):

n,m = (int(x) for x in input().split())


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

a.sort(reverse=True)

sum = 0
for i in a:
    sum += i



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

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

line = input().rstrip().split(' ')
a = [0] * n
total = 0
for i in range(n):
    a[i] = int(line[i])
    total += a[i]

list.sort(a, reverse=True)
b = total / (4 * m)

ans = 'Yes'
for i in range(m):
    if a[i] < b:
        ans = 'No'

print(ans)

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

all_sum_a = np.sum(A)

if M<=np.sum(A>=all_sum_a/(4*M)):
    print('Yes')
else:
    print('No')

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

ns = lambda: stdin.readline().rstrip()
ni = lambda: int(stdin.readline().rstrip())
nm = lambda: map(int, stdin.readline().split())
nl = lambda: list(map(int, stdin.readline().split()))

n,m=nm()
a=nl()
j=0
count=sum(a)/(4*m)
for i in a:
    if i>=count:
        j+=1
if j<m:
    print("No")
else:
    print("Yes")

Solution (Python):
N, M = map(int, input().split())
A = sorted(map(int, input().split()))
sum_a = sum(A)
border = sum_a / (4*M)

if A[-M] >= border:
    print('Yes')
else:
    print('No')

Solution (Python):
n,m=map(int,input('').split(' '))
a=input('').split(' ')
s=0
for b in range(n):
    a[b]=int(a[b])
    s=s+a[b]

ko=0
if s%(4*m)==0:
    ok=int(s/(4*m))
else:
    ok=int((s/(4*m)))+1

for b in range(n):
    if a[b]>=ok:
        ko=ko+1

if ko>=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)

X = A[M-1]
Y = sum(A)
th = Y / (4*M)

if X >= th:
  print('Yes')
else:
  print('No')

Solution (Python):
N_all, M_part = map(int, input().split())
Hyou = list(map(int, input().split()))

Hyou.sort(reverse=True)
summ = sum(Hyou)

thres = summ / (4 * M_part)

if (Hyou[M_part - 1] >= thres):
    print('Yes')
else:
    print('No')

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

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

if len(data) < m:
  print('No')
  exit()

total = sum(data)

data.sort(reverse=True)

for d in data[:m]:
  if d < total / (4 * m):
    print('No')
    exit()
print('Yes')

Solution (Python):
"""
import random
import functools
import copy
import bisect
import array
import re
import collections
import heapq
import fractions
import itertools
import string
import math
from operator import itemgetter as ig
from bisect import bisect_left, bisect_right, insort_left, insort_right
from itertools import permutations, combinations, product, accumulate, groupby
from heapq import heappush, heappop
from collections import deque, defaultdict, Counter
import sys
sys.setrecursionlimit(10 ** 7)


inf = 10 ** 20
INF = float("INF")
mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = dd + [(-1, 1), (1, 1), (1, -1), (-1, -1)]
ddn9 = ddn + [(0, 0)]
'''for dx, dy in dd:
        nx = j + dx; ny = i + dy
            if 0 <= nx < w and 0 <= ny < h:'''
"""


def main():
    N, M = map(int, input().split())
    A = list(map(int, input().split()))
    A.sort()
    A.reverse()
    sum_A = sum(A)
    M_1 = 4*M
    b = sum_A / M_1
    
    flag = True
    for i in range(M):
        if A[i] < b:
            print('No')
            flag = False
            break
    if flag:
        print('Yes')


if __name__ == '__main__':
    main()

Solution (Python):

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

A_list = list(map(int, input().split()))
A_list.sort(reverse=True)

total = sum(A_list)

if total / (4 * M) > A_list[M - 1]:
    print('No')
else:
    print('Yes')

Solution (Python):
n, m = list(map(int, input().split()))
a = list(map(int, input().split()))
txt = 'No'
suma = sum(a)


def fil(n):
    if suma / (4 * m) <= n:
        return True
    else:
        return False


a = list(filter(fil, a))

if len(a) >= m:
    txt = 'Yes'

print(txt)

Solution (Python):
N, M = map(int, input().split())
l = list(map(int, input().split()))
total = sum(l)
limit = total * (1 / (4 * M))
n = sum(x >= limit for x in l)
ans = 'No'
if n >= M:
    ans = 'Yes'
print(ans)

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

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

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

Solution (Python):
n,m=map(int,input().split())
num=[int(i) for i in input().split()]
num=sorted(num,reverse=True)
sum_num=sum(num)
for i in range(m):
    if num[i]<sum_num/(4*m):
        print("No")
        break
else:
    print("Yes")

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

Solution (Python):
n, m = map(int, input().split())
lis = list(map(int, input().split()))
mot = sum(lis)
liss = sorted(lis, reverse=True)

flag = True
for a in range(m):
    if liss[a] * 4 * m < mot:
        flag = False

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

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

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

sa = sum(a)
count = 0
for i in a:
    if 4*m * i >= sa:
        count +=1

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

Solution (Python):
import math
import sys

stdin = sys.stdin

ns = lambda: stdin.readline().rstrip()
ni = lambda: int(stdin.readline().rstrip())
nm = lambda: map(int, stdin.readline().split())
nl = lambda: list(map(int, stdin.readline().split()))
mod = 10**9 + 7 
sys.setrecursionlimit(1000010)


M,M = nm()
A  = nl()
As = sorted(A,reverse=True)

s = sum(A)

limit=(s + 4*M -1) // (4 *M )
if As[M-1] >= limit:
    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):
import numpy as np
n,m,*a = map(int,open(0).read().split())
if np.count_nonzero(np.array(a)>=sum(a)/4/m)>=m:
    print("Yes")
else:
    print("No")

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

total = sum(boat_list)

threshold = total / (4 * M)

judge_list = []

for i in range(len(boat_list)):
    if boat_list[i] >= threshold:
        judge_list.append(1)
    else:
        pass

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

Solution (Python):


N, M = map(lambda x: int(x), input().split(" "))
A = list(map(lambda x: int(x), input().split(" ")))

total = 0

for a in A:
	total += a

m = 0

for a in A:
	if a * 4 * M >= total:
		m += 1

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

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

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

a.sort(reverse=True)
s = sum(a)
thresh = s/(4*m)
flag=True
for i in range(m):
    if a[i]< thresh:
        flag=False
        break

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

Solution (Python):
N, M = list(map(int, input().split()))
A = list(map(int, input().split()))
all_A = sum(A)
comp = (1/(4*M))*all_A
A.sort(reverse=True)
i = 0
ans = 0

while (i <= M-1):
    if A[i] >= comp:
        ans += 1
    i += 1


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

Solution (Python):
import numpy as np

def main():
    N,M = map(int,input().split())
    A = np.array(list(map(int,input().split())))
    ans = 'No'

    if sum( A >= sum(A)/4/M ) >= M: ans = 'Yes'
    
    print(ans)
    return

if __name__ == "__main__":
    main()

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

def main():
    n, m = map(int, input().split())
    li = list(map(int, input().split()))

    sorted_li = sorted(li, reverse=True)

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

if __name__ == '__main__':
    main()

Solution (Python):
str = input().split()
n = int(str[0])
m = int(str[1])
arr = input().split()
cnt = 0
sum = 0
for i in range(n):
    sum+=int(arr[i])

for i in range(n):
    if int(arr[i]) >= (sum)/(4*m):
        cnt+=1
if cnt >= m:
    print('Yes')
else:
    print('No')

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

An = sorted(An, reverse=True)

goukei = sum(An)
keisan = goukei * (1 / (4 * M))

flag = True

for i in range(M):
  if An[i] < keisan:
    flag = False
    print('No')
    break
  
if flag is True:
  print('Yes')

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

ng = sum(a) / (4 * m)
a.sort(reverse=True)
ans = 'Yes'
for i in a[:m]:
    if i < ng:
        ans = 'No'
print(ans)

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

Solution (Python):
import numpy as np

N, M = np.array(list(map(int, input().split())))
A = np.array(list(map(int, input().split())))
A_sum = A.sum()
if((A[A >= A_sum/(4*M)].size) >= M):
    print("Yes")
else:
    print("No")