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:
_, M = map(int, input().split())
A = list(map(float, input().split()))


h = 1/(4*M)
count = 0

for i in range(len(A)):
  if (count==M):
    break
  elif h <= A[i]/sum(A):
    count = count + 1
if count == M:
  print('Yes')
else:
  print('No')

Submission status: Accepted

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

count = 0
for c in a:
    if c >= s / 4 / m:
        count+=1
# print(count, m)
if count >= m:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
n,m = (int(i)for i in input().split())
l = [int(i)for i in input().split()]
lim = (sum(l))/(4*m)
# ~ print("lim ",lim)
cnt=0
for i in range(n):
	if l[i]>=lim:
		cnt+=1
# ~ print("cnt = ",cnt)
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)

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

Submission status: Accepted

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

total = sum(items)
border = total / (4*m)

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

Submission status: Accepted

Solution code:

def main():
    N, M = [int(_) for _ in input().split()]
    slist = list(map(int, input().split()))
    sort_list = sorted(slist)
    thr = sum(sort_list) / (4 * M)
    
    cnt = 0
    for i in sort_list:
        if i >= thr:
            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()))
A.sort()
A.reverse()
b=sum(A)/(4*M)
ans="Yes"
for i in range(M):
    if A[i]<b:
        ans="No"
print(ans)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3

import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(2147483647)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

n,m = LI()
a = LI()
cnt = 0
s = sum(a)
t = 1/(4*m)
s = s*t
for i in range(n):
    if a[i] < s:
        continue
    cnt += 1
if cnt >= m:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b = map(int,input().split())
res = list(map(int,input().split()))
votes = sum(res)
lvotes = votes / (4 * b)
cnt = b
for i in res:
    if cnt == 0:
        break
    if i >= lvotes:
        cnt -= 1
if cnt == 0:
    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] * 4 * m < sum(a)):
    print("No")
else:
    print("Yes")

Submission status: Accepted

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

Submission status: Accepted

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

l = []

all = sum(h)
border = all / (4 * M)

for i in h:
    if i >= border:
        l.append(i)
    else:
        pass

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

Submission status: Accepted

Solution code:
#!/usr/bin/python3

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

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

a.sort(reverse=True)

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

if a[m - 1] >= llimit:
    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)
r=4*M
if a[M-1] < sum(a)/r :
  print("No")
else:
  print("Yes")

Submission status: Accepted

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

a_sum = sum(a_list)
a_list.sort()
a_list.reverse()
for i in range(m):
    a = a_list[i]
    if a < a_sum / (4 * m):
        print('No')
        exit()
else:
    print('Yes')

Submission status: Accepted

Solution code:
NM=input().split()
M=int(NM[1])
a=input().split()
a_list=[]
for i in a :
  a_list.append(int(i))
a_list.sort(reverse=True)
sum1=sum(a_list)
 
flag=True
for i,youso in enumerate(a_list) :
  if(youso*4*M<sum1 and i+1<=M) :
    flag=False
    break
    
if flag==True :
  print('Yes')
else :
  print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n, m = [int(x) for x in input().split()]
votes = [int(x) for x in input().split()]
print('Yes' if (sorted(votes, reverse=True)[m-1] >= (sum(votes) / (4 * m))) else 'No')

Submission status: Accepted

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

souwa = sum(A)
hyou = souwa/(4*m)
ninki = 0

for number in A:
  if number >= hyou:
    ninki = ninki + 1

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N, M = map(int, input().split())
tokuten_list = list(map(int, input().split()))
soutokuten = sum(tokuten_list)
asikiri_line = soutokuten / (4 * M)
kekka = "No"
ninki_count = 0
for tokuten in tokuten_list:
    if tokuten >= asikiri_line:
        ninki_count += 1
        if ninki_count >= M:
            kekka = "Yes"
            break

print(kekka)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3

# def solve(N: int, M: int, A: List[int]) -> bool:
def solve(n, m, a):
    sum_a = sum(a)
    return len(list(filter(lambda a_i: a_i * 4 * m >= sum_a, a))) >= m

# generated by online-judge-template-generator (https://github.com/kmyk/online-judge-template-generator)
def main():
    import sys
    tokens = iter(sys.stdin.read().split())
    N = int(next(tokens))
    M = int(next(tokens))
    A = [None for _ in range(N)]
    for i in range(N):
        A[i] = int(next(tokens))
    assert next(tokens, None) is None
    ans = solve(N, M, A)
    print(ans and 'Yes' or 'No')

if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

Submission status: Accepted

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

suma = sum(arr)
factor = (1/(m*4))*suma
che = []

for a in arr:
	if a >= factor:
		che.append(a)
		
print("Yes" if len(che) >= m else "No")

Submission status: Accepted

Solution code:
line = input().split()
N = int(line[0])
M = int(line[1])
lineA = input().split()
lineA_str = [int(s) for s in lineA]
Total = sum(lineA_str)
B = [ i for i in lineA_str if i >= Total/(4*M)]
if M <= len(B):
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
import math
_,m=map(int, input().split())
A=list(reversed(sorted([int(x) for x in input().split()])))
t=sum(A)
b=t/(4*m)
if A[m-1]>=b:
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

A_list = list(map(int, input().split(' ')))
A_sum = sum(A_list)

lower_bound = 0
if A_sum % (4 * M) == 0:
    lower_bound = A_sum // (4 * M) - 1
else:
    lower_bound = A_sum // (4 * M)
s = 0
for vote in A_list:
    if vote > lower_bound:
        s += 1

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

Submission status: Accepted

Solution code:
#python3
def main():
    n, m = map(int, input().split())
    a = [int(i) for i in input().split()]
    s = sum(a)
    x = s/(4*m)
    c = 0
    for i in range(n):
        if x > a[i]:
            c += 1
    
    k = n-c
    if k >= m:
        print('Yes')
    else:
        print('No')
main()

Submission status: Accepted

Solution code:
def q2():
    N,M = (int(i) for i in input().split())
    A = [int(i) for i in input().split()]
    A = sorted(A, reverse=True)
    sumA = sum(A)
    A = A[:M]

    ans = 'Yes'
    for a in A:
        if a < sumA / (M * 4):
            ans = 'No'
            break
    print(ans)


if __name__ == '__main__':
    q2()

Submission status: Accepted

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

sumA = sum(AList)
ansList = list(filter(lambda x: x >= sumA / (4 * M), AList))

ans = "No"
if len(ansList) >= M:
    ans = "Yes"

print(ans)

Submission status: Accepted

Solution code:
n,m = map(int, input().split())
l = list(map(int, input().split()))
limit = sum(l)/(4*m)
l.sort(reverse=True)
if l[m-1] < limit:
    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 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_val = sum(A)

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

Submission status: Accepted

Solution code:

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

input_list = [0] * n

input_list_str = input().split()
input_list = [int(s) for s in input_list_str]
input_list = sorted(input_list, reverse=True)

vote_sum = sum(input_list)
vote_standard = vote_sum / (4 * m)

flag = True
for i in range(m):
    if input_list[i] < vote_standard:
        flag = False
        break

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N,M=(int(x) for x in input().split())
As=[int(x) for x in input().split()]
p = sum(As)/(4*M)
ov = [1 if x>=p else 0 for x in As]
if sum(ov)>=M:
  print('Yes')
else:
  print('No')

Submission status: Accepted

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

sum_a = sum(a)
l = []
for i in range(n):
    if a[i] < sum_a / (4*m):
        continue
    else:
        l.append(a[i])
if len(l) >= m:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
arrayNM = list(map(int, input().split()))
array = list(map(int, input().split()))
soutoku = 0
for num in array:
  soutoku += num
tokuhyousuu = soutoku / (4 * float(arrayNM[1]))
ninnkiCounter = 0
for num in array:
  if (float(num) >= tokuhyousuu):
    ninnkiCounter += 1
    

if (arrayNM[1] <= ninnkiCounter):
  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)
line = (1/(4*M))*sum(A)
flag = False
for i in range(M):
    if A[i] >= line:
        flag = True
    else:
        flag = False
if flag == True:
    print('Yes')
else:
    print("No")

Submission status: Accepted

Solution code:
import sys
import math
from collections import defaultdict
from bisect import bisect_left, bisect_right

sys.setrecursionlimit(10**7)
def input():
    return sys.stdin.readline()[:-1]

mod = 10**9 + 7

def I(): return int(input())
def LI(): return list(map(int, input().split()))
def LIR(row,col):
    if row <= 0:
        return [[] for _ in range(col)]
    elif col == 1:
        return [I() for _ in range(row)]
    else:
        read_all = [LI() for _ in range(row)]
        return map(list, zip(*read_all))

#################

N,M = LI()
A = LI()

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

Submission status: Accepted

Solution code:
l,m = map(int,input().split())
li = list(map(int,input().split()))
y = 0
x = 0
for n in range(l+1):
    if y == m:
            print("Yes")
            exit()
    if x <= (l-1) and li[x] >= ((sum(li))/(4*m)):
        y += 1
        x += 1
    else:
        x += 1
print("No")

Submission status: Accepted

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

t = 0
for i in range(n):
  t += a[i]
  
b = t/(4*m)

c = 0
for j in range(n):
  if a[j] >= b:
    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()))
oreder_A = sorted(A, reverse=True)
A_sum = sum(A)
if oreder_A[M-1] >= A_sum / (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[-M]/sum(A) < 1/(4*M) :
    print("No")
else:
    print("Yes")

Submission status: Accepted

Solution code:
n, m   = map(int, input().split())
a =list(map(int, input().split()))
b = [i  for i in a if i >= sum(a)*(1/(4*m))]

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

condition1 = Fraction(1,4 * m)

count = 0

condition2 = sum(a) * condition1
for A in a:
    if A >= condition2:
        count +=1

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

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
l=list(map(int,input().split()))
t=sum(l)/(4*b)
ans = [i for i in l if i>=t]
print('Yes' if len(ans)>=b else 'No')

Submission status: Accepted

Solution code:
N,M=(int(x) for x in input().split())
A = list(map(int, input().split()))
count=0
sum=0

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

for i in range(N):
    if(A[i])>=(sum * (1/(4*M))):
        count=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)

b = 0

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Asum = sum(A)

for i in range(M):
    Amax =  max(A)
    max_index = A.index(Amax)
    A.pop(max_index)
    

if Amax < Asum/4/M:
    print('No')
else:
    print('Yes')

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] >= (1 / (4*M)) * sum(A) :
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
N,M = input().split(" ")
A = list(map(int, input().split(" ")))
count = 0
temp = 0
for x in A:
    temp += x
num = (1/(4*int(M)))*temp
for x in A:
    if x >= num:
        count += 1
    elif count >= int(M):
        break
    else:
        continue
if count>=int(M):
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

check = ((1 / (4 * M)) * sum(A))
x = 0
for item in A:
    if item < check:
        x += 1

ans = N - x

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

Submission status: Accepted

Solution code:
def resolve():
	N, M, *A = map(int, open(0).read().split())
	vote = sum(A) * (1 / (4*M))
	num = list(filter(lambda x: x >= vote, A))
	num = len(num)
	if num >= M:
		print("Yes")
	else:
		print("No")
resolve()

Submission status: Accepted

Solution code:
import sys
import numpy as np


scan = sys.stdin.readline


def main():
    n, m = map(int, scan().rstrip().split())
    a = np.array([int(_) for _ in scan().rstrip().split()])

    votes = np.sum(a)
    candidate_num = np.sum(a >= (votes / (4 * m)))
    
    if candidate_num >= m:
        print("Yes")
    else:
        print("No")


if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def check(sum1,k,arr,m):
    count=0
    for i in arr:
        if(i >= k):
            count+=1
    if(count >= m):
        return True
    return False
inp=list(map(int,input().strip().split()))[:2]
n,m=inp[0],inp[1]
arr=list(map(int,input().strip().split()))[:n]
sum1=sum(arr)
k=sum1/(4*m)
a=check(sum1,k,arr,m)
if(a):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
import numpy as np
N, M = input().split(' ')
lis = np.array([int(n) for n in input().split(' ')])
#print("{} {}".format(sum(lis) / 4 / int(M), lis[int(M)-1]))

count = sum(sum(lis) / 4.0 / int(M) <= lis)

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

Submission status: Accepted

Solution code:
N, M = map(int, input().split())
N = input().split()
N = [int(n) for n in N]
A = []
soutoku = 0
for i in N:
    soutoku += int(i)
N = sorted(N, reverse=True)
for i in range(M):
    A.append(N[i])
b = soutoku / (4*M)

if int(N[int(M-1)]) < b:
    print("No")
else:
    print("Yes")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

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

votes_M = sorted(A, reverse=True)[M-1]
votes = sum(A)

if votes_M >= (votes / (M * 4)):
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

A = list(map(int,input().split()))
so = sum(A)
a = len(list(filter( lambda x:x>=so/(4*M),A)))

if M <= a:
  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('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)
vote = sum(A) / (4 * M)
print('No' if A[M - 1] < vote else 'Yes')

Submission status: Accepted

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

A = list(map(int, input().split()))
A_sort = sorted(A, reverse=True)
# print(A)
if A_sort[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()))
ALL=sum(A)
ave=ALL/(4*M)
count=0
for i in range(N):
    if(A[i]>=ave):
        count+=1
    else:
        pass
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()))



cnt = 0
cnt1 = 0

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

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



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

Submission status: Accepted

Solution code:
import numpy as np

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

N = tmp[0]
M = tmp[1]

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

i = np.array(i)

i = np.sort(i)[::-1]

souwa = np.sum(i)

if i[M-1] < (souwa * (1/(4*M))):
    print("No")
else:
    print("Yes")
# print(i[0]) #出力：i_1
# print(i[1]) #出力：i_2

Submission status: Accepted

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

toku = sum(a) / (4 * m)
a=sorted(a,reverse=True)
    
if a[m-1] >= toku:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

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

list.sort(A,reverse = True)

s=float(sum(A)/(4*M))
check=0
for i in range(0, M):
    if A[i]<s:
        check=1

if check ==1:
    print('No')
else:
    print('Yes')

Submission status: Accepted

Solution code:
def main():
    N,M = map(int,input().split())
    A = list(map(int,input().split()))
    G = sum(A)
    list.sort(A, reverse=True)
    i = 0
    while i < M:
        if A[i] / G < 1 / (4 * M):
            return "No"
            break
        i += 1
    return "Yes"
print(main())

Submission status: Accepted

Solution code:
input_d21 = list(map(int, input().split()))
input_d22 = list(map(int, input().split()))

N = input_d21[0]
M = input_d21[1]

A = input_d22

sohyo = sum(A)
zyoken = float(sohyo) / float(4 * M)


A = sorted(A, reverse=True)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

i = list(map(int, input().split()))
N = i[0]
M = i[1]
A  = list(map(int, input().split()))
S=sum(A)
A_sorted=sorted(A,reverse=True)
if A_sorted[M-1] >= S*1/(4*M):
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

all_a = sum(a)
flag = True

a.sort(reverse=True)

for i in range(m):
    if a[i] < (all_a / (4 * m)):
        flag = False
if flag:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
N, M = map(int, input().split())
A = list(map(int, input().split()))
F = 0
trigger = 1 / (4 * M)

for i in range(len(A)):
    if A[i]/sum(A) >= trigger:
        F = F + 1
        
if F >= M:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N, M = map(int, input().split())
List = list(map(int, input().split()))
total = 0
for n in range(N):
    total += List[n]
limit = total/(4*M)
count = 0
for n in range(N):
    if List[n] >= limit:
        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()))
cnt = 0
sum = 0
for i in a:
    sum+=i
for i in a:
    if i >= sum/(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()))
newA = sorted(A,reverse=True)
sumA = sum(A)

m = sumA/(4*M)

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

Submission status: Accepted

Solution code:
import numpy as np

if __name__ == "__main__":
    N, M = map(int, input().split())
    A = list(map(int, input().split()))
    A = sorted(A, reverse=True)
    a = np.asarray(A[:M])
    for i in a:
        if i >= sum(A)/(M*4):
            ret = "Yes"
            continue
        else:
            ret = "No"
            break
    print(ret)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n,m = map(int, input().split())
i = list(map(int, input().split()))
j=sorted(i, reverse=True)


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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
def main(n,m,a):
    sikii = sum(a) / (4*m)
    a = [i for i in a if i >= sikii]
    return "Yes" if len(a) >= m else "No"

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

Submission status: Accepted

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

# 得票総数
Sum = sum(A)

# M位の商品の得票数
if A[int(M)-1] < Sum / (4 * int(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)

s = sum(a)

if a[m-1]*4*m >= s:
    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 range(n):
  sum += a[i]
a.sort(reverse = True)
if a[m-1] >= (sum/4/m):
  print("Yes\n")
else:
  print("No\n")

Submission status: Accepted

Solution code:
def main():
    N, M = [int(x) for x in input().split()]
    A = [int(x) for x in input().split()]
    import heapq
    bests = heapq.nlargest(M, A)
    # print(bests)
    if bests[-1] >= sum(A)/(4*M):
        print("Yes")
    else:
        print("No")


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N, M = map(int, input().split(' '))
lis1 = list(map(int, input().split(' ')))
S = sum(lis1)
thresh = S / (4 * M)
lis2 = sorted(lis1)
if lis2[-M] < thresh:
  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 = 0
for i in a:
  total += i
ok = 0
for i in range(1, m + 1):
  if a[-i] >= total / (4 * m):
    ok += 1

if ok != m:
  print("No")
else:
  print("Yes")

Submission status: Accepted

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

Submission status: Accepted

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