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()))
c = 0
s = sum(A)
for a in A:
  if a * 4 * M >= s:
    c += 1
if c >= 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)

ans = len([a for a in A if a * 4 * M >= s])

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

Submission status: Accepted

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

ans = 0
for a in A:
  if a * 4 * M >= s:
    ans += 1

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

Submission status: Accepted

Solution code:
nums = list(map(int,input().split()))
N = nums[0]
M = nums[1]
numss = list(map(int,input().split()))
cnt = M
summ = sum(numss)
for num in numss:
  if num >= summ/(M*4):
    cnt -= 1
if cnt > 0:
  print("No")
else:
  print("Yes")

Submission status: Accepted

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

add = sum(ar)
check = add / (4 * m)
amt = 0

for num in ar:
    if num >= check:
        amt += 1

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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
#print(t)
if t >= 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()))
    sum = 0
    for i in range(N):
        sum += A[i]

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

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

main()

Submission status: Accepted

Solution code:
r=input().split()
N=int(r[0])
M=int(r[1])
d_pre=input().split()
d=[int(s) for s in d_pre]
x=sum(d)
ans=0
for i in range(N):
    if d[i]>=x/(4*M):
        ans+=1
if ans>=M:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
N, M = list(map(int,input('').split(' ')))
A = sorted(list(map(int,input('').split(' '))), reverse=True)
pts = sum(A)
if A[M-1]>=(pts/(4*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(sorted(list(map(int,input('').split(' '))), reverse=True))
pts = np.sum(A)
if A[M-1]>=(pts/(4*M)):
  print('Yes')
else:
  print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def resolve():
    N, M = list(map(int, input().split()))
    A = sorted(list(map(int, input().split())), reverse=True)
    total = sum(A)
    choose = 0
    th = total/(4*M)
    for a in A:
        if a < th:
            continue
        choose += 1
    print("Yes" if choose >= M else "No")



if '__main__' == __name__:
    resolve()

Submission status: Accepted

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

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

ans = True
for i in range(M):
    if A[i] < limit:
        ans = False
        break
if ans:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

print('Yes' if len(list(filter(lambda x : x >= s * (1/(4*m)), a))) >= m else 'No')

Submission status: Accepted

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

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

boarder = sum /(4 * M)
count = 0
for i in range(N):
	if A[i] >= boarder:
		count = count + 1
if M <= count:
	print("Yes")
else:
	print("No")

Submission status: Accepted

Solution code:
import math

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

cnt = 0
A_sum = sum(A_list)

for i in range(N):
    if A_list[i] >= math.ceil(A_sum/4/M):
        cnt += 1
if cnt >= M:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
n, m = map(int,input().split())
lst = list(map(int,input().split()))
lst.sort()
lst.reverse()
x = sum(lst)
if (lst[m - 1] < x/4/m):
  print("No")
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()))
a.sort(reverse = True)
sm = sum(a)
for i in range(M):
  if a[i] < sm / 4 / M:
    print("No")
    break
else: print("Yes")

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!

N,M=map(int,input().split())
A=list(map(int,input().split()))
A.sort(reverse=True)
sum_A=sum(A)
count=0
for i in range(M):
    if A[i]/sum_A>=1/(4*M):
        count+=1

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

Submission status: Accepted

Solution code:
n, m = map(int, input().split())
L = list(map(int, input().split()))
a = 0
for i in range(len(L)):
  a = a + L[i] 
a = a / (4*m) 
nL = sorted(L, reverse=True)
if a <= nL[m-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
a.sort(reverse=True)
ALL=0

for i in a:
    ALL+=i


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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import bisect, collections, copy, heapq, itertools, math, string
import sys
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return map(int, sys.stdin.readline().rstrip().split())
def LI(): return list(map(int, sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())


def main():
    N, M = MI()
    A = LI()
    a = sum(A) / (4 * M)
    A.sort()
    cnt = bisect.bisect_left(A, a)
    if N - cnt >= M:
        print('Yes')
    else:
        print('No')
if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10**9)

def mi(): return map(int,input().split())
def ii(): return int(input())
def isp(): return input().split()
def deb(text): print("-------\n{}\n-------".format(text))

INF=10**20
def main():
    N,M=mi()
    A=list(mi())

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



if __name__ == "__main__":
    main()

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('No')
else:
  print('Yes')

Submission status: Accepted

Solution code:
n,m = map(int, input().split())
l = list(map(int, input().split()))
c = 0
for index in l:
  if index >= sum(l)/(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()))
num=0
for i in A:
    if i >= sum(A)/(4*M):
        num += 1
if M <= num:
    print('Yes')
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())))
print("Yes" if np.sum(A >= np.sum(A)/(4*m)) >= 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)
x = sum(a)
if a[m-1]<(x/(4*m)):
  print("No")
else:
  print("Yes")

Submission status: Accepted

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

Submission status: Accepted

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

cnt = 0
s = 0

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

for i in range(N):
    if 4*M*A[i] < s:
        cnt += 1

print(['No', 'Yes'][N - cnt >= M])

Submission status: Accepted

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

k = sum(A) / (4*M)
print('Yes' if [a >= k for a in A].count(True) >= M else 'No')

Submission status: Accepted

Solution code:
n, m = map(int, input().split())
a = list(map(int, input().split()))
num = sum(a)
cnt = 0
for i in range(n):
    if a[i] < num/(4*m):
        continue
    else:
        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()))
lim = sum(A)/(4*M)
ans = 0

for a in A:
  if a>=lim:
    ans+=1
    
if ans>=M:
  print("Yes")
else:
  print("No")

Submission status: Accepted

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 - 1] >= x else "No")

Submission status: Accepted

Solution code:
# coding: utf-8
def main():
    n, m = map(int, input().split())
    A_array = list(map(int, input().split()))
    
    tmp_A_array = [x for x in A_array if x >= sum(A_array)/(4*m)]
    
    # print(sum(A_array)/(4*m), tmp_A_array, m, sep="\n")
    if len(tmp_A_array) >= m:
        print("Yes")
    else:
        print("No")
    
main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from decimal import Decimal

n,m = map(int, input().split())
A = list(map(int, input().split()))
line = Decimal(sum(A) / (4 * m))
cnt = 0
for a in A:
    if a >= line:
        cnt += 1
    if cnt >= m:
        print('Yes')
        break
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)
needed = s/4/m if s%(4*m) == 0 else s//(4*m)+1

for i in range(m):
    if a[i] < needed:
        print("No")
        break
else:
    print("Yes")

Submission status: Accepted

Solution code:
n, m = map(int, input().split())
a = sorted(map(int, input().split()), reverse = True)
total = sum(a)
cnt = 0
for i in a:
  if i * 4 * m >= total:
    cnt += 1
  else:
    break
if cnt >= m:
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
def main():
    N, M = map(int, input().split())
    A = sorted([int(x) for x in input().split()], reverse=True)

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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
from decimal import Decimal
n,m = map(int,input().split())
A = list(map(int,input().split()))
border = float(sum(A)/(4*m))
border2 = str(border)
border3 = Decimal(border2)
ans = 0
judge = 0
for i in range(n):
  if A[i] >= border3:
    ans+=1
if ans >= m:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
from decimal import Decimal
n,m = map(int,input().split())
A = list(map(int,input().split()))
border = float(sum(A)*(1/(4*m)))
border2 = str(border)
border3 = Decimal(border2)
ans = 0
judge = 0
for i in range(n):
  if A[i] >= border3:
    ans+=1
if ans >= m:
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def solve():
    N,M = [int(i) for i in input().split()]
    A = [int(i) for i in input().split()]
    total = sum(A)
    threshold = float(total) / (4*M)
    cnt = 0
    for num in A:
        if num >= threshold:
            cnt += 1
    if cnt >= M:
        print("Yes")
    else:
        print("No")

if __name__ == "__main__":
    solve()

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# Popular Vote
N, M = map(int, input().split())
A = list(map(int, input().split()))
total = sum(A)
ans = 0
for a in A:
    if a >= total/(4*M):
        ans += 1
print(['No','Yes'][ans >= M])

Submission status: Accepted

Solution code:
n,m=map(int, input().split())
c = 1 / (4*m)
ans = 0
l = [int(x) for x in input().split()]
l.sort(reverse=True)

for i in range(m):
    if l[i] < sum(l)*c:
        print("No")
        ans += 1
        break

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

Submission status: Accepted

Solution code:
import numpy as np
p,q= input().split()
a,b =(int(p), int(q))
ans_list = input().split()
ans_list =np.array(ans_list).astype(float)
#print(ans_list)
ans_list=np.sort(ans_list)[::-1]
#print(ans_list)
if ans_list[b-1] >= sum(ans_list)/4/b:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

if len([i for i in a if i >= 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()))
     
limit=sum(a)/(4*m)
c=0
for aa in a:
  if aa >=limit:
    c+=1
  else:
    pass
if c>=m:
  print('Yes')
else:
  print('No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

i = 0
s = 0
sum = sum(a)

for i in range(n):
    if a[i]/sum >= 1/(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_sum=sum(a)
count=0
for i in a:
    if i>=a_sum/(4*m):
        count+=1
if count>=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()))
    total = sum(A)
    threshold = total / (4*M)
    count = sum([a>=threshold for a in A])
    if count >= 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)
c = 0
for i,k in enumerate(l):
    if k >= S/(4*M):
        c += 1
if c >= M:print('Yes')
else:print('No')

Submission status: Accepted

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

Submission status: Accepted

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

for i in a:
  if i *4*m>=s: cnt +=1
  if cnt >= m:
    print("Yes")
    break
  
else:
  print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# ABC161
# B Popular Vote
N, M = map(int, input().split())  # N種類　M個選ぶ
a = sorted(list(map(int, input().split())),reverse=True)
x = sum(a)
q = x / (4 * M)
b =[]
for i in range(M):
    b.append(a[i])
b = sorted(b)
for j in b:
    if j < q:
        print('No')
        exit()
print('Yes')

Submission status: Accepted

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

ans = 0
for i in a:
    if(i >= s/(4*m)):
        ans+=1
if(ans >= m):print("Yes")
else:print("No")

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
NN = input().split()
N = int(NN[0])
M = int(NN[1])
AA = input().split()
total1 = 0
total2 = 0
for i in AA:
  total1 += int(i)
for i in AA:
  if float(i) >= total1/(4*M):
    total2 +=1
if total2 >= M:
  print('Yes')
else:
  print('No')

Submission status: Accepted

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

Submission status: Accepted

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

Alst.sort(reverse = True)
k = sum(Alst) / M
if Alst[M-1] < k/4:
    print('No')
else:
    print('Yes')

Submission status: Accepted

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

allvote=0
allvote=sum(A)
# print( allvote )

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

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

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)]
print("Yes" if len(B)>=M else "No")

Submission status: Accepted

Solution code:
n ,m = map(int, input().split())
a = list(map(int,input().split()))
ans = 0
refer = sum(a) / (4*m)

for ni in range(n):
    if a[ni] >= refer:
        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()
A.reverse()
if A[M - 1] * 4 * M < sum(A):
    print("No")
else:
    print("Yes")

Submission status: Accepted

Solution code:
N, M = map(int, input().split())
A = list(map(int,input().split()))
A.sort()
total=sum(A)
i=0
flg="Yes"
while i < M:
    if A.pop() < total/(4*M):
        flg="No"
        break
    i += 1
print(flg)

Submission status: Accepted

Solution code:
N, M = list(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:
n,m = map(int,input().split())
a = list(map(int,input().split()))
a.sort()

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

Submission status: Accepted

Solution code:
word = list(map(int,input().split()))
score = list(map(int,input().split()))
score.sort()
score.reverse()
gokei = 0
for i in range(word[0]):
    gokei += score[i]
if score[word[1]-1]*4*word[1] >= gokei:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

cnt = 0

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

sumA = sum(A)

ans = 0
for a in A:
  if 4 * a * m >= sumA:
    ans += 1
    
if ans >= m:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)

N, M = mapint()
As = list(mapint())

cnt = 0
ALL = sum(As)
for a in As:
    if 4*M*a>=ALL:
        cnt += 1

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

Submission status: Accepted

Solution code:
N,M,*A = map(int, open(0).read().split())
A.sort()
if A[-M]*4*M >= sum(A):
    print('Yes')
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())))
A.sort()
A = A[::-1] / A.sum()
# print(f'{A=}')

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

Submission status: Accepted

Solution code:
import sys
import math

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

s = sum(a)
a.sort(reverse=True)
border = s / (4 * m)

ans = True

for i in range(m):
    if (a[i] >= border):
        pass
    else:
        ans = False
        break

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

Submission status: Accepted

Solution code:
def main():
    n,m = map(int, input().split())
    a = sorted(list(map(int, input().split())),reverse = True)
    all = sum(a)
    cnt = 0
    for i in(a):
        if(i * 4 * m >= all and cnt < m):
            cnt += 1
    if cnt >= m:
        print('Yes')
    else:
        print('No')
main()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# coding: utf-8
# hello worldと表示する
#float型を許すな
#numpyはpythonで
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
from collections import Counter, deque
from collections import defaultdict
from itertools import combinations, permutations, accumulate, groupby, product
from bisect import bisect_left,bisect_right
from heapq import heapify, heappop, heappush
from math import floor, ceil,pi,factorial
from operator import itemgetter
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def LI2(): return [int(input()) for i in range(n)]
def MXI(): return [[LI()]for i in range(n)]
def SI(): return input().rstrip()
def printns(x): print('\n'.join(x))
def printni(x): print('\n'.join(list(map(str,x))))
inf = 10**17
mod = 10**9 + 7

n,m=MI()
lis=LI()
count=0
lis.sort(reverse=True)
total=sum(lis)
for i in range(n):
    if lis[i]*4*m>=total:
        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()))

D = sum(A)
cnt = 0
for i in range(N):
    if A[i] * 4 * M >= D:
        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) / (4 * m)
ans = 0
for aa in a:
    if aa >= s:
        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)
flg = True
for i in range(m):
    if a[i] * 4 * m < total:
        flg = False
        
print('Yes') if flg else print('No')

Submission status: Accepted

Solution code:
N, M = map(int, input().split(' '))
A_ls = list(map(int, input().split(' ')))
A_ls = [i for i in A_ls if i >=  sum(A_ls)  / (4 * M)]

if len(A_ls) >= 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)

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

Submission status: Accepted

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

    A.sort(reverse=True)

    tot = sum(A)

    cond = A[M - 1] * 4 * M >= tot

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

A.sort(reverse=True)
A_list = A[:M]

vote_sum = sum(A)
ans = 0

for i in A_list:
    if i/vote_sum < 1/(4*M):
        print("No")
        break
    else:
        ans +=1
if ans == M:
    print("Yes")