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



Sample input:
4 1
5 4 2 1


Sample output:
Yes

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys


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


res = 0
Total = sum(A)
for a in A:
    if a*4*M>=Total:
        res += 1
if res>=M:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
N,M = [int(i) for i in input().split()]
A = [int(i) for i in input().split()]
A.sort(reverse=True)
s = sum(A)
for a in A[:M]:
    if a < s/(4*M):
        print("No")
        break
else:
    print("Yes")

Submission status: Accepted

Solution code:
import sys
input=sys.stdin.readline
n,m=map(int,input().split())
a=list(map(int,input().split()))
all=sum(a)
c=0
for i in a:
    if i>=all/(4*m):
        c+=1
if c>=m:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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


main()

Submission status: Accepted

Solution code:
N, M = [int(i) for i in input().split()]
A = [int(i) for i in input().split()]
S = sum(A)
th = S / (4*M)

res = 0
for i in A:
    if i>=th:
        res += 1

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

Submission status: Accepted

Solution code:
import sys,collections as cl,bisect as bs
sys.setrecursionlimit(100000)
input = sys.stdin.readline
mod = 10**9+7
Max = sys.maxsize
def l(): #intのlist
    return list(map(int,input().split()))
def m(): #複数文字
    return map(int,input().split())
def onem(): #Nとかの取得
    return int(input())
def s(x): #圧縮
    a = []
    if len(x) == 0:
        return []
    aa = x[0]
    su = 1
    for i in range(len(x)-1):
        if aa != x[i+1]:
            a.append([aa,su])
            aa = x[i+1]
            su = 1
        else:
            su += 1
    a.append([aa,su])
    return a
def jo(x): #listをスペースごとに分ける
    return " ".join(map(str,x))
def max2(x): #他のときもどうように作成可能
    return max(map(max,x))
def In(x,a): #aがリスト(sorted)
    k = bs.bisect_left(a,x)
    if k != len(a) and a[k] ==  x:
        return True
    else:
        return False
"""
def nibu(x,n,r):
    ll = 0
    rr = r
    while True:
        mid = (ll+rr)//2

    if rr == mid:
        return ll
    if (ここに評価入れる):
        rr = mid
    else:
        ll = mid+1
"""

N,M = m()

a = l()
po = sum(a)
a.sort(reverse = True)
co = 0
for i in range(N):
    if a[i] >= po/(4*M):
        co += 1
if co >= M:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
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")

Submission status: Accepted

Solution code:
import os
import sys

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(10 ** 9)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7
# MOD = 998244353

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys


def input():
    return sys.stdin.readline().strip()


def main():
    N, M = map(int, input().split())
    A = list(map(int, input().split()))
    s = sum(A)
    A.sort(reverse=True)
    for i in range(M):
        if A[i] >= s / (4 * M):
            continue
        else:
            print("No")
            break
    else:
        print("Yes")


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(M):
    if 4 * M * A[i] < sum(A):
        print('No')
        break

else:
    print('Yes')

Submission status: Accepted

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

res = 0
for a in A:
    if a >= sa:
        res += 1

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

Submission status: Accepted

Solution code:
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("YNeos"[count < M::2])

Submission status: Accepted

Solution code:
N,M=map(int,input().split())
A=list(map(int,input().split()))
c=0
S=sum(A)

for i in A:
    if i>=S/M/4:
        c+=1

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline

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

border = sum(A)

c = 0
for a in A:
    if border <= a*4*M:
        c += 1

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

Submission status: Accepted

Solution code:
n,m = map(int,input().split())
a = list(map(int,input().split()))
a = sorted(a)
sm = sum(a)

cnt = 0
for i in a:
    cnt += sm <= (4 * m * i)
if cnt >= m:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

S=sum(A)
for i in sorted(A,reverse=True)[:M]:
    if i<S/(4*M):
        print("No")
        break
else:
    print("Yes")

Submission status: Accepted

Solution code:
from sys import stdin

def input():
	return stdin.readline()[:-1]

def intput():
	return int(input())

def sinput():
	return input().split()

def intsput():
	return map(int, sinput())

n, m = intsput()
ls = list(intsput())
ls = sorted(ls)
total = 0
for x in ls:
	total += x
crit = total / (4*m)
ls = ls[::-1]
if ls[m-1]>=crit:
	print("Yes")
else:
	print("No")

Submission status: Accepted

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N, M = MAP()
A = LIST()
sum_A = sum(A)
if sum([x >= sum_A/(4*M) for x in A]) >= M:
	print("Yes")
else:
	print("No")

Submission status: Accepted

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

b = sum(a) / (4.0 * m)
cnt = 0
for ai in a:
    if ai >= b:
        cnt += 1
ans = 'Yes' if cnt >= m else 'No'
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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

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

AS = sum(A)

ans = 0

for i in range(N):

    if A[i] * 4 * M >= AS:
        ans += 1

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

Submission status: Accepted

Solution code:
N, M = map(int, input().split())
Alist = sorted(list(map(int, input().split())))[::-1]
line = sum(Alist) / (4*M)
for i in range(M):
    if Alist[i] < line:
        print("No")
        break
else:
    print("Yes")

Submission status: Accepted

Solution code:
import sys

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  # ignore trailing spaces

n, m = na()
a = na()
ok = 0
s = sum(a)
for v in a:
    if v*(4*m) >= s:
        ok += 1
if ok >= m:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
N, M = map(int, input().split())
a = list(map(int, input().split()))
sm = sum(a)
t = 0
for i in range(N):
  if a[i] >= sm / (4 * M): t += 1
if t >= M: print("Yes")
else: print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
input=lambda: sys.stdin.readline().rstrip()
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")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
sys.setrecursionlimit(10**8)
INF = float("inf")


def yes():
    print("Yes")  # type: str


def no():
    print("No")  # type: str


def solve(N: int, M: int, A: "List[int]"):
    A.sort(reverse=True)
    if A[M-1] >= sum(A)/(4*M):
        yes()
    else:
        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))  # type: int
    M = int(next(tokens))  # type: int
    A = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    solve(N, M, A)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, acos, atan, asin, log, log10
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
def input(): return sys.stdin.readline().strip()
def STR(): return input()
def INT(): return int(input())
def FLOAT(): return float(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
def lcm(a, b): return a * b // gcd(a, b)
sys.setrecursionlimit(10 ** 9)
inf = sys.maxsize
mod = 10 ** 9 + 7
dx = [0, 0, 1, -1, 1, -1, -1, 1]
dy = [1, -1, 0, 0, 1, -1, 1, -1]

n, m = MAP()
a = LIST()
s = sum(a)
a.sort(reverse=True)
t = s / 4 / m
if a[m - 1] >= t:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
import sys, bisect, math, itertools, string, queue, copy
# import numpy as np
# import scipy
from collections import Counter,defaultdict,deque
from itertools import permutations, combinations
from heapq import heappop, heappush
from fractions import gcd
# input = sys.stdin.readline
sys.setrecursionlimit(10**8)
mod = 10**9+7
def inp(): return int(input())
def inpm(): return map(int,input().split())
def inpl(): return list(map(int, input().split()))
def inpls(): return list(input().split())
def inplm(n): return list(int(input()) for _ in range(n))
def inplL(n): return [list(input()) for _ in range(n)]
def inplT(n): return [tuple(input()) for _ in range(n)]
def inpll(n): return [list(map(int, input().split())) for _ in range(n)]
def inplls(n): return sorted([list(map(int, input().split())) for _ in range(n)])

def main():
    n,m = inpm()
    a = inpl()
    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()

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
n,m = map(int,input().split())
al = list(map(int,input().split()))

al = sorted(al, reverse=True)

k = al[m-1]

if k / sum(al) < 1 / (4 * m):
    print("No")
else:
    print("Yes")

Submission status: Accepted

Solution code:
import sys
n, m = [int(i) for i in sys.stdin.readline().split()]
a_ls = [int(i) for i in sys.stdin.readline().split()]
a_ls.sort(reverse=True)
if a_ls[m-1] < sum(a_ls) / 4 / m:
    print("No")
else:
    print("Yes")

Submission status: Accepted

Solution code:
N,M=map(int,input().split())
A=list(map(int,input().split()))
s=sum(A)
count=0
for i in range(0,N):
    if 4*M*A[i]>=s:
        count+=1

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import array
from bisect import *
from collections import *
import fractions
import heapq
from itertools import *
import math
import random
import re
import string
import sys

N, M = map(int, input().split())
As = list(map(int, input().split()))
s = sum(As)
As.sort(reverse=True)

ok = True
for m in range(M):
    if As[m] * 4 * M >= s:
        pass
    else:
        ok = False
if ok:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
#
# 　　  ⋀_⋀　 
#　　  (･ω･)  
# .／ Ｕ ∽ Ｕ＼
#  │＊　合　＊│
#  │＊　格　＊│ 
#  │＊　祈　＊│ 
#  │＊　願　＊│ 
#  │＊　　　＊│ 
#      ￣
#
import sys
sys.setrecursionlimit(10**6)
input=sys.stdin.readline
from math import floor,sqrt,factorial,hypot,log #log2ないｙｐ
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 fractions import gcd
from random import randint
def ceil(a,b): return (a+b-1)//b
inf=float('inf')
mod = 10**9+7
def pprint(*A): 
    for a in A:     print(*a,sep='\n')
def INT_(n): return int(n)-1
def MI(): return map(int,input().split())
def MF(): return map(float, input().split())
def MI_(): return map(INT_,input().split())
def LI(): return list(MI())
def LI_(): return [int(x) - 1 for x in input().split()]
def LF(): return list(MF())
def LIN(n:int): return [I() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]
def LLIN_(n: int): return [LI_() for _ in range(n)]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def I(): return int(input())
def F(): return float(input())
def ST(): return input().replace('\n', '')
def main():
    N,M=MI()
    A=LI()
    ans = 0
    need = sum(A)
    for a in A:
        if(need<=4*M*a):
            ans += 1
    if(ans>=M):
        print("Yes")
    else:
        print("No")
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
#template
from collections import Counter
def inputlist(): return [int(k) for k in input().split()]
#template
N,M = inputlist()
A = inputlist()
count = 0
s = sum(A)
for i in range(N):
    if A[i] >= s/(4*M):
        count +=1
if count >= M:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def SI(): return sys.stdin.readline()[:-1]

def main():
    n,m=MI()
    aa=LI()
    s=sum(aa)
    cnt=0
    for a in aa:
        if a*4*m>=s:cnt+=1
    if cnt>=m:print("Yes")
    else:print("No")

main()

Submission status: Accepted

Solution code:
import sys

# import bisect
# from collections import Counter, deque, defaultdict
# import copy
# from heapq import heappush, heappop, heapify
# from fractions import gcd
# import itertools
# from operator import attrgetter, itemgetter

# import math

# import numpy as np

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


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

    total = sum(a)

    cnt = 0

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

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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
# ABC161b


def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**6)
    # 再帰関数を使わない限りPypyで出すこと

    def dump(*args):
        sys.stderr.write(str(args))

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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline

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

Submission status: Accepted

Solution code:
# ANSHUL GAUTAM
# IIIT-D

from math import *
from copy import *
from string import *				# alpha = ascii_lowercase
from random import *				# l.sort(key=lambda l1:l1[0]-l1[1]) => ex: sort on the basis difference
from bisect import *				# bisect_left(arr,x,start,end)  => start and end parameters are temporary
from sys import stdin				# bisect_left return leftmost position where x should be inserted to keep sorted
from sys import maxsize
from operator import *				# d = sorted(d.items(), key=itemgetter(1))
from itertools import *
from collections import Counter		# d = dict(Counter(l))
from collections import defaultdict # d = defaultdict(list)

'''

'''

def solve(l,m):
	f = 1
	n = len(l)
	tot = sum(l)
	k = tot/(4*m)
	l = sorted(l)[::-1][:m]
	for i in l:
		if(i < k):
			f = 0
			break
	if(f):
		return 'Yes'
	else:
		return 'No'

N,M = list(map(int, stdin.readline().rstrip().split()))
l = list(map(int, stdin.readline().rstrip().split()))
ans = solve(l,M)
print(ans)

Submission status: Accepted

Solution code:
def main():
    N, M = list(map(int, input().split()))
    A = list(map(int, input().split()))
    A.sort(reverse = True)
    S = sum(A)

    return A[M - 1] * 4 * M >= S

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

Submission status: Accepted

Solution code:
#!usr/bin/env python3
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.buffer.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 = LI()
    a = LI()
    s = sum(a)
    k = 0
    for i in a:
        if 4*m*i < s:
            continue
        k += 1
    if k >= m:
        print("Yes")
    else:
        print("No")
    return

#Solve
if __name__ == "__main__":
    solve()

Submission status: Accepted

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

Submission status: Runtime Error

Solution code:
N, M =  map(int, input().split())
A = list(map(int, input().split()))
assert len(A) == N
# 商品iは得票Ai
# 総得票数の1/4M以上の商品をM個選ぶ
total = sum(A)
thres = math.ceil(total / (4 * M))
count = len([i for i in range(N) if A[i] >= thres])
if count >= M:
  print('Yes')
else:
  print('No')

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
 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")

Submission status: Runtime Error

Solution code:
n, m = map(int, input().split())
A = list(map(int, input().split()))
sorted_A = list(reversed(sorted(A)))
print("No" if sorted_A[m] < sum(A)/(4*m) else "Yes")

Submission status: Runtime Error

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

A_sum = sum(A)
float(th) = float(A_sum / (4 * M))
popular_product = 0

for a in A:
    if a >= th:
        popular_product += 1

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

Submission status: Runtime Error

Solution code:
[N, M] = list(map(int, input().split(' ')))
A = list(map(int, input().split(' ')))

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n, m = map(int, input().split())
in_list = input().split
vote_list = [int(i) for i in in_list]

ans = 0
for ai in vote_list:
    if ai >= 1/(4*m)*sum(vote_list):
        ans += 1

if ans < m :
    print('no')
else:
    print('yes')

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
mn = input().split()
ob = input().split()

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

votes = 0

for i in range(n):
    ob[i] = int(ob[i])
    votes += ob[i]

ob.sort(reverse=true)

line = votes/4/m

ans = 0

for i in range(m):
    if ob[i] <= line:
        ans += 1

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

Submission status: Runtime Error

Solution code:
n,m = map(int,input().split())
hyo = list(map(int,input().split()))
all_hyo = sum(hyo)

hyo.sort(reverse=True)

a = True

for x in range(m):
  if hyo[m] < all_hyo / 4 / m:
    a = False
    break

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N, M = map(int, input().split())
A = list(map(int, input().split()))
if A[M-1] < (1/(4*M)):
  print('No')
else
  print('Yes')

Submission status: Runtime Error

Solution code:
N, M = map(int, input().split())
A = list(map(int, input().split()))
if A[M-1] < (1/4*M):
  print('No')
else
  print('Yes')

Submission status: Runtime Error

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

s = sum(A)
A = sorted(A)
ans = 'Yes'
for i in M:
  if A[i] < s/(4*M): 
    ans = 'No'
    break
    
print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n, m = map(int,input().split())
lst = list(map(int,input().split()))
lst.sort()
lst.reverse()
x = sum(lst)
if (lst[m] < x/4/m):
  print("No")
else:
  print("Yes")

Submission status: Runtime Error

Solution code:
n, m = map(int,input().split())
lst = list(map(int,input().split()))
lst = sorted(lst)
lst = reversed(lst)
x = sum(lst)
if (lst[m] < x/4/m):
  print("No")
else:
  print("Yes")

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
x,y = map(int,input().split())
A=[int(input())  for i in range(x)]
T=sum(A)
a=0
for i in range(x):
  if A[i]<1/(4*T):
    a+=1
if a>=y:
  print('Yes')
else:
  print('No')

Submission status: Runtime Error

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

limit=sum(a)/(4*m)
c=0
for aa in a:
  if a >=limit:
    c+=1
  else:
    pass
if c==0:
  print('No')
else:
  print('Yes')

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
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")

Submission status: Runtime Error

Solution code:
a,b=map(iNt,input().split())
c=list(map(int,input().split()))
c=[i for i in c if i>a/(4*b)]
if len(c)<b:
  print("No")
else:
  print("Yes")

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
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)):
  print("No")
else:
  print("Yes")

Submission status: Runtime Error

Solution code:

n,m=map(int,input().split())
a=list(map(int,input().split()))
 
cnt=0
 
for i in a:
	if (s/(4*m))<=i:
		cnt+=1
		if cnt==m:
			print("Yes")
            
if cnt<m:
	print("No")

Submission status: Runtime Error

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

cnt = 0
th = sum(A)/(4*M)

for i in range(len(A)):
  if A[i] >= th:
    cnt += 1

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

Submission status: Runtime Error

Solution code:
n,m = map(int,input().split())
a = list(map(int,input().split()))
b = sorted(a,reverse=True)
c  = 0
for i in b:
    c = c+i
d = c/(4*m)
if b[m] >=  d:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
n,m = map(int,input().split())
a = list(map(int,input().split()))
b = sorted(a,reverse=True)
c  = 0
for i in b:
    c = c+i
d = c/4*m
if b[m] >=  d:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n,m = map(int,input().split())
a = sorted(list(map(int,input().split())))
a_list=[]
for i in a[:m]:
  if sum(a)/(a*m) > i:
    print('No')
    exit()
  else:
    a_list.append(i)
print('Yes')

Submission status: Runtime Error

Solution code:
N,M = map(int,input().split())
A = list(map(int,input().split)))
sum = 0
ans = "Yes"
for i in range(len(A)):
  sum += A[i]
judge = sum / (4*M)
for i in ramge(len(A)):
  if A[i] < judge:
    ans = "No"
    break
print(ans)

Submission status: Runtime Error

Solution code:
_,m=map(int,input().split())
a=list(map(int,input().split()))
cnt=0
temp=sum(a)
for v in a:
    if v>=a/(4*m): cnt+=1
if cnt>=m: print("Yes")
else: print("No")

Submission status: Runtime Error

Solution code:
N,M = map(int,input().split())
A = list(map(int,input().split()))
A.sort(reverse = True)
num = 0
for i in A:
    num += i
if A[M] >= num//4*M:
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

Solution code:
n,m=map(int,input().split())
a=list(map(int,input().split()))
a_sort=a.sorted()
sum=0
for i in a:
  sum+=i

for j in (1,m+1):
 if j<=1/(4*m):
    print("No")
    exit()
print("Yes")