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):
import sys
import math
import fractions
from collections import deque
from collections import defaultdict
sys.setrecursionlimit(10**7)

N, M = map(int, input().split())
A = list(map(int, input().split()))
border = sum(A) / (4 * M)
cnt = 0
for a in A:
    if a >= border:
        cnt += 1

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

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

cnt = 0
for item in lst:
  if item >= 1/(4*m) * sumn:
    cnt += 1

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

Solution (Python):

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

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

Solution (Python):
def main():
    N, M = map(int, input().split())
    A = list(map(int, input().split()))
    A.sort(reverse=True)
    sumA = sum(A)
    
    ans = True
    for i in range(M):
        if (A[i] < sumA /(4*M)):
            ans = False

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

if __name__ == '__main__':
    main()

Solution (Python):

import sys
import math
import string
import collections
import fractions
import random
from operator import itemgetter
import itertools
from collections import deque
import copy
import heapq
import bisect

MOD = 10 ** 9 + 7
INF = float('inf')
input = lambda: sys.stdin.readline().strip()

sys.setrecursionlimit(10 ** 8)

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

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

A.sort(reverse=True)
S = sum(A)
if S <= A[M - 1] * 4 * M:
    print("Yes")
else:
    print("No")

Solution (Python):
import sys
n, m = map(int, input().split())
a = list(map(int, input().split()))
a.sort(reverse=True)
for i in range(m):
    if a[i] < (sum(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()
total=0
ans=0
for i in range(n):
    total+=a[i]
a.reverse()
for i in range(m):
    if a[i]>=total/(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()))
total = sum(A)
if sorted(A, reverse=True)[M-1] >= total/(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)
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()))
S=sum(A)
c=0
for i in A:
    if S<=i*4*M:
        c+=1
print("Yes" if c>=M else "No")

Solution (Python):


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

    lim = sum(a) / (4 * m)
    count = 0

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

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

if __name__ == '__main__':
    main()

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

for a in A[:m]:
    if a < sumA / (4 * m):
        print('No')
        exit()
print('Yes')

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

if __name__ == '__main__':
    main()

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

judge = judge/(4*m)

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

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

Solution (Python):
import sys
stdin = sys.stdin
sys.setrecursionlimit(10 ** 7)

i_i = lambda: int(i_s())
i_l = lambda: list(map(int, stdin.readline().split()))
i_s = lambda: stdin.readline().rstrip()

N, M = i_l()
a = i_l()


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

Solution (Python):
N,M = map(int,input().split())
li = list(map(int,input().split()))
goukei=sum(li)
MM=goukei/(4*M)
count=0
for i in li:
  if i>=MM:
    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()))
a.sort(reverse=True)
suma=sum(a)
cnt=0
for i in a:
    
    if i*4*m>=suma:
        cnt+=1
if cnt>=m:print('Yes')
else:print('No')

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

ans = 'No'
c = 0
for i in a:
    if (1 / (4 * m)) <= i / sum(a):
        c += 1
if c >= m:
    ans = 'Yes'

print(ans)

Solution (Python):
import sys
N,M=map(int, sys.stdin.readline().split())
A=map(int, sys.stdin.readline().split())
b=float(sum(A))/M/4
cnt=0

for a in A:
    if b<=a:
        cnt+=1

if M<=cnt:
    print "Yes"
else:
    print "No"

Solution (Python):
import sys
from collections import defaultdict
n,m=map(int,sys.stdin.readline().split())
l=list(map(int,sys.stdin.readline().split()))
l.sort()
l.reverse()
limit=(sum(l)/(4*m))
i=0

while i<n and l[i]>=limit:
    i+=1
if i>=m:
    print('Yes')
else:
    print('No')

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


if __name__ == '__main__':
    main()

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 a[i] >= s/(4*m):
        cnt += 1
if cnt >= m:
  print("Yes")
else:
  print("No")

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

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

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

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

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

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

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

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

sum = 0
for i in A:
    sum += i
sum = sum/(4*M)

count = 0
for i in A:
    if i >= sum:
        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
count=0

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

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

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

Solution (Python):
n,m=map(int,input().split())
a = list(map(int, input().split()))
sa=sum(a)
a.sort(reverse=True)
flag="Yes"
for i in range(m):
    item = a[i]
    if sa/(4*m)>item:
        flag="No"
print(flag)

Solution (Python):


from queue import Queue
from queue import LifoQueue as Stack
from math import sqrt, floor, ceil, log2
from fractions import gcd
from itertools import permutations, combinations
from operator import itemgetter
from functools import cmp_to_key


INF=1001001001
__MOD__=(10**9)+7
yn = 'YNeos'
judge = False
cnt = 0
ans = None


def lcm(a, b):
    return (a*b) // gcd(a,b)

def intinput():
    return int(input())

def mulinputs():
    return map(int,input().split())

def lineinputs(func=intinput):
    datas = []
    while True:
        try:
            datas.append(func())
        except EOFError:
            break
    return datas

class ModInt():
    def __init__(self, x):
        self.__x = (x % __MOD__)
    def __add__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((self.__x + other.__x)%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((self.__x + other.__x)%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")
    def __sub__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((self.__x - other.__x)%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((self.__x - other.__x)%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")
    def __mul__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((self.__x * other.__x)%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((self.__x * other.__x)%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")
    def __truediv__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((self.__x * other.__modinv())%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((self.__x * other.__modinv())%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")
    def __pow__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__(pow(self.__x, other.__x, __MOD__)))
        elif type(other) == ModInt:
            return self.__class__(pow(self.__x, other.__x, __MOD__))
        else:
            raise Exception("Not Int or Not ModInt")
    def __modinv(self, m=__MOD__):
        a = self.__x
        if a == 0:
            raise ZeroDivisionError()
        if gcd(a, m) != 1:
            raise Exception("%sの逆数は求まりません。" % a)
        b, u, v = m, 1, 0
        while b != 0:
            t = a//b;
            a -= t*b
            a, b = b, a
            u -= t * v
            u, v = v, u
        u %= m
        if u < 0:
            u += m
        return u
    def __int__(self):
        return self.__x



if __name__ == '__main__':
    N, M = mulinputs()
    datas = list(mulinputs())

    total = sum(datas)
    k = 1/(4*M) * total

    
    cnt = 0
    for d in datas:
        if d >= k:
            cnt += 1
            continue
    if cnt >= M:
        judge = True
    else:
        judge = False
    print(yn[not judge::2])

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

sum=0
for a in A:
    sum+=a
judge=sum/(4*M)
count=0

for a in A:
    if a>=judge:
        count+=1

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

Solution (Python):
import sys
import heapq, math
from itertools import zip_longest, permutations, combinations, combinations_with_replacement
from itertools import accumulate, dropwhile, takewhile, groupby
from functools import lru_cache
from copy import deepcopy

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

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

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

ans = filter(lambda a:a>=(sum(As)*(1/(M*4))), As)

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

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

border = sum(items) / (4 * M)

if len([i for i in items if i >= border]) >= 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)
ans = 'Yes'
for i in range(m):
    if a[i] < sum(a)/(4*m):
        ans = 'No'
        break
print(ans)

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

Solution (Python):


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

if __name__ == "__main__":
    main()

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

a_sum = sum(a)
cnt = 0

def check(ai, m, a_sum):
    return ai*4*m >= a_sum

for ai in a:
    if check(ai, m, a_sum):
        cnt += 1

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

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

S = sum(A)

if B < S/(4*M):
    print('No')
else:
    print('Yes')

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

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

s = sum(A) // (4 * M) if not sum(A) % (4 * M) else sum(A) // (4 * M) + 1
c = sum([1 for a in A if a >= s])
print("Yes") if c >= M else print("No")

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

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

s = sum(a)
s = (s-1)//(4*m) + 1
count = 0
for i in range(n):
    if a[i] >= 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()))
hyo = sum(A)

ans = 0
sait = hyo / (4*M)
for i in A:
    if i >= sait:
        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 = sorted(A,reverse=True)

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

Solution (Python):
N,M= list(map(int , input().split()))
A = sorted(map(int,input().split()),reverse=True)
sou = sum(A)
saitei = sou /(4*M)
B = A[0:M]
C = min(B)
if C >= saitei:
    print("Yes")
else:
    print("No")

Solution (Python):
a,b=[int(i) for i in input().split()]
arr=[int(i) for i in input().split()]
tot=sum(arr)
p=(tot/(4*b))
arr.sort()
if arr[-b]>=p:
    print('Yes')
else:
    print('No')

Solution (Python):
N, M = map(int, input().split())
A = list(map(int, input().split()))
S = 0
counter = 0
for i in A:
    S = S + i
border = S / (4 * M)
for i in A:
    if i >= border:
        counter = counter + 1
result = "No"
if counter >= M:
    result = "Yes"
print(result)

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

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] * 4 * M) < S:
    print('No')
else:
    print('Yes')

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

Solution (Python):
n,m=list(map(int,input().split()))
a=sorted(list(map(int,input().split())),reverse=True)
s=sum(a)
p=s/(4*m)

for i in range(m):
    if(p>a[i]):
        print("No")
        break
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) * 1/(4*M):
    print("No")
    exit()
print("Yes")

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):
n,m = map(int,input().split())
A = list(map(int,input().split()))
asum=sum(A)

cnt=0
for i in range(n):
    if A[i]<(asum/(4*m)):
        continue
    else:
        cnt+=1

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

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

Solution (Python):
N, M = map(int, input().split())
A=list(map(int,input().split()))
count=0
count2=0
flag=False
for i in range(N):
    count+=A[i]
for i in range(N):
    if A[i]>=count*1/(4*M) and flag==False:
        count2+=1
    if count2>=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

YES = "Yes"  
NO = "No"  


def solve(N: int, M: int, A: "List[int]"):
    A.sort()
    filt = list(filter(lambda x: x >= sum(A)/(4*M), A))
    if len(filt) >= M:
        print(YES)
    else:
        print(NO)
    return



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

if __name__ == '__main__':
    main()

Solution (Python):


N,M=map(int, input().split())
A=[int(a) for a in input().split()]
s=sum(A)

A.sort(reverse=True)
if A[M-1]*4*M<s:
    print("No")
else:
    print("Yes")

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

Solution (Python):



def main():
    n, m = map(int, input().split())
    A = list(map(int, input().split()))
    A = sorted(A, reverse=True)

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


print(main())

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

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

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

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

flag = [0]*N
sumAn = sum(An)
threshold = sumAn/(4*M)
for i, A in enumerate(An):
  if A >= threshold: flag[i] = 1

print("Yes" if sum(flag) >= M else "No")

Solution (Python):
def solve(n, m, a_list):
    cnt = 0
    if sum(a_list) % (4 * m) == 0:
        bar = sum(a_list) // (4 * m)
    else:
        bar = sum(a_list) // (4 * m) + 1
    for a in a_list:
        if a >= bar:
            cnt += 1
    if cnt >= m:
        return "Yes"
    else:
        return "No"


def main():
    n, m = map(int, input().split())
    a_list = list(map(int, input().split()))
    res = solve(n, m, a_list)
    print(res)


def test():
    assert solve(4, 1, [5, 4, 2, 1]) == "Yes"
    assert solve(3, 2, [300, 19, 1]) == "No"
    assert solve(12, 3, [4, 56, 78, 901, 2, 345, 67, 890, 123, 45, 6, 789]) == "Yes"


if __name__ == "__main__":
    test()
    main()

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

s = sum(a)
counta = 0

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

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

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

num = 0
tot = sum(a)
for ai in a:
    if ai * 4 * m >= tot:
        num += 1

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

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

for i in a:
  kei+=i

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

Solution (Python):
input = raw_input

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

suma = sum(a_list)
th = float(suma) / (4*m)

count = 0
for a in a_list:
    if a * 4* m >= suma:
        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)
t = 0
for x in A:
    if 4*M*x >= s:
        t += 1
print("Yes" if t >= M else "No")

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

Solution (Python):


import sys

DEBUG = False

def read(t):
    return t(sys.stdin.readline().rstrip())


def read_list(t, sep = " "):
    return [t(s) for s in sys.stdin.readline().rstrip().split(sep)]


def dprint(*args, **kwargs):
    if DEBUG:
        print(*args, **kwargs)
    return


def main():
    n, m = read_list(int)
    as_ = read_list(int)
    all_voting = sum(as_)
    if len(list(filter(lambda v: v >= all_voting / (4 * m), as_))) >= m:
        print("Yes")
        return
    print("No")


if __name__ == "__main__":
    main()

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

Solution (Python):
import sys
n,m = [int(j) for j in sys.stdin.readline().split()]
l = [int(j) for j in sys.stdin.readline().split()]
l.sort(reverse=True)
for i in range(m):
    if l[i]<sum(l)/(4*m):
        
        print("No")
        break
else:
    print("Yes")

Solution (Python):


"""
about module
"""


def main():
    _, m = map(int, input().split())
    a = list(map(int, input().split()))
    counter = 0
    border = sum(a)/(4*m)
    for v in a:
        if v >= border:
            counter += 1
    if counter >= m:
        print('Yes')
    else:
        print('No')

if __name__ == '__main__':
    main()

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

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

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

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

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

s = sum(a)

count = 0
for n in a:
  if n >= s / 4 / M:
    count += 1

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

Solution (Python):
list_in=list(map(int,input().split()))
N=list_in[0]
M=list_in[1]

list_item= list(map(int,input().split()))
count = 0
threshold = sum(list_item) / (4 * M)
for item in list_item:
    if item >= threshold:
        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(' '))))

a.reverse()

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

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

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

    tot = sum(A)
    test = tot / (4 * M)

    count = 0

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

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



main()

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

Solution (Python):

n, m = [int(x) for x in input().split()]
As = [int(x) for x in input().split()]
s = 0
t = 0
flag = "No"
for a in As:
    t += a
for a in As:
    if not (4*m*a < t):
        s += 1
    if s >= m:
        flag = "Yes"
        break
print(flag)

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

Solution (Python):
import sys
sys.setrecursionlimit(10**6)
from math import floor,ceil,sqrt,factorial,log
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
from operator import itemgetter
from fractions import gcd
mod = 10 ** 9 + 7
inf = float('inf')
ninf = -float('inf')
 

def ii(): return int(sys.stdin.readline().rstrip()) 
def mii(): return map(int,sys.stdin.readline().rstrip().split())
def limii(): return list(mii()) 
def lin(n:int): return [ii() for _ in range(n)]
def llint(n: int): return [limii() for _ in range(n)]

def ss(): return sys.stdin.readline().rstrip() 
def mss(): return sys.stdin.readline().rstrip().split()
def limss(): return list(mss()) 
def lst(n:int): return [ss() for _ in range(n)]
def llstr(n: int): return [limss() for _ in range(n)]






n,m=mii()
arr=limii()

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

Solution (Python):
import sys
import math

from collections import defaultdict
from collections import deque
def load(vtype=int):
    return vtype(input().strip())
def load_list(seplator=" ", vtype=int):
    return [vtype(v) for v in input().strip().split(seplator)]
def exit():
    import sys
    sys.exit(0)
def perm_sub(li, used):
    if len(li) == len(used):
        return [deque()]
    k = []
    for i in range(len(li)):
        if i in used:
            continue
        used.add(i)
        sub_list = perm_sub(li, used)
        for sub in sub_list:
            sub.appendleft(li[i])
        k.extend(sub_list)
        used.discard(i)
    return k
def perm_li(li):
    return perm_sub(li, set())
def perm_n(n):
    return perm_sub(list(range(n)), set())
def join_i(li, sep=""):
    return sep.join([str(e) for e in li])
def li2n(li):
    n, base = 0, 1
    for i in range(len(li)-1, -1, -1):
        n += li[i] * base
        base *= 10
    return n
def sli2ili(li):
    return [int(s) for s in li] 
def prime_list(n):
    li = [i for i in range(2, n+1)]
    for i in range(len(li)):
        if li[i] >= int(math.sqrt(n)):
            break
        if li[i] == -1:
            continue
        for j in range(i+1, len(li)):
            if li[j] % li[i] == 0:
                li[j] = -1
    return [n for n in li if n != -1]
def gcd(a, b):
    a, b = max(a, b), min(a, b)
    while True:
        r = a % b
        if r == 0: return b
        a, b = b, r
def lcm(a, b):
    return int(a * b / gcd(a,b))
def all_subset(li):
    s = []
    n = len(li)
    for bit in range(0, (1<<(n+1))):
        ss = set()
        for i in range(0, n):
            if (bit & (1 << i)):
                ss.add(li[i])
        s.append(ss)
    return s
def factorial(n):
    if n == 1:
        return 1
    return n * factorial(n-1)
def mCn(m, n):
    def factorial_ntimes(m, n):
        r = 1
        while n:
            r *= m
            m -= 1
            n -= 1
        return r
    return int(factorial_ntimes(m, n) / factorial(n))

n, m = load_list()

A = load_list()

s = sum(A)

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

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

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

Solution (Python):
import sys
I=input().split()
N=int(I[0])
M=int(I[1])
HYO=[0]*N

I=input().split()
SO=0
for _ in range(N):
    HYO[_]=int(I[_])
    SO+=int(I[_])

HYO.sort()
if (HYO[N-M]<SO/(4*M)):
    print("No")
else:
    print("Yes")

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

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

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

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

    total = sum(A)

    count = 0
    for a in A:
        if a >= total / (4.0 * M):
            count += 1

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


if __name__ == '__main__':
    main()

Solution (Python):

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

mini = sum(A)/4/M

if sum([0 if a<mini else 1 for a in A]) >= 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:
    j = sum(A)/(4*M)
    if i >=j:
        cnt += 1

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

Solution (Python):
n,m=map(int,input().split())
a=[int(x) for x in input().split()]
b=sum(a)
c=sorted(a)
d=(b/4)/m
if c[-m]>=d:
    print('Yes')
else:
    print('No')

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