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())
list_a = list(map(int, input().split()))
cnt = 0
sum_a = sum(list_a)
bdr = sum_a / (4 * m)
for a in list_a:
    if a >= bdr:
        cnt += 1
print('Yes' if cnt >= m else 'No')

Solution (Python):
n, m = 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
if count >= m:
	print('Yes')
else:
	print('No')

Solution (Python):
import sys
 
N,M = list(map(int,input().split()))	
A= list(map(int,input().split()))	
A.sort(reverse=True)
all_A=sum(A)

for i in range(M):
  
  if not(A[i]/all_A >= 1/(4*M)):
    print("No")
    sys.exit( )
print("Yes")

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

Solution (Python):
def resolve():
    import sys
    input = sys.stdin.readline
    nm = [int(x) for x in input().rstrip().split()]
    a = [int(x) for x in input().rstrip().split()]


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

resolve()

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

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

val = sum(A) / (4 * M)
A.sort(reverse=True)
flag = True
for i in range(0,M):
    if A[i] < val:
        flag = False
        break
    
if flag:
    print("Yes")
else:
    print("No")

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

s = sum(lis)
line = s / (4 * m)

count = 0
for i in lis:
    if i >= line:
        count += 1

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

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

sumA = sum(A)
min_vote = sumA/(4*M)
exceed = 0
fl = False

for a in A:
    if a >= min_vote:
	    exceed += 1
    if exceed >= M:
	    fl = True
	    break

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

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

rets = []
flg = False
for i in range(m):
  if a[i] < sum_a / (4 * m):
    pass
  else:
    rets.append(a[i])
    if len(rets) == m:
      flg = True
      break
  
if flg:
  print('Yes')
else:
  print('No')

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

print(["Yes","No"][len(a)<m])

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

min_ = sum(a)/(4*m)
ans = 0
for i in a:
    if i >= min_:
        ans += 1

if ans >= 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)
r = 0
for x in A:
    if x >= mm:
        r += 1
        if r >= M:
            print("Yes")
            exit()
print("No")

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

A.sort()
total = sum(A)

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

Solution (Python):
def count_section_by_zero(data):
  count = 0
  flg = False
  start = 0
  for i, d in enumerate(data):
    if flg is False and d != 0:
      count += 1
      flg = True
      
    if d == 0:
      flg = False
  return count

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

def input_list_str():
  return list(map(str, input().split()))

def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

def gcd(*numbers):
    return reduce(fractions.gcd, numbers)

def gcd_list(numbers):
    return reduce(fractions.gcd, numbers)

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


def divide_two(arg):
  c = 0
  while True:
    if c >= 2:
      break
    if arg % 2 != 0:
      break
    arg //= 2
    c += 1
  return c


def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

def main():
  n,m = input_list()
  a = input_list()
  div = 1/(4*m)
  sum_a = sum(a)
  border = math.ceil(sum_a * div)
  popular = []
  for v in a:
    if v < border:
      continue
    popular.append(v)
    
  if len(popular) >= m:
    print('Yes')
  else:
    print('No')
    
  
import math
import fractions
import collections
import itertools
from functools import reduce
main()

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

s = sum(A)
A.sort(reverse=True)

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

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

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

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

    t = sum(A) * (1 / (4 * m))

    if all(item >= t for item in sorted(A, reverse=True)[:m]):
        print('Yes')
    else:
        print('No')
    

if __name__ == "__main__":
    main()

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()))
b = []
for i in range(N):
  if A[i] >= sum(A)/(4*M):
    b.append(A[i])
print("Yes" if M <= len(b) else "No")

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

Solution (Python):



import sys
sys.setrecursionlimit(10000000)


dxdy=((1,0),(0,1))

def pin(type=int):
    return map(type,input().rstrip().split())

def resolve():
    N,M=pin()
    A=sorted(list(pin()))
    A.reverse()
    p=(sum(A))/(4*M)
    
    print(["No","Yes"][A[M-1]>=p])
"""         


"""
"""
お前カッコ閉じ,るの忘れてるだろ
"""
import sys
from io import StringIO
import unittest


class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)

    def test_入力例_1(self):
        input = """4 1
5 4 2 1"""
        output = """Yes"""
        self.assertIO(input, output)

    def test_入力例_2(self):
        input = """3 2
380 19 1"""
        output = """No"""
        self.assertIO(input, output)

    def test_入力例_3(self):
        input = """12 3
4 56 78 901 2 345 67 890 123 45 6 789"""
        output = """Yes"""
        self.assertIO(input, output)


if __name__ == "__main__":
    resolve()

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

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

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

Solution (Python):
import numpy as np

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

sum = A.sum()

if len(A[4*M*A >= sum]) >= M:
    print('Yes')
else:
    print('No')

Solution (Python):
n,m= map(int,input().split())
l = list(map(int,input().split()))
s = sum(l)
r=s/(4*m)
cnt=0
for i in l:
    
    if i>=r:
        cnt=cnt+1

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

Solution (Python):
import bisect

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

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

total = sum(A_list)

if bisect.bisect_left(A_list, total/(4*M)) <= N-M:
  print("Yes")
else:
  print("No")

Solution (Python):



input_line = input()
Line = input_line.split()
Line = [int(s) for s in Line]

input_line = input()
Line2 = input_line.split()
Line2 = [int(s) for s in Line2]

tokuhyou = sum(Line2) / 4 / Line[1]

Line2.sort(reverse=True)




if Line2[Line[1]-1] >= tokuhyou:
    print("Yes")
else:
    print("No")

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

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

if s/(4*m) <= ls[m-1]:
  print('Yes')
else:
  print('No')

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

Solution (Python):
n,m = map(int, input().split())
a = list(map(int, input().split()))
v = 0
for i in range(0,len(a)):
    v += a[i]
k = v / (4*m)
u = 0
for i in range(0,len(a)):
    if a[i] >= k:
        u += 1

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

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

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

Solution (Python):

x=list(map(int, input().split()))
y=list(map(int, input().split()))

y.sort(reverse=True)

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

Solution (Python):
n,m=map(int,input().split())
ans=0
lis=list(map(int,input().split()))
for num in lis:
  if num*4*m>=sum(lis):
    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)

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=list(map(int,input().split()))
A=list(map(int,input().split()))
A_ans=[a for a in A if a>=sum(A)/(4*m)]
if len(A_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)
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 = [int(x) for x in input().split()]

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

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

k = sum(aList) / (4 * m)
count = 0
flag = False
for i in aList:
    if i >= k:
        count += 1
        if count == m:
            flag = True
            break
if flag:
    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 sys
input = sys.stdin.readline


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

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

    ans = [_a for _a in A if _a >= goukei]

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


if __name__ == "__main__":
    main()

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

filtera = [i for i in a if i >= suma*1/(4*m)]

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

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

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

Solution (Python):
import sys
from collections import Counter

if __name__ == "__main__":
	N, M = map(int,input().split())
	A = [int(i) for i in input().split()]

	s = sum(A)

	A_sort = sorted(A, reverse=True)
	A_select = A_sort[:M]

	if len(A_select) != M:
		print("No")
		sys.exit()

	for a in A_select:
		if a < (s*(1 / (4*M))):
			print("No")
			sys.exit()

	print("Yes")

Solution (Python):












mod = int(1e9+7)
INF = 1<<29
lINF = 1<<35

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

if __name__=='__main__':
    main()

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

cnt = 0
total = 0
for elm in elms:
  total += elm
  
for elm in elms:
  if( elm*4*m >= total  ):
    cnt+= 1
    
if( cnt >= m ):
  print( "Yes" )
else:
  print( "No" )

Solution (Python):
n,m = map(int, input().split())
a = list(map(int, input().split()))
summ = 0
ans = 0
for i in range(n):
    summ += a[i]
summ = summ / (4*m)

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

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

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


a = input().split()
for i in range(n):
	a[i] = int(a[i])


sumvote = sum(a)

line = sumvote/(4*m)

c = 0

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



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

Solution (Python):
import math

def solve(n,m,lst):
  min_vote = math.ceil(sum(lst)/4/m) - 1
  return lst[m-1] > min_vote

if __name__ == "__main__":
  _n, _m = map(int, input().split())
  a_list = [int(i) for i in input().split()]
  a_list = sorted(a_list,reverse=True)
  if solve(_n,_m,a_list):
    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()))
c = 0
k = (1/(4*m))*(sum(a))
for i in a:
    if i>=k:
        c+=1
if c>=m:
    print("Yes")
else:
    print("No")

Solution (Python):
import bisect,collections,copy,itertools,math,numpy,string
def I(): return int(input())
def S(): return input()
def LI(): return list(map(int,input().split()))
def LS(): return list(input().split())

N,M = LI()
A = LI()
kijun = sum(A)/(4*M)
count = 0
for x in A:
    if x>=kijun:
        count += 1
print('Yes' if M<=count else 'No')

Solution (Python):
ans = 'No'
N, M = map(int, input().split())
Alist = list(map(int, input().split()))
s = sum(Alist)
selectnumber = s / (4*M)
count = 0
for i in Alist:
  if i >= selectnumber:
    count += 1
    if count >= M:
      ans = 'Yes'
      break

print(ans)

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

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

Solution (Python):
n, m = [int(i) for i in input().split(' ')]
a = [int(i) for i in input().split(' ')]
a.sort()
a = a[::-1]

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

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

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

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

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

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


for i in range(M):
    if mylist[i]>=total/(4*M):
        answer+=1
    else:
        pass
    
if answer==M:
    print("Yes")
else:
    print("No")

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

total = np.sum(a)
thresh = total / (4 * m)

a = np.sort(np.array(a))[::-1]

mask = a >= thresh
if np.sum(mask) >= m:
  print('Yes')
else:
  print('No')

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

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

a = [int(x) for x in input().split()]
cnt = 0
th = sum(a) / (4 * m)
for aa in a:
    if aa >= th:
        cnt += 1
if cnt >= m:
    print("Yes")
else:
    print("No")

Solution (Python):
x = list(map(int,input().split(" ")))
n = x[0]
m = x[1]
a = list(map(int,input().split(" ")))
a.sort(reverse=True)

all_a = sum(a)

l = 4 * m

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

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

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


if A[-M] < (sum/(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)

t=sum(a)*(1/(4*m))

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

print("Yes")

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

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

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

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

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

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

count = 0
allhyou = sum(a)



for i in range(len(a)):
    if a[i] >= (allhyou/(4*m)):
        count += 1

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

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

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

s = sum(a)
a = sorted(a, reverse = True)
k = a[m-1]

s = s/(4*m)

if k<s:
    print("No")
else:
    print("Yes")

Solution (Python):
if __name__ == '__main__':
    s = input().rstrip().split(' ')
    N,M = int(s[0]), int(s[1])
    s = input().rstrip().split(' ')
    A = [int(elem) for elem in s]
    A.sort(reverse=True)
    p = 'Yes'
    for elem in A[:M]:
        if(elem < sum(A)*(1.0/(4*M))):
            p = 'No'
            break

    print(p)

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


check = sum(a) / (4 * m)


cnt = 0
for i in a:
  if(i >= check):
    cnt+=1


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

Solution (Python):
N, M = map(int, input().split())
nums = list(map(int, input().split()))
total = sum(nums)
ans = 0
for num in nums:
    if num >= total * (1 / (4 * M)):
        ans += 1
print("Yes") if ans >= M else print("No")

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

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

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

ans = 0
a_all = sum(a)

for x in a:
    if x >= a_all / (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()))
c=sum(a)
count=0
for i in range(n):
  if a[i]*4*m>=c:
    count+=1
if count>=m:
  print('Yes')
else:
  print('No')

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

b = sum(a)
c = b / (4 * m)
d = list(i for i in a if i >= c)
if len(d) >= m:
  print("Yes")
else:
  print("No")

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

border = sum(A) / (4 * M)
bordered = [a for a in A if not (a < border)]
print("Yes" if len(bordered) >= M else "No")

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

ans = "Yes"
vote = sum(a)

a_sort = sorted(a, reverse=True)



if a_sort[m-1] < vote * 1/(4*m):
  ans = "No"

print(ans)

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

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

Solution (Python):

import sys
import itertools
import fractions
import copy
import bisect


from operator import itemgetter
from sys import stdin

from operator import mul
from functools import reduce
from collections import Counter


N=3
M=3
i=0
j=0
k=0
n=3
r=1
a=[0]*5
b=[]






"1行1つの整数を入力を取得し、整数と取得する"
N,M=map(int, input().split())
number_list=list(map(int, input().split(" ")))
toku_list=sorted(number_list, reverse=True)
if toku_list[M-1]/sum(number_list) < 1/(4*M):
    print("No")
    sys.exit()

print("Yes")



"12 21 332 とか入力する時に使う"
"1行に複数の整数の入力を取得し、整数として扱う"

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

for i in number_list:
    print(number_list[i-1])

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

'''
x=[]
y=[]
for i in range(N):
    x1, y1=[int(i) for i in input().split()]
    x.append(x1)
    y.append(y1)
print(x)
print(y)
"複数行に2数値を入力する形式 x座標とy座標を入力するイメージ"
'''

'''
mixlist=[]
for i in range(N):
    a,b=input().split()
    mixlist.append((int(a),b))
print(mixlist)
"複数行にintとstrを複合して入力するやつ，今回はリスト一つで処理している"
'''

'''



"正方行列にstr型の値を入力"
'''




'''
入力
1 2
4 5
7 8
出力結果
[[1, 2], [4, 5], [7, 8]]
'''
"列数に関して自由度の高いint型の値を入力するタイプの行列"


'''
table = [[int(i) for i in input().split()] for m in range(m)]

print(type(N))
print(N)
print(type(M))
print(M)

print(type(table))
print(table)
'''











'''
入力
1234
出力
1
[[1, 2, 3, 4]]
'''




'''
word_list= input().split(" ")
print(word_list[0])
"連続文字列の入力"
"qw er ty とかの入力に使う"
"入力すると空白で区切ったところでlistの番号が与えられる"
'''



'''
A, B, C=stdin.readline().rstrip().split()
print(A)
"リストではなく独立したstr型を入れるなら以下のやり方でOK"
'''




"aという変数に入っているものを大文字にして出力"

















'''
def cmb(n,r):
    
    r= min(n-r,r)
    
    if r == 0: return 1
    over = reduce(mul, range(n, n-r, -1))
    
    
    

    under = reduce(mul, range(1, r+1))
    
    
    
    

    return over // under
    
    
    
    
a = cmb(n, r)

'''

'''




for i in a.most_common(n):print(i)





 


'''









'''
bisect.bisect_left(a, x, lo=0, h=len(a))
引数
a: ソート済みリスト
x: 挿入したい値
lo: 探索範囲の下限
hi: 探索範囲の上限
(lo, hiはスライスと同様の指定方法)
bisect_leftはソートされたリストaに対して順序を保ったままxを挿入できる箇所を探索します。leftが示す通り、aにすでにxが存在している場合は、挿入箇所は既存のxよりも左側になります。また、lo, hiを指定することで探索範囲を絞り込むことも可能です。デフォルトはaの全体が探索対象です。
'''

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

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

vote_sum = sum(a)
threshold = vote_sum / (4*m)

pick = 0
for a_i in a:
    if(a_i >= threshold):
        pick += 1
if (pick >= m):
    print('Yes')
else:
    print('No')

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




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

cnt = 0
for i in a:
    if i >= x:
        cnt = cnt + 1

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

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

Solution (Python):
N, M = map(int, input().split())
li = list(map(int, input().split()))
ok = []
limit = sum(li) / (4*M)
for v in li:
    if v >= limit:
        ok.append(v)
print('Yes' if len(ok) >= M else 'No')

Solution (Python):
nm = input().split()
al = input().split()

n = int(nm[0])
m = int(nm[1])

ia = [int(i) for i in al]
sa = sorted(ia,reverse = True)
am = sum(sa)
flg = 'Yes'

for i in range(m):
	if sa[i] < am / (4 * m):
		flg = 'No'

print(flg)

Solution (Python):





def solv(N, M, A):
    count = 0
    total = sum(A)
    for a in A:
        if a * 4 * M >= total:
            count += 1
    if count >= M:
        return "Yes"
    else:
        return "No"


if __name__ == "__main__":

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

    ans = solv(N, M, A)

    print(ans)

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

bd = sum(a_lst) / (4 * m)
cnt = 0

for a in a_lst:
    if bd <= a:
        cnt += 1

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

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

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

total = sum(A)
border = total/(4*M)
X=[1 for i in range(N) if A[i]>=border]

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

print(ans)

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

a_list.sort(reverse=True)
if len(a_list) < m:
    print('No')
all_vote = sum(a_list)
a_list = a_list[:m]
if a_list[-1] < (all_vote / (4 * m)):
    print('No')
else:
    print('Yes')

Solution (Python):
import math

n, m = map(int, input().split())
a_i = list(map(int, input().split()))
min = math.ceil(sum(a_i) / (4 * m))
if len([i for i in a_i if i >= min]) >= m: print("Yes")
else: print("No")

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

A.sort()
total = sum(A)
A = A[::-1]

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

Solution (Python):
N,M = map(int,input().split())
As = sorted(map(int, input().split()),reverse=True)
V = sum(As)
print("No" if any(map(lambda x: x<V/(4*M), As[:M])) else "Yes")

Solution (Python):
from heapq import nlargest

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

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

Solution (Python):
from collections import defaultdict

import sys
sys.setrecursionlimit(10**6)
ii = lambda: int(input())
mis = lambda: map(int,input().split())
lmis = lambda: list(mis())
INF = float('inf')

def main():
    n,m=mis()
    a=lmis()
    at=float(sum(a))/float(4*m)
    cnt=0
    for i in range(n):
        if a[i]>=at: cnt+=1
    print('Yes' if cnt>=m else 'No')


if __name__ == "__main__":
    main()

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

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

s = sum(A)

k = [1 for a in A if 4 * M * a >= s]

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

Solution (Python):
ni = lambda: int(input())
nm = lambda: map(int, input().split())
nl = lambda: list(map(int, input().split()))

n, m = nm()

aa = nl()

mx = sum(aa)/(4*m)

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


for i in range(m):
  if a[i] < mx:
    print('No')
    exit()
print('Yes')

Solution (Python):

from decimal import *
from itertools import permutations, combinations,combinations_with_replacement,product
s = input().split()
t = [int(p) for p in s]

sA = input().split()
p = [int(w) for w in sA]



N = t[0]
M = t[1]
p.sort(reverse=True)


all_vote = sum(p)

boder = all_vote / ( 4.0 * M ) 


list_clear = []
for i in range(N):
    if(p[i] >= boder):
        list_clear.append(p[i])


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

Solution (Python):
n,m = list(map(int, input().split()))
a = list(map(int, input().split()))
b = 0
s = sum(a)
d = s*(1/(4*m))
for i in a:
    if i>=d:
        b += 1

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

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

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

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

for i in range(n):
    if A[i] >= sum(A)/(4*m):
        x += 1
        
print("YNeos"[m > x::2])

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

A.sort()
A.reverse()

all = sum(A)

k = 1 / (4 * M)


for c in range(M):
    if A[c] < k * all:
        print("No")
        break
else:
    print("Yes")

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