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()))
a = sum(A)
ans = []
for i in A:
    if i>=(a*(1/(4*M))):
        ans.append(i)

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

Submission status: Accepted

Solution code:
n,m=map(int,input().split(" "))
get=list(map(int,input().split(" ")))
count=0
sum=sum(get)
for i in get:
    if i>=sum/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()))
vote = sum(A)
cnt = 0

for i in range(N):
  if A[i] >= vote / 4 / M:
    cnt += 1
  else:
    continue
 
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 = 0
X = 0
for i in range(N):
    S += int(A[i])

for j in range(N):
    if S%(4*M) == 0:
        if A[j] >= S//(4*M):
            X += 1
    else:
        if A[j] > S//(4*M):
            X += 1
if X >= M:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:


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


def read_ints():
    return list(map(int, input().strip().split(' ')))


def solve():
    N, M = read_ints()
    A = read_ints()
    total = sum(A)
    threshold = total/(4*M)
    if sum(1 for a in A if a >= threshold) >= M:
        return 'Yes'
    return 'No'


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

Submission status: Accepted

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

totalVote = sum(A)
border = totalVote / (4 * M)
A.sort(reverse = True)

if A[M-1] >= border:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
I = [input() for i in range(2)]
N,M = map(int,I[0].split())
A = list(map(int,I[1].split()))
#print(A)
A.sort(reverse = True)
#print(A)
S = sum(A)

if A[M-1] >= S/(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()))
sum_A = sum(A)
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())
A = list(map(int, input().split()))
count = [i for i in A if i >= sum(A) / (4 * M)]
print("Yes" if len(count) >= M else "No")

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
N, M = map(int, input().split())
A = list(map(int, input().split()))
s = sum(A)
judge = s / (4*M)
count =0

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

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

Submission status: Accepted

Solution code:
import numpy as np
n,m = list(map(int, input().split()))
a = np.array(input().split()).astype(int)

total = sum(a)
if np.sum(a >= total*(1/(4*m))) < m:
    print("No")
else:
    print("Yes")

Submission status: Accepted

Solution code:
n,m = map(int,input().split())
a = list(map(int,input().split()))
a.sort(reverse=True)
sum_vote = sum(a)
judge = sum_vote /  (4*m)
ans = 'Yes'
for x in a[:m:]:
    if x < judge:
        ans = 'No'
        break
print(ans)

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
import sys
N, M = map(int, sys.stdin.readline().split())
A = sorted(list(map(int, sys.stdin.readline().split())), reverse=True)
S = sum(A)
if A[M - 1] < S / (4 * M):
    print("No")
else:
    print("Yes")

Submission status: Accepted

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

a_sum = sum(a)
t = a_sum / (4*m)

cnt = 0
for i in range(n):
    if a[i] >= t:
        cnt += 1
    else :
        break
        
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()
thresh = sum(a)/(4*m)
ok = 0
for i in range(len(a)):
  if a[i]>=thresh:
    ok +=1
print("Yes" if ok >= m else "No")

Submission status: Accepted

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

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

B=[i for i in A if i>=sum(A)/(4*M)]

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

Submission status: Accepted

Solution code:
N,M = (int(x) for x in input().split())
list = [int(x) for x in input().split()]

sum = 0
result = 0

for i in range(N):
    sum = sum + list[i] 

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

Submission status: Accepted

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

sum_A = sum(A_list)

border = sum_A/(4*M)
cnt = 0

for i in range(N):
    if A_list[i] >= border:
        cnt += 1
    else:
        break
    
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()))

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

if L[m-1]>=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()))  

sumvote = sum(A)


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

Submission status: Accepted

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

Submission status: Accepted

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

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

qtd_votos = sum(votos)

minimo = qtd_votos/(4*M)

votos.sort(reverse = True)

if votos[M-1] >= minimo:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

P = [i for i in A if i >= sum(A)/(4*M)]
         
if len(P) < M:
	print("No")
else:
    print("Yes")

Submission status: Accepted

Solution code:
n,m = map(int, raw_input().split(' '))
items = map(int, raw_input().split(' '))
s = sum(items)
count = 0
for i in range(len(items)): count +=1 if items[i] *4*m >= s else 0

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

Submission status: Accepted

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

ans = 0
for i in c:
    th = sum(c)/(4*m)
    if i<th:
        continue
    else:
        ans += 1
if ans>=m:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
n,m = map(int,input().split())
s = list(map(int,input().split()))
a = []
for i in s:
  if i >= sum(s)/(4*m):
    a.append(i)
    
if len(a) >= 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)
flg=1
for i in range(m):
	if 4*m*a[i]<sum(a):
		flg=0
		break
if flg:
	print('Yes')
else:
	print('No')

Submission status: Accepted

Solution code:
n, m = map(int, input().split())
a = list(map(int, input().split()))
k = sum(a) / (m * 4)
count = 0
for i in a:
    if i >= k:
        count += 1
if count >= 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()))
    assert N == len(A)
    votes = sum(A)/(4*M)
    count = 0
    for i in A:
        if i >= votes:
            count += 1
    print("Yes") if count >= M else print("No")


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
def main():
    N, M = map(int, input().split())
    A = list(map(int, input().split()))
    assert N == len(A)
    votes = sum(A)
    count = 0
    for i in A:
        if i * 4 * M >= votes:
            count += 1
    print("Yes") if count >= M else print("No")


if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

Submission status: Accepted

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

x = [num >= listsum/(4*m) for num in nlist]
print("Yes") if x.count(True) >= m else print("No")

Submission status: Accepted

Solution code:
import numpy as np
N, M = map(int, input().split())
A = np.array(list(map(int, input().split())))

if np.sum(A >= np.sum(A) / (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()))
s = sum(a)
cnt = 0
for i in range(n):
    if a[i] >= s/(4*m):
        cnt += 1
if cnt >= m:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

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

	if (m==cnt):
		print('Yes')
		exit(0)

print('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:
a,b=map(int,input().split())
n=list(map(int,input().split()))
c=sum(n)/(4*b)
d=[i for i in n if i>=c]
if b>len(d):
    print('No')
else:
    print('Yes')

Submission status: Accepted

Solution code:
from sys import stdin

n, m = [int(x) for x in stdin.readline().rstrip().split()]
a_list = [int(x) for x in stdin.readline().rstrip().split()]

pick = [ x for x in a_list if x >= sum(a_list) / 4 / m]

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

Submission status: Accepted

Solution code:
N, M = map(int, input().split())
A = list(map(int, input().split()))
A = sorted(A, reverse=True)
isOk = True
judge_border = 1/(4 * M) * sum(A)
for i in range(M):
  if A[i] < judge_border:
    isOk = False
    break

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

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
l=list(map(int,input().split()))
lnew=sorted(l)
k=sum(l)
flag=True
for i in range(b):
    if lnew[a-1-i]<sum(l)/4/b:
        flag=False
        break
    else:
        continue
if flag==True:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N, M = map(int, input().split())
vote = list(map(int, input().split()))
sum = sum(vote)
allowedList = []


for i in range(0,len(vote)):
    if sum / 4 / M <= vote[i]:
        allowedList.append(vote[i])


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

Submission status: Accepted

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

    a = sorted(a, reverse=True)

    total = sum(a)

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

Submission status: Accepted

Solution code:
n,m=map(int,input().split())
a=list(map(int,input().split()))
a.sort(reverse=True)
a_sum=sum(a)
count=0
for i in range(m):
    if  a[i] >= a_sum/(4*m):
        count+=1

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

ans = 0
for i in A:
    if i >= vote/(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()))
votes = sum(a)
selected = [i for i in a if i >= votes / (4 * m)]
print("Yes" if len(selected) >= m else "No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n, m = input().split()
a = input().split()
vote = 0
cnt = 0

for i in range( len(a) ):
    vote += int( a[i] )

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

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

Submission status: Accepted

Solution code:
x,y = map(int,input().split())
li = list(map(int,input().split()))	
cnt = 0
for i in range(len(li)):
    if li[i] >= sum(li) / (4*y):
        cnt += 1
else:
    pass

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

Submission status: Accepted

Solution code:

#ライブラリインポート
from collections import defaultdict

con = 10 ** 9 + 7
#入力受け取り
def getlist():
	return list(map(int, input().split()))

#処理内容
def main():
	N, M = getlist()
	A = getlist()
	S = sum(A)
	cnt = 0
	for i in range(N):
		if 4 * M * A[i] >= S:
			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()))
S=sum(A)
l=S/(4*M)
h=0
for i in range(N):
  if A[i]>=l:
    h+=1
if h>=M:
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

Submission status: Accepted

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

a = sum(A)/4/M

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

Submission status: Accepted

Solution code:
import numpy as np
N,M = map(int,input().split())
A = np.array(list(map(int,input().split())))
s = A.sum()/(4*M)
if np.count_nonzero(A >= s) >= M:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n,m = map(int,input().split())
li = list(map(int,input().split()))
  
li.sort(reverse=True)
  
a=li[m-1]
b=sum(li)

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

Submission status: Accepted

Solution code:

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

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

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

Submission status: Accepted

Solution code:
import sys;input=lambda:sys.stdin.readline().rstrip();aint=lambda:int(input());ints=lambda:list(map(int,input().split()))
import math;floor,ceil=math.floor,math.ceil
from collections import deque
Yes=lambda b:print('Yes')if b else print('No');YES=lambda b:print('YES')if b else print('NO')
is_even=lambda x:True if x%2==0 else False

def main():
    n,m = ints()
    a = ints()
    s = sum(a)
    a.sort(reverse=1)
    Yes(a[m-1]>=s/(4*m))

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
def resolve():
    N, M = map(int, input().split()) 
    A_list = list(map(int, input().split()))

    A_SUM = sum(A_list)
    THRESHOLD = A_SUM * (1 / (4 * M))

    count = 0
    for a in A_list:
        if THRESHOLD <= a:
            count += 1

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

if __name__ == "__main__":
    resolve()

Submission status: Accepted

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

sumA = sum(listA)
count = 0
for a in listA:
    if a >= sumA/(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=0
b=1/(4*m)

for i in range(n):

    if a[i]< sum(a)*b:

        pass

    else:
        s+=1

if s >= m:

    print("Yes")

else:
    print('No')

Submission status: Accepted

Solution code:
n,m = map(int, input().split())
a_s = sorted(list(map(int, input().split())), reverse=True)
cnt = 0
b = sum(a_s) * 1/(4 * m)

for i in range(m):
    if a_s[i] >= b:
        cnt += 1

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

Submission status: Accepted

Solution code:
n,m = map(int, input().split())
a_s = list(map(int, input().split()))
cnt = 0
b = sum(a_s) * 1/(4 * m)

for a in a_s:
    if a >= b:
        cnt += 1

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

Submission status: Accepted

Solution code:
N, M=map(int,input().split())
alist = list(map(int,input().split()))
alist.sort(reverse = True)
abc = sum(alist)
if alist[M-1] >= abc/(4*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)
a
s = sum(a)

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

Submission status: Accepted

Solution code:
M,N=map(int,input().split())
a_list=list(map(int,input().split()))
b_list=sorted(a_list)
B=b_list[-1*N]
C=sum(a_list)/(4*N)
if B >= C:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
N,M,*A=map(int, open(0).read().split())
S=sum(A)/(4*M)
print("YNeos"[not(sum(a>=S for a in A)>=M)::2])

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
s = [input() for i in range(2)]
n = int(s[0].split()[0])
m = int(s[0].split()[1])
a = list(map(int, s[1].split()))

sumVote = sum(a)
border = 1 / (4 * m) * sumVote
select = 0
for item in a:
    if border <= item:
        select += 1
    if select == m:
        print("Yes")
        exit()
print("No")

Submission status: Accepted

Solution code:
N,  M = map(int,input().split())
A = list(map(int, input().split()))
Asort = sorted(A,reverse = True)
ans = 'Yes'
c = 0
for a in Asort:
    if a < sum(Asort)*(1/(4*M)):
        ans = 'No'
    c += 1
    if c == M:
        break
print(ans)

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N, M = map(int, input().split())
A = [int(x) for x in input().split()]
A.sort(reverse=True)
sum_A = sum(A)

ans = "Yes"
for i in range(M):
    if A[i] < sum_A / (4 * M):
        ans = "No"
        break

print(ans)

Submission status: Accepted

Solution code:
def resolve():
    n,m=map(int, input().split())
    l=list(map(int, input().split()))
    sou=sum(l)
    cnt=0
    l.sort(reverse=True)
    if l[m-1]>=sou*1/(4*m):
        print('Yes')
    else:
        print('No')
resolve()

Submission status: Accepted

Solution code:
# from scipy.sparse import csr_matrix
# import string
import sys

sys.setrecursionlimit(10 ** 5 + 10)


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


def resolve():
    N, M = map(int, input().split())
    A = sorted(list(map(int, input().split())), reverse=True)
    val = 1 / (4 * M)
    cnt = 0
    i = 0
    while True:
        if i < N:
            if A[i]/sum(A) >= val:
                cnt += 1
                i += 1
            else:
                break
        else:
            break
    if cnt >= M:
        print('Yes')
    else:
        print('No')


resolve()

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
def resolve():
    n,m=map(int, input().split())
    l=list(map(int, input().split()))
    sou=sum(l)
    cnt=0
    l.sort(reverse=True)
    for i in range(n):
        if l[i]>=sou*1/(4*m):
            cnt+=1
    if cnt>=m:
        print('Yes')
    else:
        print('No')
resolve()

Submission status: Accepted

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

a_list = list(map(int, input().split()))
w_a_list = sorted(a_list, reverse=True)

a_max = sum(a_list)
a_judge = a_max / (4*M)

disp_enable = True
for i in range(M):
	if(w_a_list[i] < a_judge):
		disp_enable = False

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

Submission status: Accepted

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

total=0
for i in range(N):
    total+=A[i]

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

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

Submission status: Accepted

Solution code:
num = input().split()
type = int(num[0])
target = int(num[1])
list = input().split()
listnum = []
for i in list:
  listnum.append(int(i))

count = 0
sum = 0
for i in listnum:
  sum += i

for i in listnum:
  if i >= sum/(4*target):
    count += 1

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

Submission status: Accepted

Solution code:

def main():
  n, m = map(int, input().split())
  arr = tuple(map(int, input().split()))

  threshold = sum(arr) / (4 * m)

  ans = "Yes" if len(tuple(filter(lambda a: a >= threshold, arr))) >= m else "No"

  print(ans)

main()

Submission status: Accepted

Solution code:
import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

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

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

sum = sum(A)
ct = 0
for a in A:
    if sum * (1/(4*M)) <= a:
        ct += 1

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

Submission status: Accepted

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

#############
# Libraries #
#############

import sys
input = sys.stdin.readline

import math
from collections import deque
from fractions import gcd
from functools import lru_cache


#############
# Constants #
#############

MOD = 10**9+7
INF = float('inf')

#############
# Functions #
#############

######INPUT######
def inputI(): return int(input().strip())
def inputS(): return input().strip()
def inputIL(): return list(map(int,input().split()))
def inputSL(): return list(map(str,input().split()))
def inputILs(n): return list(int(input()) for _ in range(n))
def inputSLs(n): return list(input().strip() for _ in range(n))
def inputILL(n): return [list(map(int, input().split())) for _ in range(n)]
def inputSLL(n): return [list(map(str, input().split())) for _ in range(n)]

#####Inverse#####
def inv(n): return pow(n, MOD-2, MOD)

######Combination######
kaijo_memo = []
def kaijo(n):
  if(len(kaijo_memo) > n):
    return kaijo_memo[n]
  if(len(kaijo_memo) == 0):
    kaijo_memo.append(1)
  while(len(kaijo_memo) <= n):
    kaijo_memo.append(kaijo_memo[-1] * len(kaijo_memo) % MOD)
  return kaijo_memo[n]

gyaku_kaijo_memo = []
def gyaku_kaijo(n):
  if(len(gyaku_kaijo_memo) > n):
    return gyaku_kaijo_memo[n]
  if(len(gyaku_kaijo_memo) == 0):
    gyaku_kaijo_memo.append(1)
  while(len(gyaku_kaijo_memo) <= n):
    gyaku_kaijo_memo.append(gyaku_kaijo_memo[-1] * pow(len(gyaku_kaijo_memo),MOD-2,MOD) % MOD)
  return gyaku_kaijo_memo[n]

def nCr(n,r):
  if(n == r):
    return 1
  if(n < r or r < 0):
    return 0
  ret = 1
  ret = ret * kaijo(n) % MOD
  ret = ret * gyaku_kaijo(r) % MOD
  ret = ret * gyaku_kaijo(n-r) % MOD
  return ret

######Factorization######
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])
    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])
    return arr

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

#############
# Main Code #
#############

N,M = inputIL()
l = inputIL()

s = sum(l)

count = 0
for i in l:
  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())
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:
from fractions import Fraction

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

total = sum(A)
flg = total * Fraction(1, (4 * m))
ans = 'No'

for i in range(m):
    if A[i] < flg:
        ans = 'No'
        break
    else:
        ans = 'Yes'

print(ans)

Submission status: Accepted

Solution code:
if __name__ == '__main__':
    nums=list(map(int,input().split(" ")))
    votes=list(map(int,input().split(" ")))
    total=0
    n=0
    for i in votes:
        total+=i
    for i in votes:
        if(i>=total/(4*nums[1])):
            n+=1
    if n>=nums[1]:
        print("Yes")
    else:print("No")

Submission status: Accepted

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

Submission status: Accepted

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

sum_a = sum(a_list)
cnt = 0

for a in a_list:
    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())
vote = list(map(int, input().split()))

vote.sort(reverse=True)
popular = vote[0:m]
sum = sum(vote)

yes = True

for win in popular:
    if win < sum / (4*m):
        print('No')
        yes = False
        break


if yes:
    print('Yes')

Submission status: Accepted

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

total = sum(a_list)
count = 0
for i in range(m):
    vote = a_list[i]
    if vote*m*4 >= total:
        count += 1

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

Submission status: Accepted

Solution code:
N, M = map(int, input().split())
vote_nums = sorted([float(i) for i in input().split()], reverse=True)
 
border_rate = 1 / (4 * M)
target = vote_nums[:M]
 
for vote_num in target:
  if vote_num < border_rate * sum(vote_nums):
    print('No')
    exit()
 
print('Yes')

Submission status: Accepted

Solution code:
N, M = map(int, input().split())
vote_nums = sorted([float(i) for i in input().split()], reverse=True)

border_rate = 1 / (4 * M)
target = vote_nums[:M]

for vote_num in target:
  if vote_num < border_rate * sum(vote_nums):
    print('No')
    exit()

print('Yes')

Submission status: Accepted

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

cnt_yes = 0
for i in range(M):
    A.sort(reverse=True)
    # print(A[i], sum(A) / (4*M))
    if A[i] >= (sum(A) / (4*M)):
        cnt_yes += 1
        
if cnt_yes < M:
    print("No")
else:
    print("Yes")

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n,m=[int(i) for i in input().split()]
list=[int(i) for i in input().split()]
x=1/(4*m)
y=sum(list)
count=0
for i in range(1,n+1):
  if list[i-1]>=x*y:
    count+=1

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