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()))
count =0
s = sum(A)
m = s/(4*M)
for i in range(N):
  if A[i] >= m:
    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())), reverse=True)
threshold = sum(A) / (4 * M)

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

Submission status: Accepted

Solution code:
N, M = list(map(int, input().split()))
A = list(map(int, input().split()))
kijun = sum(A)/(4*M)
cnt = 0

for x in A:
    if x >= kijun:
        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()))
g = (sum(A) / (4*M))
count = 0
for i in range(N):
    if A[i] >= g:
        count += 1
if count >= M:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

kind,num = map(int, input().split())
num_list = list(map(int, input().split()))

sum_v = sum(num_list)

thresh = sum_v/(4*num)
cnt = 0
for n in num_list:
    if n >= thresh:
        cnt = cnt+1
#print(cnt)
if cnt >= num:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
import sys
stdin = sys.stdin

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

N,M=nm()
A=nl()
A.sort()
A.reverse()
th=sum(A)/M/4
flag=True
for i in range(M):
    if(A[i]<th):
        flag=False

print('Yes' if flag==True else 'No' )

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import numpy as np

def main():
    n, m = map(int,input().split())
    a = list(map(int,input().split()))
    lim = np.sum(a)/(4*m)
    k=0
    for i in a:
        if i>=lim:
            k+=1
    if k>=m:
        print("Yes")
    else:
        print("No")
if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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


a = get()
b = get()
count = 0
ball = sum(b) / (4 * a[1])
for i in b:
    if i >= ball:
        count += 1
if count >= a[1]:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

i=0
s=0

while(i<N):
  s+=list[i]
  i+=1

m=s/(4*M)

list.sort(reverse=True)

r="Yes"
j=0

while(j<M):
  if(list[j]<m):
    r="No"
  j+=1
print(r)

Submission status: Accepted

Solution code:
N, M = map(int, input().split(' '))
A = [int(a) for a in input().split(' ')]
S = sum(A)
thre = S / (4 * M)

cnt = 0
for a in A:
    if a >= thre:
        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)
count = 0
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())
a = list(map(int,input().split()))
a.sort()
a.reverse()
s = sum(a)
flag = True

for i,j in enumerate(a):
    if i+1 > m:
        break
    if j < s/(4*m):
        flag = False
        break
if flag:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
n, m = tuple(map(int, input().split()))
nums = list(map(int, input().split()))
sorted_votes = sorted(nums, reverse=True)
if sorted_votes[m-1] < sum(nums)/(4*m):
    print('No')
else:
    print('Yes')

Submission status: Accepted

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

total = sum(a)
threshold = total / 4 / m

num_over = 0
done = False
for i in a:
    if i >= threshold:
        num_over = num_over + 1
    if num_over == m:
        print('Yes')
        done = True
        break

if not done:
    print('No')

Submission status: Accepted

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

flg = 0

b = sorted(a, reverse=True)

for i in range(m):
    x = sum(b) / (4 * m)
    if b[i] < x:
        flg = 1
    
if flg == 1:
    print("No")
else:
    print("Yes")

Submission status: Accepted

Solution code:
n,m = map(int,input().split(' '))
aa = list(map(int, input().split(' ')))
A = sorted(aa, reverse=True)
Am = A[:m]
for a in Am:
    if a>=(0.25/m)*sum(aa): continue
    else:
         print('No')
         exit(0)
print('Yes')

Submission status: Accepted

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

Submission status: Accepted

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

for i in List:
    if i>=total/m/4:
        count=count+1
    else:
        count=count+0

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

Submission status: Accepted

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

count = 0

get = sum(list_N)/(4*M)

for i in range(N):
    if list_N[i] >= get:
        count += 1

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

Submission status: Accepted

Solution code:
from fractions import Fraction
n, m = map(int,input().split())

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

s = sum(li)

pm = Fraction(1, 4*m)
sp = float(pm)

ans = []
for i in range(n):
    if (s * sp) <= li[i]:
        ans.append(li[i])
        
if (len(ans)>= m):
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
n, m = list(map(int, input().split()))
nums = list(map(int, input().split()))
f = 4 * m
for n in nums:
    if n >= sum(nums) / f:
        m -= 1
    if m == 0:
        break
print('Yes'if m == 0 else 'No')

Submission status: Accepted

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

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

th = 1.0 * sum(A) / (4 * M)

sorted_A = sorted(A, key=lambda x: -x)
if sorted_A[M - 1] < th:
    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)
count = 0
sumA = 0
for i in range(len(A)):
    sumA += A[i]
for i in range(len(A)):
    if A[i] >= sumA*(1/(4*M)):
        count += 1
if count >= M:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

tot = sum(Ai)
thre = tot/(4*M)

flag = 1
for i in range(M):
  if(Ai[i]<thre):
    flag=0
    break;

if(flag):
  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()))

result = True
sum = 0
a.sort(reverse=True)

for i in range(n):
    sum += a[i]

threshould = sum / 4 / m

for i in range(m):

    if a[i] < threshould:
        result = False
if result:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
line = input().split(" ")
syurui = int(line[0])
itemCnt = int(line[1])

line2 = input().split(" ")
line2 = list(map(int,line2))
line2.sort(reverse=True)
okFlg = True;

for i in range(itemCnt):
  if line2[i] < 1 / (4 * itemCnt) * sum(line2):
    okFlg = False;
  
if okFlg:
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

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

stl = sum(a) / (4*m)
cnt = 0
for i in a:
    if i >= stl:
        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()))

B = A[:M]
sumA = sum(A)
check = 4*M
checkA=0
A = sorted(A ,reverse=True)

i = 0
while i<len(B):
    if A[i]>= (sumA/check):
        checkA+=0
    else:
        checkA+=1
    
    i+=1

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

Submission status: Accepted

Solution code:
from math import ceil
n,m = map(int,input().split())
l = list(map(int,input().split()))
l.sort(reverse=True)
val = sum(l)
f = 1
for i in range(m):
  if l[i] < ceil(val/(4*m)):
    f = 0
    break
if f:
  print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N,M = map(int,input().split())
A = list(map(int,input().split()))
S1 = sorted(A,reverse=True)
S2 = S1[0:M]
sum = sum(A)
ans = 'Yes'
for i in range(1,M+1):
    if S2[-1*i] >= sum/(4*M):
        continue
    else:
        ans = 'No'
        break
print(ans)

Submission status: Accepted

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

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

total = sum(line)

sikii = total / 4 /m

cnt = 0


for i in line:
    if i >= sikii:
        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 = [int(i) for i in input().split()]
B = [0]*N

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N,M=map(int,input().split())
A=list(map(int,input().split()))
ans='No'
sum=0
b=1/(4*M)
c=0
for i in range(N):
  c+=A[i]
d=c*b
for i in range(N):
  if d<=A[i]:
    sum=sum+1
  if sum==M:
    ans='Yes'
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
# from fractions import gcd
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from functools import reduce
from bisect import bisect_left, insort_left
from heapq import heapify, heappush, heappop

INPUT = lambda: sys.stdin.readline().rstrip()
INT = lambda: int(INPUT())
MAP = lambda: map(int, INPUT().split())
S_MAP = lambda: map(str, INPUT().split())
LIST = lambda: list(map(int, INPUT().split()))
S_LIST = lambda: list(map(str, INPUT().split()))
ZIP = lambda: zip(*(MAP() for _ in range(n)))

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


def main():
    N, M = MAP()
    A = LIST()

    W = sum(A)
    A = sorted(A, reverse=True)

    for i in range(M):
        if A[i] < W / (4*M):
            print("No")
            sys.exit()

    print("Yes")


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N_M = list(map(int, input().split()))
items = list(map(int, input().split()))
total = sum(items)
match_items = []
for item in items:
    if item >= (total/4 / N_M[1]):
        match_items.append(item)
print('Yes') if N_M[1] <= len(match_items) 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)
count=0
for i in a:
    if(i>=t):
        count+=1
        if(count>=m):
            print('Yes')
            exit()
        else:
            continue
    else:
        continue
print('No')

Submission status: Accepted

Solution code:
N,M=map(int,input().split())
A=sorted(list(map(int,input().split())),reverse=True)
print('YNeos'[M!=sum(map(lambda x: 0 if x<sum(A)*(1/(4*M)) else 1,A[:M]))::2])

Submission status: Accepted

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

data.sort(reverse=True)
total = sum(data)

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

Submission status: Accepted

Solution code:
n, m = list(map(int, input().split()))
l = list(map(int, input().split()))
total = sum(l)
ctr=0
for x in l:
    if x>=total/(4*m):
        ctr+=1
if ctr>=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,reverse=True)
M=4*m
s=sum(a)
count=0

for i in range(n):
  if a[i]<s/M:
    a[i]=0

for i in range(m):
  if a[i]!=0:
    count+=1

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n,m=map(int, input().split())
A=list(map(int, input().split()))
A.sort()
t=0
#print(A)
for i in range(n):
    t+=A[i]
l=0
#print(t)
g=t*(1/(4*m))
#print(g)
c=0
for i in range(m):
    l=A.pop()
    #print(l)
    if l<g:
        c+=1
    else:
        c+=0
    #print(c)
if c==0:
    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)
b = 0
c = len(A)
for i in range(c):
    if A[i] >= S/(4*M):
        b += 1

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

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
l1=list(map(int,input().split()))

l2=list(sorted(l1,reverse=True))
suml=sum(l2)
#print(l2[1])

if suml<=4*b*l2[b-1]:
    #print(suml)
    #print(4*b*l2[b-1])

    print("Yes")
else:
    #print(suml)
    #print(4*b*l2[b-1])
    print("No")

Submission status: Accepted

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

ans = []
for i in range(m) :
  if a[i] < sum(a) / (4 * m) :
    continue
  else :
    ans.append(a[-1])

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

Submission status: Accepted

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


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

    cnt = 0

    for a in A:
        if a < sum(A) / (4 * M):
            continue
        else:
            cnt += 1
    print("Yes"if cnt >= M else "No")


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
i = list(map(int, input().split()))
N = i[0]
M = i[1]
A = list(map(int, input().split()))
A_A = A.copy()
A_A.sort(reverse=True)
count = 0

total = sum(A)
touhyousuu = 1 / (4 * M)
wari = total * touhyousuu

for j in range(M):
    if A_A[j] < wari:
        count += 1


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

Submission status: Accepted

Solution code:
n, m = map(int, input().split())
a = list(map(int, input().split()))
t = sum(a)
c = 0
for i in a:
    if t <= i*(4*m):
        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()))

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

if j >= 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, reverse=True)
sumA = sum(A)
K = sumA / (4 * M)
if A[M-1] >= K:
  print('Yes')
else:
  print('No')

Submission status: Accepted

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

for i in range(M):
  if votes[i] < sum(votes) / (4 * M):
    print("No")
    exit()

print("Yes")

Submission status: Accepted

Solution code:
import heapq

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


a1 = list(map(lambda x: x*(-1), a))  # 各要素を-1倍
heapq.heapify(a1)

flg=0
for i in range(m):
    tmp = -1*(heapq.heappop(a1))
    if(tmp*m*4 >= all):
        continue
    else:
        flg=1
        break
if(flg==0):
    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)
y = m - 1
x = b[y]
z = 4 * m
z *= x
if z >= sum(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)
if a[m-1] / sum(a) < 1 / (4 * m):
  print('No')
else:
  print('Yes')

Submission status: Accepted

Solution code:
i = list(map(int, input().split()))
j = list(map(int, input().split()))
j.sort(reverse=True)
if sum(j)>j[i[1]-1]*4*i[1]:
    print('No')
else:
    print('Yes')

Submission status: Accepted

Solution code:
n,m=map(int,input().split())
a=[int(ss) for ss in input().split()]
a=sorted(a,reverse=True)
r="Yes"
for ii in range(m):
  if a[ii]<sum(a)/(4*m):
    r="No"
    break
print(r)

Submission status: Accepted

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

## 
num_sum = sum(num)
thresh = num_sum / (4 * M)
#print(thresh)

i = 0 
for x in num:
  if float(x) >= thresh:
    #print(float(x))
    i += 1

if i >= 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)
a=[]
for i in l:
    if i>=(s/(4*m)):

        a.append(1)
print('Yes' if len(a) >=m else 'No')

Submission status: Accepted

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

e = sum(a)
f = e/4/m
c = 0
a.sort()

for i in range (n):
    if a[i] >= f:
        c = c + 1
    else:
        c = c

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

Submission status: Accepted

Solution code:
f=lambda:map(int,input().split())
_,m=f()
l=sorted(list(f()))
print(['No','Yes'][l[-m]*4*m>=sum(l)])

Submission status: Accepted

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

a_sum = sum(a)

thr = a_sum/(4*m)
cnt = 0
for i in a:
    if i >= thr:
        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, reverse=True)
sum_a = sum(a)

if sum_a * 1 / (4 * m) > a[m - 1]:
    print('No')
else:
    print('Yes')

Submission status: Accepted

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

for i in range(m):
    if a[i]*(4*m) < t:
        print('No')
        exit(0)
print('Yes')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N,M=map(int,input().split())
A=list(map(int,input().split()))
number=0
soutoku=sum(A)
for i in A:
	if i>=soutoku*(1/(4*M)):
		number+=1
if number>=M:
	print('Yes')
else:
	print('No')

Submission status: Accepted

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

b = [i for i in a if 4*i*m >= sa]

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

Submission status: Accepted

Solution code:
N,M = map(int,input().split(' '))
An = list(map(int,input().split(' ')))
An.sort(reverse=True)
sum_num = sum(An)
for i in range(M):
    if An[i] < sum_num/(4*M):
        print('No')
        exit(0)
print('Yes')

Submission status: Accepted

Solution code:
N,M = [int(e) for e in input().split(' ')]
As = [int(e) for e in input().split(' ')]

cnt=0 
epsilon=sum(As)/(4*M)

for Ai in As:
    if Ai >= epsilon:
        cnt += 1

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()))
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())
A = list(map(int, input().split())) 
 
all = sum(list(A))
p = 1/(4*M)*all
cnt = 0
 
for i in A:
  if i >= p:
    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()))
count=0
c = sum(l)/(4*m)
for i in l:
    if i>=c:
        count+=1
if count>=m:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
N,M = map(int,input().split())
count= 0
a = [int(i) for i in input().split()]
a_new = sorted(a,reverse=True)
for i in range(M):
    if a_new[i] >= (sum(a)*(1/(4*M))):
        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()))
allA = sum(A)
A.sort(reverse=True)
ans = "Yes"
for i in range(m):
    a = A[i]
    div = allA/(4*m)
    if a < div:
        ans = "No"
        break
print(ans)

Submission status: Accepted

Solution code:
n,m=map(int,input().split())
A=input().split()
AA=[]
for i in range(len(A)):
    AA.append(int(A[i]))

s=sum(AA)

c=0
for i in range(len(AA)):
    if AA[i]>=s/(4*m):
        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()))
list = sorted(a, reverse=True)
total = 0
for i in range(n):
    total += a[i]
for i in range(m):
    if list[i] < total * (1 / (4 * m)):
        print('No')
        exit()
print('Yes')

Submission status: Accepted

Solution code:
N, M = map(int, input().split())
lis_A = list(map(int, input().split()))
bd = sum(lis_A)/(4*M)
n_above_bd = sum(map(lambda x: x >= bd, lis_A))
if n_above_bd >= 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)
#print(a)
ad=sum(a)
#print(ad)
ad=ad/(4*m)
#print(ad)

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

Submission status: Accepted

Solution code:
N, M = map(int, input().split())
a_list = list(map(int, input().split()))
sorted_a_list = sorted(a_list, reverse=True)
border_num = sorted_a_list[M-1]

if border_num >= sum(a_list) /(4*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()]

ok = False
cnt = m
t = sum(a)
for i in range(n):
	if a[i] * 4 * m >= t:
		cnt -= 1
	if cnt == 0:
		ok = True
		break
		
if ok:
	print("Yes")
else:
	print("No")

Submission status: Accepted

Solution code:


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

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

totalvote = sum(votes)
threshold = totalvote * (1 / (4*m))


votes.sort(reverse=True)


if votes[m-1] < threshold:
    print('No')
else:
    print('Yes')

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
data = input().split()

count = int(data[0])
popular = int(data[1])

datas = input().split()

vote_total = 0

for vote in datas:
    vote_total += int(vote)
    
popular_count = 0

for vote in datas:
    if int(vote) >= vote_total / (4 * popular):
        popular_count += 1

if popular_count >= popular:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
def main():
    from builtins import int, map, list, print
    import sys
    sys.setrecursionlimit(10 ** 6)

    input = sys.stdin.readline
    input_list = (lambda: input().rstrip().split())
    input_number = (lambda: int(input()))
    input_number_list = (lambda: list(map(int, input_list())))

    N, M = input_number_list()
    A = input_number_list()
    total = sum(A)
    cnt = 0
    for a in A:
        if a >= total / (4 * M):
            cnt += 1
    print('YNeos'[cnt < M::2])

if __name__ == '__main__':
    main()

Submission status: Accepted

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

th = sum(A)*0.25/M

A.sort(reverse=True)

if A[M-1] >= th:
    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,reverse=True)
res='Yes'
if A[M-1]<sum(A)*(1/(4*M)):
    res='No'
print(res)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
li = list(map(int, input().split()))
n = li[0]
m = li[1]
k = list(map(int, input().split()))

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

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

Submission status: Accepted

Solution code:
N,M =map(int,input().split())
vote_list = list(map(int,input().split()))
                 
total=sum(vote_list)
popular_list = list(filter(lambda x: x>=total/(4*M),vote_list ))

if(len(popular_list)<M):
    print("No")
else:
    print("Yes")

Submission status: Accepted

Solution code:
N, M = input().split()
N = int(N)
M = int(M)
numbers = input().split()
numbers = [int(n) for n in numbers]
thresh = sum(numbers)/(4*M)
selected = list(filter(lambda x: x >= thresh, numbers))
if len(selected) >= 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)
b = []
for i in range(n):
    if a[i]*4*m >= s:
        b.append(a[i])
if len(b) < m:
    print("No")
else:
    print("Yes")

Submission status: Accepted

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


def main(n, m, a):
    # print(n,m,a)
    x = [new_a for new_a in a if not new_a < sum(a) / (4 * m)]

    # print(x)

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

    print(res)


main(N, M, A)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
def main():
    N,M = map(int, input().split())
    A = list(map(int, input().split()))
    A.sort(reverse=True)
    th = (1 / (4*M)) * sum(A)
    ans = "Yes"
    for i in range(M):
        if A[i] < th:
            ans = "No"
            break
    print(ans)
if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

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

p = 1/(4*m)
s=  sum(a)
p = p*s

# print(a[m-1])
if( a[m-1] >= p ):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
lismn=input().split()
n=int(lismn[0])
m=int(lismn[1])
lisa=[int(x) for x in input().split()]
count=0
for i in lisa:
  if sum(lisa)/4.0/m <= i:
    count+=1
if m<=count:
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

toku = 0
for i in range(N):
    if (1 / (4 * M)) * sum(A_list) <= A_list[i]:
        toku += 1

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