Problem:
 Score : 200 points    Problem Statement We have held a popularity poll for N items on sale. Item i received A_i votes.  From these N items, we will select M as popular items. However, we cannot select an item with less than \dfrac{1}{4M} of the total number of votes.  If M popular items can be selected, print Yes ; otherwise, print No .      Constraints  1 \leq M \leq N \leq 100  1 \leq A_i \leq 1000  A_i are distinct.  All values in input are integers.         Input Input is given from Standard Input in the following format:  N  M  A_1  ...  A_N       Output If M popular items can be selected, print Yes ; otherwise, print No .        Sample Input 1 4 1
5 4 2 1      Sample Output 1 Yes  There were 12 votes in total. The most popular item received 5 votes, and we can select it.       Sample Input 2 3 2
380 19 1      Sample Output 2 No  There were 400 votes in total. The second and third most popular items received less than \dfrac{1}{4\times 2} of the total number of votes, so we cannot select them. Thus, we cannot select two popular items.       Sample Input 3 12 3
4 56 78 901 2 345 67 890 123 45 6 789      Sample Output 3 Yes

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


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())
A=list(map(int,input().split()))
line=sum(A)/(4*M)
cnt=0
for i in range(N):
    if A[i]>=line:
        cnt=cnt+1
if cnt>=M:
    print("Yes")
else:
    print("No")

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

Solution (Python):
import sys
from collections import defaultdict, Counter, deque
from itertools import accumulate, permutations, combinations
from operator import itemgetter
from bisect import bisect_left, bisect_right, bisect
from heapq import heappop, heappush
from fractions import gcd
from math import ceil, floor, sqrt, cos, sin, pi
from copy import deepcopy




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

if __name__ == '__main__':
    print(main())

Solution (Python):
import sys
sys.setrecursionlimit(1000000)


if __name__ == "__main__":
    N, M = tuple(map(int, input().split(" ")))
    As = list(map(int, input().split(" ")))
    S = sum(As)
    As = [a for a in As if a >= S/(4*M)]
    if len(As) >= M:
        print("Yes")
    else:
        print("No")

Solution (Python):


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

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

flag = 1
for i in range(M):
    if A[i] < S/(4*M) :
        flag = 0

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

Solution (Python):

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

SA=sum(A)

ans=0

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

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

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

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

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

Solution (Python):
import collections
import math
import operator as op
from functools import reduce
from collections import Counter
import numpy as np
import math
import bisect
import heapq


MOD = 1000000007


def gcd(a, b):
    while b:
        a, b = b, a % b
    return a


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


def get_inputs(cast_func=None):
    if cast_func is None:
        return input().split()
    else:
        return list(map(cast_func, input().split()))


def get_input(cast_func=None):
    if cast_func is None:
        return input()
    else:
        return cast_func(input())


def is_prime(n):
    if n == 1:
        return False
    for i in range(2, int(n**0.5)+1):
        if n % i == 0:
            return False
    return True


def main():

    N, M = get_inputs(int)
    A = get_inputs(int)
    A.sort(reverse=True)
    

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



if __name__ == '__main__':
    main()

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

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

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

a.sort()
a.reverse()

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

print('Yes')

Solution (Python):

import sys

YES = "Yes"  
NO = "No"  


def solve(N: int, M: int, A: "List[int]"):
    s = sum(A)
    t = s / 4 / M
    v = [1 if a >= t else 0 for a in A]
    print(YES if sum(v) >= M else NO)



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

import bisect
import heapq
import math
import random
import sys
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations
from operator import add, mul, sub

sys.setrecursionlimit(1000000)
input = sys.stdin.readline
INF = 2**62-1

def read_int():
    return int(input())


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


def read_float():
    return float(input())


def read_float_n():
    return list(map(float, input().split()))


def read_str():
    return input().strip()


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


def error_print(*args):
    print(*args, file=sys.stderr)


def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()

        error_print(e - s, 'sec')
        return ret

    return wrap


@mt
def slv(N, M, A):
    A.sort(reverse=True)
    T = sum(A)
    t = T / (4*M)
    for i in range(M):
        a = A[i]
        if a < t:
            return 'No'
    return 'Yes'


def main():
    N, M = read_int_n()
    A = read_int_n()
    print(slv(N, M, A))


if __name__ == '__main__':
    main()

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

s = sum(A)
ok = not True in [a * 4 * M < s for a in A[::-1][:M]]

if ok:
    print('Yes')
else:
    print('No')

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

Solution (Python):
from bisect import bisect_left as bl, bisect_right as br, insort
import sys
import heapq
from math import *
from collections import defaultdict as dd, deque
def data(): return sys.stdin.readline().strip()
def mdata(): return map(int, data().split())


mod=int(1e9+7)

n,m=mdata()
A=list(mdata())
cnt=0
A.sort(reverse=True)
s=sum(A)/(4*m)
for i in range(m):
    if A[i]>=s:
        cnt+=1
    else:
        break
if cnt==m:
    print("Yes")
else:
    print("No")

Solution (Python):
N,M=map(int,input().split())
A=sorted(map(int,input().split()))
print(['No','Yes'][A[-M]>=sum(A)/(4*M)])

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

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

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

n,m=MI()

a=LI()
sou=sum(a)

if sum([i*4*m>=sou for i in a])>=m:
    print("Yes")
else:
    print("No")

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

for i in range(len(a)):
    if a[i] < tmp / 4 / m:
        continue
    else:
        count += 1

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

Solution (Python):
from sys import stdin
N,M = [int(x) for x in stdin.readline().rstrip().split()]
A = [int(x) for x in stdin.readline().rstrip().split()]
A.sort(reverse=True)
if A[M-1] >= sum(A)*(1/(4*M)):
    print("Yes")
else:
    print("No")

Solution (Python):
N,M = map(int,input().split())
A = list(map(int,input().split()))
S = sum(A)
A.sort()
flag = True
for i in range(M):
  a = A[N-1-i]
  if a * 4 * M >= S:
    continue
  else:
    flag = False
    break
print("Yes" if flag else "No")

Solution (Python):
n,m=map(int,input().split())
a=[int(x) for x in input().split()]
ss=sum(a)
pro=ss/(4*m)
c=0
for x in a:
    if x>=pro:
        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 = sorted(A, reverse=True)

S = sum(A)

x = S / (4 * M)

cnt = 0
for i in range(N):
    if A[i] >= x:
        cnt += 1

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

Solution (Python):
n, m = map(int, input().split())
a = list(map(int, input().split()))
sum_a = sum(a)
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())
*A,=map(int, input().split())

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

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

threshold = sum(a_list)/4/m           

count = 0
for a in a_list:
    if a >= threshold:
        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)
x = sum(A) / (M * 4)
if A[M-1] >= x:
    print("Yes")
else:
    print("No")

Solution (Python):
N, M = map(int, input().split())
A = list(map(int, input().split()))
total_votes = sum(A)
threshold = total_votes / (4 * M)
A_upper = [a for a in A if a >= threshold]

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

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

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

n,m = na()
a = na()
s = sum(a)
b = 0

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

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

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

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

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

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

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

sum_a = sum(a)

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

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

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

sou = sum(A)

ritu = sou / (4*M)


kazu = 0
for i in A:
    if i >= ritu:
        kazu += 1
    else:
        continue

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

Solution (Python):
from functools import reduce
from fractions import gcd
import math
import bisect
import itertools
import sys
sys.setrecursionlimit(10**7)
input = sys.stdin.readline
INF = float("inf")


def main():
    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
    
    if cnt >= M:
        print("Yes")
    else:
        print("No")


if __name__ == '__main__':
    main()

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

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

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

cnt = 0
judge = sum(A)/(4*M)
for i in A:
    if i >= judge:
        cnt += 1

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

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

total = sum(A)

count = 0
for a in A:
    if 4 * a * M >= total:
        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)
A.sort(reverse=True)
a = A[:M]
if a[-1] < S / (4 * M):
    print("No")
else:
    print("Yes")

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

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

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

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

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

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

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

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

Solution (Python):
''' بِسْمِ اللَّهِ الرَّحْمَٰنِ الرَّحِيمِ '''

gi = lambda : list(map(int,input().split()))
n, m = gi()
l = sorted(gi())[::-1]
if 4 * m * l[m - 1] < sum(l):
	print("No")
else:
	print("Yes")

Solution (Python):
import sys
input = lambda: sys.stdin.readline().rstrip()
input_nums = lambda: list(map(int, input().split()))

def main():
    N, M = input_nums()
    A = input_nums()
    total = sum(A)
    h = total/(4*M)
    if len([a for a in A if a >= h]) >= M: print('Yes')
    else: print('No')


if __name__ == '__main__':
    main()

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

Solution (Python):
n,m=map(int,input().split())
a=list(map(int,input().split()))
a.sort(reverse=1)
all=sum(a)
all=all/4/m






print('Yes' if a[m-1]>=all else 'No')

Solution (Python):


def solve():
    N, M = map(int, input().split())
    A = list(map(int, input().split()))
    B = sum(A)
    if sum(a>=B/4/M for a in A) >= M:
        return 'Yes'
    else:
        return 'No'
        
if __name__ == '__main__':
    print(solve())

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

ans = 0
flag = sum(a)/(4*m)

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

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

def yn(p):
    if p:
        return "Yes"
    else:
        return "No"
print(yn(c>=M))

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

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

goukei = sum(a)

a.sort(reverse=True)

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

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

A.sort()
A.reverse()

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

cnt = 0
for a in A:
	if a >= lim:
		cnt += 1
	else:
		break
if cnt >= M:
	print('Yes')
else:
	print('No')

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

total = sum(l)

x = 0

for num in l:
  if num * 4 * m >= total:
    	x += 1

if x >= m:
  print 'Yes'
else:
  print 'No'

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

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

Solution (Python):
n, m = [int(v) for v in input().split()]
alist = [int(v) for v in input().split()]
al = sorted(alist, reverse=True)

total = sum(alist)
threshold = total / 4 / m
print("Yes" if all([v >= threshold for v in al[:m]]) else "No")

Solution (Python):


def resolve():
    N,M = map(int,input().split())
    A = list(map(int,input().split()))
    A.sort(reverse=True)
    sm =sum(A)
    A= A[0:M]

    for i in A:
        if i * 4* M < sm:
            print("No")
            return
    print("Yes")


if __name__ == "__main__":
    resolve()

Solution (Python):

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

sotoku = sum(a)

if len( [aa for aa in a if aa>=sotoku/(4*m) ] ) >=m:
    print("Yes")
else:
    print("No")

Solution (Python):
def examA():
    X, Y, Z = LI()
    X, Y = Y,X
    X,Z = Z, X
    print(X,Y,Z)
    return

def examB():
    N, M = LI()
    A = LI()
    need = (sum(A)-1)//(4*M) + 1
    ans = 0
    
    for a in A:
        if a>=need:
            ans += 1
    if ans>=M:
        print("Yes")
    else:
        print("No")
    return

def examC():
    ans = 0
    print(ans)
    return

def examD():
    ans = 0
    print(ans)
    return

def examE():
    ans = 0
    print(ans)
    return

def examF():
    ans = 0
    print(ans)
    return

import sys,bisect,itertools,heapq,math,random
from copy import deepcopy
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LSI(): return list(map(str,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def SI(): return sys.stdin.readline().strip()
global mod,mod2,inf,alphabet,_ep
mod = 10**9 + 7
mod2 = 998244353
inf = 10**18
_ep = 10**(-12)
alphabet = [chr(ord('a') + i) for i in range(26)]

sys.setrecursionlimit(10**6)

if __name__ == '__main__':
    examB()

"""

"""

Solution (Python):
ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))

n,m = mi()
ali = li()

summ = 0
for i in range(n):
    summ += ali[i]

ki = summ / 4/ m
ans = 0
for i in range(n):
    if ali[i] >= ki:
        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)
for x in a[:m]:
    if x * 4 * m < sum(a):
        print('No')
        exit()
print('Yes')

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

A = sorted(A, key= lambda x: -x)


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

Solution (Python):

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

vote = sum(A)
count = 0

for a in A:
  if 4*a*M >= vote:
    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)

s = sum(A)/4/m

if A[m-1] < s:
    print('No')
else:
    print('Yes')

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

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

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

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

print(["No","Yes"][a>=M])

Solution (Python):
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) / (4*m):
        print("No"); break
else: print("Yes")

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

Solution (Python):


import sys
from itertools import accumulate

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e): return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(N=None): return list(MAP()) if N is None else [INT() for i in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
INF = 10 ** 18
MOD = 10 ** 9 + 7

N, M = MAP()
A = LIST()

A.sort(reverse=1)
total = sum(A)
a = A[M-1]
if a < total / (4*M):
    No()
else:
    Yes()

Solution (Python):
import sys

sys.setrecursionlimit(10 ** 7)
rl = sys.stdin.readline


def solve():
    N, M = map(int, rl().split())
    A = list(map(int, rl().split()))
    
    A.sort(reverse=True)
    sa = sum(A)
    t = sa / (4 * M)
    flg = True
    for i in range(M):
        if A[i] < t:
            flg = False
            break
    if flg:
        print('Yes')
    else:
        print('No')


if __name__ == '__main__':
    solve()

Solution (Python):










"""def kiri(n,m):
  r_ = n / m
  if (r_ - (n // m)) > 0:
    return (n//m) + 1
  else:
    return (n//m)"""
  
def main():
  n,m = map(int,input().split())
  Under = 1/(4*m)
  
  A = list(map(int,input().split()))
  SUM = sum(A)
  A = sorted(A,reverse=True)
  ANS = SUM * Under
  for i in range(m):
    if A[i] < ANS:
      print('No')
      exit()
  print('Yes')
  
if __name__ == '__main__':
  main()

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

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

total = sum(a)

ans = 0
for i in range(n):
    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()))
fl = "Yes"

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

for i in range(m):
    if a[i] < s * (1 / (4*m)):
        fl = "No"
        
print(fl)

Solution (Python):
N, M = map(int, input().split())
A = list(map(int, input().split()))
cnt = 0
total = sum(A)
for i in range(N):
    if A[i] >= total/4/M:
        cnt += 1
if cnt >= 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()]
A.sort(reverse=True)
S = sum(A)
for i in range(M):
    if 4*M*A[i] < S:
        print("No")
        exit()
print("Yes")

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

Solution (Python):


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



a = 0
for i in da: a += i
co = 0
b = (a-1)//(4*m)
for i in range(n):
    if b < da[i]: co += 1

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

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

A.sort(key=lambda x: -x)

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

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

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

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

B = list(filter(lambda x: x >= sum(A)/(4*M),A))
if len(B) >= M:
  print('Yes')
else:
  print('No')

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

cnt = 0

s = sum(li)

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

Solution (Python):
def main():
    import sys
    input=sys.stdin.readline
    n,m=map(int,input().split())
    A=list(map(int,input().split()))
    S=sum(A)
    c=0
    for i in range(n):
        if 4*m*A[i]>=S:
            c+=1
    if c>=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 A:
  if i >= s/(4*M):
    cnt+=1

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

Solution (Python):

from fractions import gcd
import math

from math import factorial as f

from math import ceil,floor,sqrt


import bisect
import re
import heapq


from copy import deepcopy
import itertools

from sys import exit

ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))

yes = "Yes"
no = "No"

def main():
    n,m = mi()
    a = li()
    s = sum(a)
    kyoukai = s/(4*m)
    cnt = 0
    for i in a:
        if i >= kyoukai:
            cnt+=1
    if cnt>=m:
        print(yes)
    else:
        print(no)

main()

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

can = 0
total = sum(nums)
for num in nums:
    if num * 4 * m  >= total:
        can += 1
if can >= m:
    print('Yes')
else:
    print('No')

Solution (Python):


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

A=list(map(int,input().split()))
A.sort()
A=A[::-1]


Al=sum(A)
for i in range(M):
    if A[i]<Al/(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 = sorted(a, reverse=True)
for i in range(m):
    if a[i] < s / (4 * m):
        print("No")
        exit()
print("Yes")

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

Solution (Python):

from sys import stdin
import sys
sys.setrecursionlimit(10**8)

def nextLine(): return next(stdin)
def nextStrList(): return nextLine().split()
def nextIntList(): return [int(_) for _ in nextStrList()]


def main():
	n,m=nextIntList()
	aList=nextIntList()
	s=sum(aList)
	th=s/4/m
	
	count=0
	for a in aList:
		if a>=th:
			count+=1
	
	if count>=m:
		print("Yes")
	else:
		print("No")


if __name__=="__main__":
	main()

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

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

total = sum(A)
a = [x for x in A if not x*4*M < total]

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

Solution (Python):
import sys, math
from itertools import permutations, combinations
from collections import defaultdict, Counter, deque
from math import factorial
from bisect import bisect_left 

sys.setrecursionlimit(10**7)
enu = enumerate
MOD = 10**9+7
def input(): return sys.stdin.readline()[:-1]
def pri(x): print('\n'.join(map(str, x)))

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

s = sum(A)
cnt = 0
for a in A:
    if a >= s/(4*M):
        cnt += 1

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

Solution (Python):
import sys
sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))
def resolve():
    N, M = lr()
    A = sorted(lr())[::-1]
    if A[M-1] < sum(A)/(4*M):
        print('No')
    else:
        print('Yes')
resolve()

Solution (Python):
import collections
import sys
import numpy as np
sys.setrecursionlimit(1000000000)

n,m = map(int,input().split())
a = list(map(int,input().split()))
toku = sum(a)
flag = toku*(1/(4*m))
cnt = 0
for i in range(len(a)):
    if a[i]>=flag:
        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() ]

s = sum(a)

cnt = 0
for aa in a:
    if 4 * aa * m >= s:
        cnt += 1

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

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

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

print(ans)

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

a = sorted(a, reverse=True)
all_vote = sum(a)

for i in range(m):
    if a[i] < all_vote * 0.25 / m:
        print("No")
        exit()
print("Yes")

Solution (Python):


import sys
import math
import collections
import itertools
INF = 10 ** 10
MOD = 10 ** 9 + 7
def input() : return sys.stdin.readline().strip()
def gcd(x, y) : return y if x % y == 0 else gcd(y, x % y)
def lcm(x, y) : return (x * y) // gcd(x, y)
def I() : return int(input())
def LI() : return [int(x) for x in input().split()]
def RI(N) : return [int(input()) for _ in range(N)]
def LRI(N) : return [[int(x) for x in input().split()] for _ in range(N)]
def PL(L) : print(*L, sep="\n")

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

X = sum(A)

ans = 0
for a in A:
    if a >= X * (1/(4*M)):
        ans += 1

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

Solution (Python):
import sys

input = sys.stdin.readline


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

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

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


if __name__ == "__main__":
    main()