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):

from collections import defaultdict, deque
from heapq import heappush, heappop
from itertools import permutations, accumulate
import sys
import math
import bisect
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.buffer.readline())
def LS():return [list(x) for x in sys.stdin.readline().split()]
def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res
def IR(n):
    return [I() for i in range(n)]
def LIR(n):
    return [LI() for i in range(n)]
def SR(n):
    return [S() for i in range(n)]
def LSR(n):
    return [LS() for i in range(n)]
 
sys.setrecursionlimit(1000000)
mod = 1000000007
 
def solve():
  N,M = map(int,input().split())
  A = list(map(int,input().split()))
  count = 0
  
  for i in A:
    if i*4*M >= sum(A):
      count += 1
 
  if count >= M:
    print("Yes")
  else:
    print("No")
  return
 

if __name__ == "__main__":
    solve()

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

if all(a>=(sum(A)/(4*M)) for a in A[0:M]):
    print("Yes")
else:
    print("No")

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

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

print('Yes' if sum([x>=s/(4*m) for x in a])>=m else 'No')

Solution (Python):
N,M=map(int,input().split())
A=[int(x) for x in input().split()]
A=sorted(A)
add=0
for i in range(N):
    add+=A[i]
if 4*M*A[-M]<add:
    print("No")
else:
    print("Yes")

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

def solve():
	NM= LI()
	N = NM[0]
	M = NM[1]

	A = LI()

	_sum = 0
	for a in A:
		_sum += a

	x = _sum/(4* M)
	for a in A:
		if a >= x:
			M -= 1

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

if __name__ == '__main__':
	solve()

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

def solve():
	NM= LI()
	N = NM[0]
	M = NM[1]

	A = LI()

	_sum = 0
	for a in A:
		_sum += a

	x = _sum/(4* M)
	for a in A:
		if a >= x:
			M -= 1

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

if __name__ == '__main__':
	solve()

Solution (Python):
import sys
sys.setrecursionlimit(10**7)
input = lambda: sys.stdin.readline().strip()

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

main()

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

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

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

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

Solution (Python):
import functools
N, M = list(map(int,input().split()))
A = list(map(int,input().split()))
ASUM = functools.reduce(lambda x, y: x + y, A)
if len([1 for i in range(N) if A[i]/ASUM*4*M >= 1]) >= 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()]
s = sum(a)
a.sort(reverse=True)
ans = 'Yes'
for i in range(m):
  if a[i] < s/(4*m):
    ans = 'No'
print(ans)

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

a_list = list(map(int, input().split())) 
a_sum = sum(a_list)

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

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

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

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

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

Solution (Python):
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
   
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines


n,m,*A=map(int,read().split())

A=sorted(A,reverse=True)

sum=sum(A)

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

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

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

Solution (Python):
import sys


def main():
    n, m = map(int, input().split())
    As = sorted(list(map(int, input().split())))[::-1]

    all_vote = sum(As)
    for i in range(m):
        if all_vote/(4*m) > As[i]:
            print('No')
            sys.exit()

    print('Yes')


if __name__ == "__main__":
    main()

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


A.sort(reverse = True)

canSelect = True
for i in range(M):
    if A[i] < 1/(4*M)*sum(A):
        canSelect = False

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

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

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

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

s = 0
for a in A:
    if a >= t:
        s += 1

print('Yes') if s >= m else print('No')

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

tmp = sum(A)
tmp2 = 0
for i in range(n):
  if A[i] >= tmp / (4 * m):
    tmp2 += 1
    
if tmp2 >= m:
  print('Yes')
else:
  print('No')

Solution (Python):
tokuhyo = []

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

yuukou = sum(tokuhyo) / (M * 4)

ok = 0

for i in range(N):
    if tokuhyo[i] >= yuukou:
        ok += 1

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

Solution (Python):
N,M = map(int,input().split())
A = [int(i) for i in input().split()]
cnt = 0
for a in sorted(A,reverse=True):
    if (sum(A)/(4 * M)) <= a:
        cnt +=1 
    if cnt == M:
        print('Yes')
        break
    

if cnt < M:
    print('No')

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

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

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

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

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

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

count = 0
line = 4*M
line2 = vote/line

ans = "No"

for i in A:
    if (i >= line2):
        count += 1


if (count >= M):
    ans = "Yes"


print(ans)

Solution (Python):
line1 = input().split()
n = int(line1[0])
m = int(line1[1])
line2 = input().split()
line2 = [int(i) for i in line2]
total = sum(line2)
line2 = sorted(line2, reverse=True)
if line2[m-1] >= total / (4 * m):
  print("Yes")
else:
  print("No")

Solution (Python):
a = input().split()

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

b = input().split()

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

s = sum(x)
lim = s / (m*4)

c = 0

for i in range(0,n):
    if(x[i] >= lim):
      c = c + 1
    else:
      continue

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

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

a.sort(reverse=True)

for i in range(m):
    if a[i] < sum(a) / (4*m):
        print("No")
        exit(0)

print("Yes")

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

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

total = sum(a)
taken = 0
a.sort()

for i in a:
    if i * 4 * m >= total:
        taken += 1
    if taken == m:
        print("Yes")
        exit()

print("No")

Solution (Python):
N,M=map(int, input().split())
An=list(map(int,input().split()))
An.sort(reverse=True)
total = 0
for a in An:
  total += a
if An[M-1] >= total / (4 * M):
  print('Yes')
else:
  print('No')

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

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

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

Solution (Python):
n,m,*a=map(int,open(0).read().split())
s=sum(a)
print('No' if m>sum(s<=4*m*i for i in a) else 'Yes')

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

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

for i in A:
  if i >= minimum:
    M -= 1
    
if M > 0:
  print('No')
else:
  print('Yes')

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

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

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

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

t = sum(A)
c = 0

for a in A:
    if t * (1/(4*M)) <= a:
        c += 1
if M <= c: print('Yes')
else: print('No')

Solution (Python):


N, M = map(int, input().split())
A = [int(a) for a in input().split()]
P = [1 for a in A if a >= sum(A) * 1 / (4 * M)]

print('Yes' if len(P) >= M else '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()))
ninki = []
for i in range(n):
    if a[i] >= (sum(a) / (4 * m)):
        ninki.append(a[i])
if len(ninki) >= m:
    print("Yes")
else:
    print("No")

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

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('Yes')
else:
    print('No')

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

sum_post = sum(A) / (4 * M)
count = 0

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

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

Solution (Python):
array = []

for i in range(2):
    val = input()
    array.append(val.split())

kinds = int(array[0][0])
populars = int(array[0][1])
votes_sum = 0

for vote in array[1]:
    votes_sum = votes_sum + int(vote)

winning = votes_sum / (4 * populars)
numbers = 0

for vote in array[1]:
    if int(vote) >= winning:
        numbers = numbers + 1

if numbers >= populars:
    print("Yes")
else:
    print("No")

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

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

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

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

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

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

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

s = sum(A)
p = s/4/M
cnt = 0
for i in range(N):
  if A[i] >= p:
    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()))
cnt = 0

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

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

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

su = 0
mm = 0

for k in range(n):
    su += a_int[k]

bor = su*1/(4*m)

for j in range(n):
    if a_int[j] >= bor:
        mm += 1

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

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

total=sum(A)

pop_List=[]
for i in range(N):
    if A[i]<total/(4*M):
        pop_List.append(i)


count=0
for i in pop_List:
    i=i-count
    A.pop(i)
    count+=1

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

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

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

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

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

t = sum(a)/(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()))
s = sum(a)
counter = 0

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

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

Solution (Python):
n,m= map(int,input().split())
a = list(map(int,input().split()))
s=sum(a)
ans=[]
a=sorted(a,reverse=True)
for i in range(m):
  if a[i]*4*m >= s:
    ans.append(a[i])

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

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

B = sorted(A, reverse=True)
if len(B) < m:
    print('No')
elif B[m-1] < sum(B)*1/(4*m):
    print('No')
else:
    print('Yes')

Solution (Python):
import numpy as np
N, M = map(int, input().split())
A = np.array(input().split(), dtype=np.int16)
print(["Yes", "No"][(A >= A.sum() / (4 * M)).sum() < M])

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()))
s = sum(a)
counter = 0

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

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

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

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

if counter >= 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()]

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

if any(s < lower_lim for s in sorted(A, reverse=True)[:M]):
    print("No")
else:
    print("Yes")

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

all_vote = sum(a)

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

Solution (Python):
n,m = map(int, input().split())
ar = list(map(int,input().split()))
ans = 0
th = sum(ar)/4/m
for i in ar:
  if i < th:
    continue
  ans+=1

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

Solution (Python):
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,copy,functools
import time,random

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**10
mod = 10**9+7
mod2 = 998244353
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(): return [list(map(int, l.split())) for l in sys.stdin.readlines()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)
def pe(s): return print(str(s), file=sys.stderr)
def JA(a, sep): return sep.join(map(str, a))
def JAA(a, s, t): return s.join(t.join(map(str, b)) for b in a)


def main():
    n,m = LI()
    a = LI()
    s = sum(a)
    r = 0
    for c in a:
        if c / s >= 1 / 4 / m:
            r += 1

    if r >= m:
        return "Yes"

    return "No"


print(main())

Solution (Python):



is_first = True
while True:
    try:
        if is_first:
            n, m  = [int(i) for i in input().split()]
            is_first = False
        else:
            arr = [int(i) for i in input().split()]
    except EOFError:
        break

total_vote = sum(arr)
sorted_arr = sorted(arr, reverse=True)

list_up_arr = sorted_arr[: m]

flag = True
for l in list_up_arr:
    if l < 1 / (4 * m) * total_vote:
        flag = False

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

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

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

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

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

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

int1 = lambda x: int(x) - 1
def II(): return int(input())

def MI(): return map(int, input().split())
def MI1(): return map(int1, input().split())

def LI(): return list(map(int, input().split()))
def LI1(): return list(map(int1, input().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]

INF = float('inf')

def solve():
    n, m = MI()
    A = LI()

    s = sum(A)
    cnt = 0
    for a in A:
        if a * 4 * m >= s:
            cnt += 1
    print('Yes' if cnt >= m else 'No')


if __name__ == '__main__':
    solve()

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

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

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

s = sum(a)

b = [i for i in a if i >= s/(4*m)]


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

Solution (Python):
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop
from itertools import permutations, accumulate
from math import sqrt, ceil, floor
from bisect import bisect_left, bisect_right
from copy import deepcopy
from operator import itemgetter
from fractions import gcd
import sys
def I(): return int(input())  
def Is(): return map(int, input().split())  
def LI(): return list(map(int, input().split()))  
def TI(): return tuple(map(int, input().split()))  
def IR(n): return [I() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def TIR(n): return [TI() for _ in range(n)]
def S(): return input()
def Ss(): return input().split()  
def LS(): return list(input())  
def SR(n): return [S() for _ in range(n)]
def SsR(n): return [Ss() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
sys.setrecursionlimit(1000000)
MOD = 1000000007
INF = float('inf')

n, m = Is()
A = LI()
s = sum(A)
c = s/(4*m)

count = 0
for a in A:
    if a * m * 4 >= 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()))

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

border = sum / (4*m)

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

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

Solution (Python):
N,M=list(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):
import sys
sys.setrecursionlimit(10**6)
readline = sys.stdin.readline
n,m = [int(i) for i in readline().split()]
a = [int(i) for i in readline().split()]

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

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

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

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

for i in range(1, n+1):
    if A[i-1] >= sum(A)/(4*m):
        vote += 1
if vote >= m:
    print("Yes")
else:
    print("No")

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

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

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

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

Solution (Python):
import math
n,m=map(int,input().split())
a=list(map(int,input().split()))
wa=sum(a)
l=math.ceil(wa/(4*m))
count=0
for i in range(n):
  if a[i]>=l:
    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)
B=A[0:M]
SUM=sum(A)

if any([ b<SUM/(4*M)  for b in B]):
  print("No")
else:
  print("Yes")

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

Solution (Python):
n,m=(int(x) for x in input().split())
a=[int(y) for y in input().split()]
z=0
for i in range(0,len(a)):
  if a[i]>=sum(a)/(4*m):
    z=z+1
  else:
    z=z
if m<=z<=n:
  print('Yes')
else:
  print('No')

Solution (Python):

import copy
import random
import bisect 
import fractions 
import math
import sys
import collections

mod = 10**9+7
sys.setrecursionlimit(mod) 

d = collections.deque()
def LI(): return list(map(int, sys.stdin.readline().split()))

N, M = LI()
A = LI()

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 = sorted(list (map(int, input() .split() ) ) )

if A[N-M] >= sum(A)/M/4 :
	print( 'Yes' )

else :
	print( 'No' )

Solution (Python):
N,M = map(int,input().split())
A = list(map(int,input().split()))
s = sum(A)
A = sorted(A, reverse = True)
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()))
l = []

for i in range(N):
    if A[i] >= sum(A)/(4*M):
        l.append(i)

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

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

asum = 0
for ai in a:
    asum += ai
msum = 0
for ai in a:
    if ai>=(asum/(4*m)):
        msum += 1
if msum>=m:
    print("Yes")
else:
    print("No")

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

total = 0
for i in range(n):
    total += a[i]
    
num = 0
for i in range(n):
    if a[i] >= total/(4*m):
        num += 1
        
if num >= m:
    print("Yes")
else:
    print("No")

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

for i in a:
    if i>=sum/(4*m):
        l.append(i)

x=len(l)

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

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


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

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

Solution (Python):
import math
N, M = map(int, input().split())
A = list(map(int, input().split()))
sumA = sum(A)
border = sumA // (4*M) + (sumA % (4*M) > 0)
print(["No", "Yes"][len(list(filter(lambda x: x >= border, A))) >= M])

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')

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

for num in A:
    if num < check:
        N -= 1

if N >= 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)
if sum(a)/(4*M)<=a[M-1]:
  print("Yes")
else:
  print("No")

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

s = sum(a)
a.sort()
a.reverse()
d = s / 4.0 / m

c = 0
for i in range(n):
    if(a[i] >= d):c+=1
    if(c == m):
        print('Yes')
        exit()

print('No')

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

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

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

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

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

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

Solution (Python):
import math

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

l = math.ceil(sum(A)/(4*m))

cnt = 0
for a in A:
    if a >= l:
        cnt += 1

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

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

l = sum(A)/(4*m)

cnt = 0
for a in A:
    if a >= l:
        cnt += 1

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

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

if __name__ == '__main__':
	main()

Solution (Python):
def I(): return int(input())
def LI(): return list(map(int,input().split()))
def MI(): return map(int,input().split())

n,m = MI()
a = LI()
a.sort()
a.reverse()
ki = sum(a)/(4*m)
if a[m-1] < ki:
    print("No")
else:
    print("Yes")

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

for i in range(n):
    if i >= m:
        print('Yes')
        exit()
    if a[i]*4*m < s:
        print('No')
        exit()
print('Yes')

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

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

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

total = sum(A)

selcnt = 0
for a_i in reversed(sorted(A)):
    if a_i < total * (1/(4*M)):
        break
    selcnt += 1

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

Solution (Python):






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


total_vote = 0


for vote in votes:
    total_vote += vote


i = 0

for vote in votes:
    
    if vote >= total_vote*(1/(4*M)):
        i += 1


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

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

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

Solution (Python):
n, m = map(int, input().split())
A = list(map(int, input().split()))
A.sort(reverse=True)
chk = True
s = sum(A)
for i in range(m):
    if A[i] >= s/(4*m):
        pass
    else:
        chk = False
if chk == True:
    print('Yes')
else:
    print('No')

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

print('Yes' if len(list(filter(lambda x: x>=sum(a)*(1/(m*4)), a)))>=m else 'No')

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