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=input().split()
A=[]
for _ in a:
    A.append(int(_))






items=0
votes=sum(A)

for i in range(len(A)):
    if 4*M*A[i]>=votes:
        items+=1
    else:
        pass
if items>=M:
    print('Yes')
else:
    print('No')

Solution (Python):
n,m=map(int,input().split())
a=list(map(int,input().split()))
c=0
sm=sum(a)
for l in a:
  if l >= sm/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()))
total = sum(A)
A.sort(reverse=True)

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

Solution (Python):
import sys

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

p = sum(A) / ( 4 * M )
A = sorted(A, reverse=True)

for i in range(M):
    if p > A[i]:
        print("No")
        sys.exit()
    
print("Yes")

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

A.sort()

boundary=sum(A)/(4*M)

ans='Yes'

for i in range(M):
  if A[N-i-1]<boundary:
    ans='No'
    break
print(ans)

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

p = 0

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

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

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

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

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

Solution (Python):
N,M = list(map(int,input().split(" ")))
A = list(map(int,input().split(" ")))
total = 0
Triger = 0
A.sort(reverse=True)
for i in A:
  total += i
Triger = total / 4 / M
a = 0
for j in range(M):
  if Triger > A[j]:
    a += 1
    break
if a == 0:
  print("Yes")
else:
  print("No")

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

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


if len(list(filter(lambda x: x >=eligible, A)))>=M :
    print("Yes")
else:
    print("No")

Solution (Python):
import sys
N, M = [int(x) for x in input().split()]
a = [float(x) for x in input().split()]
total = sum(a)
OK, NG = 0, 0
for j, i in enumerate(a):
    if i >= 1.0*total/(4*M):
        OK += 1
        if OK >= M:
            print('Yes')
            sys.exit()
    else:
        NG += 1
        if OK + (len(a) - j - 1) < M:
            print('No')
            sys.exit()

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

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


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

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

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

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

total = sum(A)
A = sorted(A, reverse=True)[:M]

answer = "Yes"

for i in range(M):
    if A[i] < total / (4 * M):
        answer = "No"

print(answer)

Solution (Python):
m,n=map(int,input().split())
products=list(map(int,input().split()))
products.sort()
products.reverse()
s=0
y=0
maru=0
batu=0
for x in products:
    y=y+x
for i in range(n):
    if y<=products[i]*4*n:
        maru=maru+1
    else:
        batu=batu+1
if batu==0:
    print('Yes')
else:
    print('No')

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

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

ans = "Yes"
if a[m - 1] * 1.0 < sum(a) / (4 * m):
    ans = "No"

print(ans)

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 = [int(x) for x in input().split()]

total = sum(a)
a.sort()
a = a[::-1]
count=0
for i in range(m):
    if a[i] < total * 1/(4*m):
        break
    count+=1

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

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


def main():
    n, m = map(int, readline().rstrip().split())
    aList = sorted(list(map(int, readline().rstrip().split())), reverse=True)
    aSum = sum(aList)
    mLine = aSum / (4 * m)
    print("Yes" if aList[m - 1] >= mLine else "No")


if __name__ == '__main__':
    main()

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

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

Solution (Python):
n, m = map(int,input().split())
a = list(map(int,input().split()))
c = 0
a.sort(reverse=True)
for i in range(m):
    if a[i] < ((1/(4*m))*sum(a)):
        c += 1

if c == 0:
    print('Yes')
else:
    print('No')

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

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

Solution (Python):
def actual(n, m, a_list):
    popular_threshold = sum(a_list) / (4 * m)

    count_can_be_popular = 0

    for vote in a_list:
        if vote >= popular_threshold:
            count_can_be_popular += 1

    if count_can_be_popular >= m:
        return 'Yes'

    return 'No'

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

print(actual(n, m, a_list))

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

Solution (Python):
N, M = map(int, input().split(' '))
A_n = list(map(int, input().split(' ')))
count = 0
total = sum(A_n)
A_sort = sorted(A_n, reverse=True)
for a in A_sort:
    
    if a/total >= 1/4/M:
        count += 1
    else:
        break
if count >= M:
    print('Yes')
else:
    print('No')

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

tokuhyo=0
for i in range(N):
    tokuhyo+=S[i]

S.sort()
S.reverse()
for i in range(M):
    if S[i]<tokuhyo/(4*M):
        print("No")
        exit()

print("Yes")

Solution (Python):
N,M = map(int,input().split())
A = list(map(int,input().split()))
total = sum(A)
A.sort(reverse = True)
counter_0 = 0

for i in range(M):
  if A[i] < total/(4*M):
    counter_0 += 1
    
if counter_0 == 0:
  print('Yes')
else:
  print('No')

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

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

Solution (Python):

import sys, re
from collections import deque, defaultdict, Counter, OrderedDict
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, log
from heapq import heappush, heappop, heapify, nlargest, nsmallest
def STR(): return list(input())
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def list2d(a, b, c): return [[c] * b for i in range(a)]
def sortListWithIndex(listOfTuples, idx):   return (sorted(listOfTuples, key=lambda x: x[idx]))
def sortDictWithVal(passedDic):
    temp = sorted(passedDic.items(), key=lambda kv: (kv[1], kv[0]))
    toret = {}
    for tup in temp:
        toret[tup[0]] = tup[1]
    return toret
def sortDictWithKey(passedDic):
    return dict(OrderedDict(sorted(passedDic.items())))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

n,m =MAP()

a = LIST()

tot = sum(a)

temp = (0.25/m)*tot

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

abc = a[m-1]

if(abc>=temp):
    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) / M / 4:
    print("Yes")
else:
    print("No")

Solution (Python):
import itertools
from collections import deque,defaultdict,Counter
from itertools import accumulate
import bisect
from heapq import heappop,heappush,heapify
import math
from copy import deepcopy
import queue
import numpy as np

Mod = 1000000007
def sieve_of_eratosthenes(n):
    if not isinstance(n,int):
        raise TypeError("n is not int")
    if n<2:
        raise ValueError("n is not effective")
    prime = [1]*(n+1)
    for i in range(2,int(math.sqrt(n))+1):
        if prime[i] == 1:
            for j in range(2*i,n+1):
                if j%i == 0:
                    prime[j] = 0
    res = []
    for i in range(2,n+1):
        if prime[i] == 1:
            res.append(i)
    return res

 
class UnionFind:
    def __init__(self,n):
        self.parent = [i for i in range(n+1)]
        self.rank = [0 for i in range(n+1)]
    
    def findroot(self,x):
        if x == self.parent[x]:
            return x
        else:
            y = self.parent[x]
            y = self.findroot(self.parent[x])
            return y
    
    def union(self,x,y):
        px = self.findroot(x)
        py = self.findroot(y)
        if px < py:
            self.parent[y] = px
        else:
            self.parent[px] = py
 
    def same_group_or_no(self,x,y):
        return self.findroot(x) == self.findroot(y)

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

Solution (Python):
n, m = map(int, input().split())
a = input().split()
a_int = list(map((lambda x: int(x)), a))
num = 0

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

for i in range(n):
  if a_int[i] >= con:
    num += 1

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

Solution (Python):

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

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)


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

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)

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

Solution (Python):
item_count, select_count = map(int, input().split())

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

for score in votes:
    total += score

selected = 0
div = total / (4 * select_count)
for score in votes:
    if div <= score:
        selected += 1

if select_count <= selected:
    print('Yes')
else:
    print('No')

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

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

Solution (Python):
import sys

input = lambda: sys.stdin.readline().rstrip()


def solve():
    N, M = map(int, input().split())
    A = list(map(int, input().split()))
    asum = sum(A)

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

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


if __name__ == '__main__':
    solve()

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





def RD(): return sys.stdin.read()
def II(): return int(input())
def MI(): return map(int,input().split())
def MF(): return map(float,input().split())
def LI(): return list(map(int,input().split()))
def LF(): return list(map(float,input().split()))
def TI(): return tuple(map(int,input().split()))





def main():
	n,m=MI()
	A=LI()
	A.sort(reverse=True)

	ans="Yes"

	if A[m-1]*4*m<sum(A):
		ans="No"

	print(ans)














if __name__ == "__main__":
	main()

Solution (Python):
n, m = map(int, input().split())
a = list(map(int, input().split()))
t = 0
for i in a:
    t += i
t_avg = t * (1 / (4 * m))

count = 0
for j in a:
    if j >= t_avg:
        count += 1
if count >= 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)
if b[m-1]*4*m >= sum(b):
    print("Yes")
else:
    print("No")

Solution (Python):
n,m=map(int,input().split())
lst = [int(i) for i in input().split()]
count = 0
for i in range(n):
  if lst[i] >= (1/(4*m))*sum(lst):
    count += 1

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

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

for i in sort:
  if i<b/(4*m):
    break
  else:
    count+=1

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

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

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

for i in sort:
  if i>=b/(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
vote = sum(a)
for i in a:
    if i >= vote/4/m:
        ans +=1
if ans >=m:
    print("Yes")
else:
    print("No")

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

Solution (Python):
import math
N, M = map(int, input().split())
A = list(map(int, input().split()))
c = 0
t = math.ceil(sum(A)/(4*M))

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

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

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

limit=(1/(4*M))*sum(A)
count=0

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

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

Solution (Python):
import math

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

th = math.ceil(sum(A)/(4*M))
count = 0
for a in A:
    if a >= th:
        count+=1
if count >= M:
    print('Yes')
else:
    print('No')

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

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

t = sum(a) / (4*m)
cnt = 0

for i in a:
    if i >= t:
        cnt += 1

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

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

A.sort(reverse=True)
lim = sum(A) / 4 / M
for i in range(M):
  if A[i] < lim:
    print('No')
    exit(0)
    
print('Yes')

Solution (Python):
import numpy as np
import math
import collections
import fractions
import itertools

def mput(): return map(int, input().split())
def lput(): return list(map(int, input().split()))
def iput(): return int(input())

def solve():
    n, m = mput()
    a = lput()
    line = sum(a) / (4 * m)
    bit = 0
    for i in a:
        if i >= line:
            bit += 1
    if bit >= m:
        print("Yes")
    else:
        print("No")
    return 0

if __name__ == "__main__":
    solve()

Solution (Python):

try:
    N_s,M_s=input().split(' ')
    N=int(N_s)
    M=int(M_s)
    
    if N>=1 and N<=100 and M>=1 and M<=100:
        votes=input().split(' ')
        counter=0
        vote = [int(i) for i in votes]
        summer=sum(vote)
        percent=summer/(4*M)
        for i in votes:
            if int(i)>=percent:
                counter+=1
        if counter>=M:
            print('Yes')
        else :
            print('No')
        
except Exception as e:
    print(e)

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

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

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

all_sum = sum(a)
standard = all_sum/(4*m)
ans = 0

for i in a:
  if i >= standard:
    ans += 1

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

Solution (Python):
N, M = map(int, input().split( ))
A = set(map(int, input().split( )))
SUM = sum(A)
cnt = 0
for num in A:
    if 4 * num * M >= SUM:
        cnt = cnt + 1

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

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

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

t = sum(a) / (4*m)
select = 0


for i in range(n):
    if a[i] >= t:
        select += 1

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

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

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

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

s = sum(A)

selected = []
for a in A:
    if a >= s/(4*m):
        selected.append(a)

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

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

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

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

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

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



for i in a:
    if i>=sum(a)/(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()))
su=0
co=0
for x in a:
    su+=x
iki=su/int((4*m))
for x in a:
    if x>=iki:
        co+=1
if co>=m:
    out='Yes'
else:
    out='No'
print(out)

Solution (Python):
n, m = [int(i) for i in input().split()]
A = [int(i) for i in input().split()] 
S = sum(A)
threshold = S /(4 * m) 
ans = 0
no = 0
for i in range(n):
    if A[i] >= threshold:
        ans = ans +1
        if ans == m:
            print("Yes")
            break
        else:
            continue
    else:
        no = no +1
        if no == (n-m+1):
            print("No")
            break
        else:
            continue

Solution (Python):
N, M = map(int, input().split())
*A, = map(int, input().split())
s = sum(A)
A.sort(reverse=True)

for i in A[:M]:
  if 4*M*i<s:
    print("No")
    break
else:
  print("Yes")

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

second = input().split(" ")
items = []
total = 0
for i in range(n):
    items.append(int(second[i]))
    total += int(second[i])

popu = 0
for item in items:
    if item >= (1/(4*m))*total:
        popu += 1

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

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

t=sum(a)/(4*m)
c=0

for i in range(n):
  if a[i]<t:
    c+=1

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

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


main()

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

samu = 0

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

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

Solution (Python):
n, m = map(int, input().split())
ns = [int(i) for i in input().split()]
lmt = sum(ns)/(m*4)
nns = list(filter(lambda x: x >= lmt, ns))
print("Yes" if len(nns) >= m else "No")

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

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

    total = sum(a)
    count = 0

    for i in a:
        if i >= total / (4 * m):
            count += 1

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

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

Solution (Python):
num_of_product, num_of_popular = map(int, input().split())
votes = list(map(int, input().split()))

populars = [i for i in votes if i >= sum(votes) / (4 * num_of_popular)]
if len(populars) >= num_of_popular:
    print('Yes')
else:
    print('No')

Solution (Python):
import os
import heapq
import sys
import math
from collections import defaultdict
from io import BytesIO, IOBase
def check_kth_power(n, k):
        while n%k == 0:
            n = n/k

        if n != 1:
            return False
        return True
def main():
    
    n,m=map(int,input().split())
    arr=[int(k) for k in input().split()]
    
    total=0
    for i in range(n):
        total+=arr[i]
    val=(total/(4*m))
    counter=0
    
    ans="No"
    for i in range(n):
        if arr[i]>=val:
            counter+=1
        if counter==m:
            ans="Yes"
    print(ans)
        
BUFSIZE = 8192

class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)


class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")


sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")

if __name__ == "__main__":
    main()

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

if List[M-1]>=sum(List)/(4*M):
    print('Yes')
else:
    print('No')

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

b = sum(a)
c = b / (4*m)

res = 0
for i in a:
  if i >= c:
    res += 1

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

Solution (Python):
N,M = [int(v) for v in input().split(' ')]
A = [int(v) for v in input().split(' ')]
P = [(i >= sum(A)/4.0/M) for i in A]
print('Yes' if sum(P) >= M else 'No')

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

S = sum(A) / (4*M)

ans = [i for i in A if i >= S]

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

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

a = sorted(a)

min_vote = a[-m]
sum_vote = sum(a)

if min_vote < sum_vote * (1/(4*m)):
    print("No")
else:
    print("Yes")

Solution (Python):
import math

def dict_sort(ans):
    ans=sorted(ans.items(),reverse=True,key=lambda kv:(kv[1]))
def is_prime(n,k):
    if n==1:
        return 0
    for i in range(2,int(math.sqrt(n))+1):
        if n%i==0:
            res=i
            break
    return res
def inp():
    ls=list(map(int,input().split()))
    return ls
n,m=map(int,input().split())
ls=inp()
ans=0
for i in range(n):
    if ls[i] >= sum(ls)/(4*m):
        ans+=1
if ans>=m:
    print("Yes")
else:
    print("No")

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

count = 0
al = sum(s)

for i in range(N):
  if not(s[i] < al / (4 * M)):
    count += 1
    
if count >= M:
  print("Yes")
else:
  print("No")

Solution (Python):
from fractions import Fraction

N,M = map(int,input().split())
A = sorted(list(map(int,input().split())))
vote_num = sum(A)
ans = 0
x = Fraction(1, 4*M)

for i in A:
        if i >= vote_num*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()))
b = 0
for i in a:
  b += i
c = [c for c in a if c >= b/4/m]

if len(c) >= m:
  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())))
if np.count_nonzero(A >= np.sum(A)/(4*M)) >= M:
    print("Yes")
else:
    print("No")

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

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

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

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

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

count=sum(a)
a=sorted(a,reverse=True)
sum=0
for i in range(m):
	sum += a[i]

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

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

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

COUNT = 0
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=map(int,input().split())
a=list(map(int,input().split()))
count=0
for i in a:
  if i>=sum(a)/(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)
S = sum(A)

for i in range(M):
    if A[i] < S/(4*M):
        print('No')
        exit()

print('Yes')

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

t = sum(a)
a.sort(reverse=True)
for i in range(m):
    if a[i] < t * 1/(4*m):
        print("No")
        exit()

print("Yes")

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