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:
import math
import fractions
import bisect
import collections
import itertools
import heapq
import string
import sys
import copy
from decimal import *
from collections import deque
sys.setrecursionlimit(10**7)
MOD = 10**9+7
INF = float('inf') #無限大
def gcd(a,b):return fractions.gcd(a,b) #最大公約数
def lcm(a,b):return (a*b) // fractions.gcd(a,b) #最小公倍数
def iin(): return int(sys.stdin.readline()) #整数読み込み
def ifn(): return float(sys.stdin.readline()) #浮動小数点読み込み
def isn(): return sys.stdin.readline().split() #文字列読み込み
def imn(): return map(int, sys.stdin.readline().split()) #整数map取得
def imnn(): return map(lambda x:int(x)-1, sys.stdin.readline().split()) #整数-1map取得
def fmn(): return map(float, sys.stdin.readline().split()) #浮動小数点map取得
def iln(): return list(map(int, sys.stdin.readline().split())) #整数リスト取得
def iln_s(): return sorted(iln()) # 昇順の整数リスト取得
def iln_r(): return sorted(iln(), reverse=True) # 降順の整数リスト取得
def fln(): return list(map(float, sys.stdin.readline().split())) # 浮動小数点リスト取得
def join(l, s=''): return s.join(l) #リストを文字列に変換
def perm(l, n): return itertools.permutations(l, n) # 順列取得
def perm_count(n, r): return math.factorial(n) // math.factorial(n-r) # 順列の総数
def comb(l, n): return itertools.combinations(l, n) # 組み合わせ取得
def comb_count(n, r): return math.factorial(n) // (math.factorial(n-r) * math.factorial(r)) #組み合わせの総数
def two_distance(a, b, c, d): return ((c-a)**2 + (d-b)**2)**.5 # 2点間の距離
def m_add(a,b): return (a+b) % MOD
def print_list(l): print(*l, sep='\n')
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def No(): print('No')

def sieves_of_e(n):
    is_prime = [True] * (n+1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, int(n**0.5)+1):
        if not is_prime[i]: continue
        for j in range(i * 2, n+1, i): is_prime[j] = False
    return is_prime

N,M = imn()
A = iln()
total = sum(A)
cnt = 0
for a in A:
    if 4*M*a >= total:
        cnt += 1
print('Yes' if cnt >= M else 'No')

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
val=[int(i) for i in input().split()]
valsum=sum(val)
ans=0
for i in val:
    if i>=valsum/(4*b):
        ans+=1
if ans>=b:
    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)
total = sum(a)

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

Submission status: Accepted

Solution code:
n, m = map(int, input().split())
arr = sorted(list(map(int, input().split())))
s = sum(arr)
if arr[n - 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()))
soutoku=sum(A)
A.sort(reverse=True)
A=A[:M]

if A[-1]>=soutoku/(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)
sum_val = sum(a)

flag = True
for i in range(m):
  if a[i] < sum_val / (4 * m):
    flag = False

if flag:
  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)
l = s * (1/(4*m))

cnt = 0
for ai in a:
    if ai >= l:
        cnt += 1
if cnt >= m:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
# n = int(input())
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")

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
n,m = map(int,input().split())
a = sorted(map(int,input().split()))
sum_a = sum(a)
thresh = sum_a/(4*m)
ans = [i for i in a if i >= thresh]
print("No" if len(ans)<m else "Yes")

Submission status: Accepted

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

Submission status: Accepted

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

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

a = sum(List)/(4*M)
b = max(List)

List.sort(reverse=True)
ans = 1

for i in range(M):
  if List[i] >= a:
    ans = 1
  else:
    ans = 0

if ans == 1:
  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)
border = s / (4 * m)


if len(list(filter(lambda x: x >= border, a))) >= m:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n,m=list(map(int,input().split()))
l=list(map(int,input().split()))
sm = sum(l)
val = (sm/(4*m))
ct=0
for c in l:
	if(c>=val):
		ct+=1
if(ct>=m):
	print("Yes")
else:
	print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:


n, m = (int(x) for x in input().split())
arr = [int(x) for x in input().split()]

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

Submission status: Accepted

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

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

if ans >= 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*m)
count=0
for i in range(0,len(a)):
  if a[i]>=b:
    count=count+1
if count>=m:
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

count=0
for i in range(n):
    if (a[i]>=border):
        count+=1
print("Yes" if (count>=m) else "No")

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n, m = map(int, input().split())
lst = list(map(int, input().split()))
ttl = sum(lst)
cnt = 0
for x in lst:
    if x >= ttl*(1/(4*m)):
        cnt += 1

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

Submission status: Accepted

Solution code:
n, m = map(int, input().split())
As = list(map(int, input().split()))
As = sorted(As, reverse=True)
num = sum(As)
ans = 0
for a in As:
  if num / (4*m) <= a:
    ans += 1
if ans >= m:
  print('Yes')
else:
  print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#coding:utf-8
N,M=map(int,input().split())
A=list(map(int,input().split()))
cmp=sum(A)/(4*M)
cnt=0
for i in A:
	if i>=cmp:
		cnt+=1
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()))

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

Submission status: Accepted

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

Submission status: Accepted

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

s = sum(a)
a.sort()

if all(a[-i-1] >= s/4/m for i in range(m)):
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
n,m=map(int,input().split())
A=sorted(list(map(int,input().split())), reverse=True)
B=sum(A)
for i in range(m):
    if A[i]<B/(4*m):
        print("No");exit()
print("Yes")

Submission status: Accepted

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

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

t.sort(reverse=True)

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

if check<=t[m-1]:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
InputIntList = lambda : list(map(int, input().split()))
InputStrList = lambda : list(input().split())

import numpy as np

N, M = InputIntList()
A = InputIntList()

A = np.array(A)
All = A.sum()
if len(A[A >= All / 4 / M]) >= M:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(M):
    if A[i] < total / (4*M):
        print('No')
        break
else:
    print('Yes')

Submission status: Accepted

Solution code:
N,M=map(int,input().split())
A=list(map(int,input().split()))
A.sort(reverse=True)
flag=True
count=0
sm=sum(A)
t=sm/(4*M)
for i in range(M):
    if A[i]<t:
        flag=False
        break
    count+=1
if flag:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

if A[M-1] < sum(A)/(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)
b = s / 4 / m
if m <= len([1 for x in a if b <= x]):
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
def main():
    import sys
    input = sys.stdin.readline

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

totalvote=sum(good)
limit=totalvote/(4*m)
good.sort()
if good[-1*m]<limit:
    print("No")
else:
    print("Yes")

Submission status: Accepted

Solution code:
n,m = map(int, input().split())
a = list(map(int, input().split()))
#s = input()
x = sum(a)/(4*m)

ct = 0
for aa in a:
    if aa >= x:
        ct += 1

if ct >= m:
    print('Yes')
else:
    print('No')
#ss= []
#for i in range(n):
#    ss.appned(int(input()))

Submission status: Accepted

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

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

for a in A:
    if a >= x:
        cnt += 1

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

Submission status: Accepted

Solution code:
import sys
import heapq
from operator import itemgetter
 
MAX_INT = int(10e15)
MIN_INT = -MAX_INT
mod = 1000000007
sys.setrecursionlimit(1000000)
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

N,M = IL()
a = IL()
num = sum(a)

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
l=list(map(int,input().split()))
l=sorted(l)
s=sum(l)
x=l[-1*b]
if float(s/(b*4))>x:
  print('No')
else:
  print('Yes')

Submission status: Accepted

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

border=sum(alist)/(4*M)
cnt=0
for a in alist:
  if a>=border:
    cnt+=1
    
#print(border)
#print(cnt)
if cnt>=M:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
import numpy as np

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

As = np.asarray(input().split(), dtype=np.uint32)

As.sort()

votes = np.sum(As)

if As[-m] >= (votes / (4 * m)):
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines

def main():
    N,M = map(int, readline().split())
    A = [int(i) for i in readline().split()]

    total = sum(A)
    std = total / (4*M)

    c = 0
    for a in A:
        if a >= std:
            c += 1
    
    print("Yes" if c >= M else "No")


if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

Submission status: Accepted

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

cnt=0
for num in A:
  if num >= summ/(4*M):
    cnt+=1
  else:
    break

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

Submission status: Accepted

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

Submission status: Accepted

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


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


n,m=list(map(int,input().split()))
a=list(map(int,input().split()))
a.sort()
a.reverse()
t=sum(a)/(4*m)
for i in range(m):
    if a[i]<t:
        print("No")
        exit()

print("Yes")

Submission status: Accepted

Solution code:
n,m = map(int,input().split())
A = [int(x) for x in input().split()]
lim = sum(A)/(4*m)
print(['No', 'Yes'][sum(a >= lim for a in A) >= m])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
n,m = list(map(int,input().split()))
a = list(map(int,input().split()))
sum_a = sum(a)
ret = "No"
cnt = 0
for i in a:
    if i >= (sum_a/(4*m)):
        cnt+=1

if cnt >= m:
    ret ="Yes"
print(ret)

Submission status: Accepted

Solution code:
import sys
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]<(1/(4*m))*s:
    print('No')
    sys.exit()
print('Yes')

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
input = lambda: sys.stdin.readline().rstrip() 

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

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

if __name__ == '__main__':
    resolve()

Submission status: Accepted

Solution code:
n, m = [int(s) for s in input().split()]

a_list = [int(s) for s in input().split()]
a_list = list(reversed(sorted(a_list)))

a_all = sum(a_list)

ans = "Yes" if a_list[m - 1] >= a_all / (4 * m) else"No"
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

total = sum(a)
b = []

for i in range(n):
    if a[i] >= total/(4*m):
        b.append(a[i])
        
if len(b) >= m:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
def input_int():
    return map(int, input().split())

def one_int():
    return int(input())

def one_str():
    return input()

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

N,M = input_int()
A = many_int()

sumA=sum(A)
count=0
for a in A:
    if 1/(4*M) > a/sumA:
        pass
    else:
        count+=1


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

Submission status: Accepted

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

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


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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#B
n, m = map(int, input().split())
a = list(map(int, input().split()))
count = 0
s=sum(a)
for i in a:
    if 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())
list_A = list(map(int, input().split()))

l = 1/(4*m)*sum(list_A)
cnt = 0
for c in list_A:
    if c >= l:
        cnt += 1

ans = "No"
if cnt >= m:
    ans = "Yes"

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

ans = 0
b = sum(a)
c = b / (4*m)
for i in a:
    if i >= c:
        ans += 1
if ans >= 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)
flag=True
x=sum(a)
for i in range(m):
    if a[i]<sum(a)/(4*m):
        flag=False

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
n,m = map(int,input().split())
a = list(map(int,input().split()))
count = 0
a = sorted(a,reverse=True)
sums = sum(a)
for i in range(m):
    if a[i] < sums*(1/(4*m)):
        print("No")
        sys.exit()
    count += 1
print("Yes")

Submission status: Accepted

Solution code:
N,M=map(int,input().split())
a=list(map(int,input().split()))
a.sort(reverse=True)
s=sum(a)
f = True
for i in range(M):
    if a[i]<s/(4*M):
        f = False
        break

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

Submission status: Accepted

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

threshold = sum(A)/M/4
count = 0
for elem in A:
    if elem >= threshold:
        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()))
gokei = sum(a)
ln = 0
for i in range(n):
    if a[i] >= gokei/(4 * m):
        ln += 1
if ln >= m:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
N,M = map(int,input().split())
A = sorted([int(i) for i in input().split()],reverse=True)
total = sum(A)
if A[M-1] >= total/(4*M):
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

s_A = sorted(A, reverse=True)
sum_A = sum(A)
cnt = 0
for i in range(N):
    if(s_A[i] >= (1/(4*M))*sum_A):
        cnt += 1
print("Yes" if cnt >= M else "No")

Submission status: Accepted

Solution code:
mod = 10**9+7
import sys
from collections import Counter, defaultdict, deque
from itertools import product, permutations, combinations
from itertools import accumulate
from operator import itemgetter
from bisect import bisect_left,bisect
from heapq import heappop,heappush
from math import ceil,floor
from copy import deepcopy
from heapq import heappop,heappush,heapify
import heapq


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 MI1(): return map(int1, sys.stdin.readline().split())

# 入力全てを整数に変換したものの配列を受け取る
# def LI(): return list(map(int, sys.stdin.readline().split()))
# 入力全てを整数に変換して1引いたものの配列を受け取る
def LLI(rows_number): return [LI() for _ in range(rows_number)]


def LI(): return list(map(lambda x:int(x), sys.stdin.readline().split()))
def HI(): return list(map(lambda x:int(x)*(-1), sys.stdin.readline().split()))


N,M = MI()
A = LI()
s = sum(A)
l = [a for a in A if a>=(s/(4*M))]

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

Submission status: Accepted

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

    vote_num = sum(num_list)

    count = 0

    for i in range(n):
        if vote_num * 1/(4*m) <= num_list[i]:
            count += 1

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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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


A = list(map(int,input().split()))
sm = sum(A)
A.sort(reverse=True)
for x in range(m):
    if A[x] < (1/(4*m))*sm:
        print("No")
        exit(0)
print("Yes")

Submission status: Accepted

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

get = sum(a)

num = 0

for i in range(n):
	if 4 * m * a[i] >= get:
		num += 1

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

Submission status: Accepted

Solution code:
n, m = map(int, input().split())
a = [int(s) for s in input().split()]
a.sort(reverse=True)

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

Submission status: Accepted

Solution code:
n, m = map(lambda i: int(i), input().split())
As = list(reversed(sorted(list(map(lambda i: int(i), input().split())))))

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n, m = map(int, raw_input().strip().split())
a = map(int, raw_input().strip().split())

total = sum(a)
cnt = 0

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

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

A.sort(reverse=True)
amount = sum(A)
cnt = 0
border = amount * (1/(4*M))
for a in A:
    if a >= border:
        cnt += 1

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()))
A.sort(reverse=True)
s = sum(A)
for i in range(M):
    if A[i] * 4*M<s:
        print('No')
        #break
        quit()
    else:
        continue
print('Yes')

Submission status: Accepted

Solution code:
n,m,*a_l = map(int, open(0).read().split())
all_votes = sum(a_l)
boder = all_votes/(4*m)
cnt = 0
for a in a_l:
    if a >= boder:
        cnt += 1
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()))
cnt = 0
A.sort()
s = sum(A)
for i in range(N):
    if A[i] >= s*(1/(4*M)):
        cnt += 1
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()))
a = sorted(a)
a = a[::-1]
flag = 0
for i in range(m):
    if a[i]*4*m < sum(a): flag = 1
print("Yes" if flag == 0 else "No")

Submission status: Accepted

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

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

cnt = 0
for a in A:
    if a >= lim:
        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()))

rate = 1/4/M

A = sorted(A)[::-1]

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

Submission status: Accepted

Solution code:

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

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy, copy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd


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


sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7


def main():
    n, m = MAP()
    a = LIST()
    b = [x for x in a if x * 4 * m >= sum(a)]

    if len(b) < m:
        print('No')
    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)
ans = 0
for i in a:
    if i >= s*1/(4*m):
        ans += 1
if ans >= m:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

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

count = 0

sum_A = sum(A)

for a in A : 
    if a >= (sum_A/(4*m)) : 
        count += 1
        
if count >= m : 
    print('Yes')
else : 
    print('No')

Submission status: Accepted

Solution code:
N, M = [int(i) for i in input().split()]
An = sorted([int(i) for i in input().split()])[::-1]
limit = sum(An)/(4 * M)
if An[M-1] >= limit:
  print("Yes")
else:
  print("No")