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:
nm = [int(x) for x in input().split(' ')]
vote = [int(v) for v in input().split(' ')]

sum_vote = sum(vote)
thresh = sum_vote / (4 * nm[1])

vote_valid = [True if v >= thresh else False 
              for v in vote]

sum_vote_valid = sum(vote_valid)
if sum_vote_valid >= nm[1]:
  print('Yes')
else:
  print('No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import os
import math

def main():
	n,m = map(int, input().split())
	a_list = list(map(int, input().split()))
	total_check = math.ceil(sum(a_list)/(4*m))
	
	a_list.sort(reverse=True)
	flag = True
	for i in range(m):
		if a_list[i] < total_check:
			flag = False
			break
	if flag:
		print("Yes")
	else:
		print("No")


if __name__ == "__main__":
	main()

Submission status: Accepted

Solution code:
import os
import math

def main():
	n,m = map(int, input().split())
	a_list = list(map(int, input().split()))
	total_check = math.ceil(sum(a_list)/(4*m))
	
	a_list.sort(reverse=True)
	flag = True
	for i in range(m):
		if a_list[i] < total_check:
			flag = False
	if flag:
		print("Yes")
	else:
		print("No")


if __name__ == "__main__":
	main()

Submission status: Accepted

Solution code:
n,m = map(int,input().split())
li = list(map(int,input().split()))
p = sum(li)/(4 * m)
ans = "Yes"
c = 0

for i in li:
    if i >= p:
        c+=1

if c < m:
    ans = "No"

print(ans)

Submission status: Accepted

Solution code:
X = input().split()
N = int(X[0])
M = int(X[1])
Y = input().split()
Z = []
sum = 0
for i in range(N):
    Z.append(int(Y[i]))
    sum = sum + Z[i]
count = 0
for i in range(N):
    if Z[i] >= sum/(4*M):
        count = count + 1
if count >= M:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n, m = list(map(int, input().split()))
a = list(map(int, input().split()))
"""
n = 12
m = 3
a = [4, 56, 78, 901, 2, 345, 67, 890, 123, 45, 6, 789]
"""
for i in range(m):
    if sorted(a)[(i+1)*-1] * 4 * m < sum(a):
        print('No')
        exit()

print('Yes')

Submission status: Accepted

Solution code:
n,m =[int(x) for x in input().split()]
A =[int(x) for x in input().split()]
A_check =[x for x in A if x >= sum(A)/(4*m)]
if len(A_check) >= m :
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

totalVotes = 0
for i in range(len(A)):
	totalVotes += A[i]

selected = 0
for i in range(len(A)):
	if A[i] >= totalVotes/(4*M):
		selected +=1 

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#coding:utf-8

n,m = map(int,input().split())
a = input().split()
alist = []
count = 0
ans = "Yes"
for i in a:
    s = int(i)
    count += s
    alist.append(s)

alist.sort(reverse=True)
thres = count / (4 * m)
for i in range(m):
    t = alist[i]
    if t < thres:
        ans = "No"
        break

print(ans)

Submission status: Accepted

Solution code:
N, M = map(int, input().split())
A = list(map(int, input().split()))
a = sorted(A, reverse=True)
s = "Yes"
for i in range(M):
    if a[i] < sum(a) * (1/(4*M)):
        s = "No"
        break
print(s)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n,k=map(int,input().split())
l=[int(i) for i in input().split()]
l.sort(reverse=True)
if l[k-1]<sum(l)/(4*k):
    print("No")
else:
    print("Yes")

Submission status: Accepted

Solution code:
num_array = list(map(int, input().split()))
vote_num_array = list(map(int, input().split()))
select_num = num_array[1]

val = sum(vote_num_array) * (1 / (select_num * 4))
cnt = 0

for vote_num in vote_num_array:
  if vote_num >= val:
    cnt += 1

if cnt >= select_num:
  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)
s=sorted(A)
if s[-M]>=(b/(4*M)):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
N,M = map(int,input().split())
L = list(map(int,input().split()))
S = sum(L)
L = sorted(L)
A = 0
#print(L)

for i in L:
    #print(i)
    if i >= S/4/M:
        
        A += 1
        
#print(A)
if A >= M:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

sum = 0

for n in range(N):
    a = A[n]

    if (vote_sum*(1/(4*M)))>a:
        continue
    sum = sum + 1

print("Yes" if M<=sum else "No")

Submission status: Accepted

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

total_vote=sum(A)/(4*M)
sele=0

for i in A:
  if i >= total_vote:
    sele+=1
  else:
    pass

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
from math import ceil

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

a = [int(i) for i in input().split()]

all_vote = sum(a) 

m4 = ceil(1/4/m * all_vote)


for i in a:
    if i >= m4:
        m -= 1

        if m == 0:
            print("Yes")
            break

if m != 0:
    print("No")

Submission status: Accepted

Solution code:
N,M = list(map(int,input().split()))
number = list(map(int,input().split()))
number.sort(reverse=True)
total = sum(number) / (4*M)
for i in range(M):
    if number[i] >= total:
        pass
    else:
        print("No")
        exit()
print("Yes")

Submission status: Accepted

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

A.sort(reverse=True)

sum = 0.0
for a in A:
    sum += a

ret = 'Yes'
for i in range(M):
    if (A[i] < (sum / (4 * M))):
        ret = 'No'
        break

print(ret)

Submission status: Accepted

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

top_m = sorted(A, reverse=True)[:M]
m = map(lambda x: x/sum(A) >= 1/(4*M), top_m)

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

Submission status: Accepted

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

total = sum(aa)
r = (1/(4*m)) * total
c = 0

for i in aa:
    if i >= r:
        c += 1
if c >= m:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

import sys
# import math
# import re                                    # re.compile(pattern) => ptn obj; p.search(s), p.match(s), p.finditer(s) => match obj; p.sub(after, s)
# from collections import deque                # deque class. deque(L): dq.append(x), dq.appendleft(x), dq.pop(), dq.popleft(), dq.rotate()
# from collections import defaultdict          # subclass of dict. defaultdict(facroty)
# from collections import Counter              # subclass of dict. Counter(iter): c.elements(), c.most_common(n), c.subtract(iter)
# from heapq import heapify, heappush, heappop # built-in list. heapify(L) changes list in-place to min-heap in O(n), heappush(heapL, x) and heappop(heapL) in O(lgn).
# from heapq import nlargest, nsmallest        # nlargest(n, iter[, key]) returns k-largest-list in O(n+klgn).
# from itertools import count, cycle, repeat   # count(start[,step]), cycle(iter), repeat(elm[,n])
# from itertools import groupby                # [(k, list(g)) for k, g in groupby('000112')] returns [('0',['0','0','0']), ('1',['1','1']), ('2',['2'])]
# from itertools import starmap                # starmap(pow, [[2,5], [3,2]]) returns [32, 9]
# from itertools import product                # product(iter, repeat=n)
# from itertools import accumulate             # accumulate(iter[, f])
# from functools import reduce                 # reduce(f, iter[, init])
# from functools import lru_cache              # @lrucache ...arguments of functions should be able to be keys of dict
# from bisect import bisect_left, bisect_right # bisect_left(a, x, lo=0, hi=len(a)) returns i such that all(val<x for val in a[lo:i]) and all(val>-=x for val in a[i:hi]).
# from copy import deepcopy                    # to copy multi-dimentional matrix without reference


def main():
    mod = 1000000007                  # 10^9+7
    inf = float('inf')
    sys.setrecursionlimit(10**6)    # 1000 -> 1000000
    def input(): return sys.stdin.readline().rstrip()
    def ii():  return int(input())
    def mi():  return map(int, input().split())
    def mi_0(): return map(lambda x: int(x)-1, input().split())
    def lmi(): return list(map(int, input().split()))
    def lmi_0(): return list(map(lambda x: int(x)-1, input().split()))
    def li():  return list(input())
    
    
    n, m = mi()
    a = lmi()
    total = sum(a)
    num = len(list(filter(lambda x: x >= total / (4 * m), a)))
    print('Yes') if m <= num else print('No')

if __name__ == "__main__":
    main()

Submission status: Accepted

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

cnt = 0

for i in l:
    if i >= sum(l)/(4*M):
        cnt += 1

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

Submission status: Accepted

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

YES = "Yes"  # type: str
NO = "No"  # type: str


def solve(N: int, M: int, A: "List[int]"):
    n = N
    m = M
    a = A
    t = sum(a)/(4*m)
    res = sum(1 for i in a if i >= t)
    print('Yes' if m <= res else 'No')



# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    M = int(next(tokens))  # type: int
    A = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    solve(N, M, A)

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)

all_points = 0
for i in A:
  all_points += i

for i in range(M):
  if A[i] >= all_points/(4 * M):
    pass
  else:
    print('No')
    break
else:
  print('Yes')

Submission status: Accepted

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

Submission status: Accepted

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

total  = sum(num_list)
rate = [x / total for x in num_list if x/total>= 1/(4*M)]
if len(rate) < M:
    print("No")
else:
    print("Yes")

Submission status: Accepted

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

votes = sum(An)
least = votes / (4 * M)
count = 0
for v in An:
    if v >= least:
        count += 1

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

Submission status: Accepted

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

n = list(map(int, input().split()))
sort_n = sorted(n, reverse=True)
t = sum(n)

c = 0

for i in range(0,M):
    if sort_n[c] >= t*(1/(4*M)):
        c += 1
        
    else:
        continue

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()))
all_A = sum(A)
flag = False
for i in range(M):
  if max(A) >= all_A / (4 * M):
    A.remove(max(A))
  else:
    flag = True
  

print("No" if flag else "Yes")

Submission status: Accepted

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

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

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

Submission status: Accepted

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

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

popular_count = sum([a >= count_flag for a in A])

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

Submission status: Accepted

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

s = sum(AAA)
if sum([1 if s/(4*M)<=A else 0 for A in AAA])>=M:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

soutouhyousuu = sum(a)
l = []
for i in range(len(a)):
    if a[i] >= soutouhyousuu / (4 * nm[1]):
        l.append(a[i])

if len(l) >= nm[1]:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
if __name__ == "__main__":
  N,M = (int(x) for x in input().split())
  vote = [int(x) for x in input().split()]
  vote.sort(reverse=True)
  point = sum(vote)/(4*M)
  flag=1
  for i in vote[:M]:
    if i < point:
      print('No')
      flag=0
      break
  if flag == 1:
    print('Yes')

Submission status: Accepted

Solution code:
N,M=map(int,input().split())
a=list(map(int,input().split()))
SUM=sum(a)
ninnki=SUM/(4*M)
count=0

for i in a:
    if i>=ninnki:
        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()))
counter_ = 0
for A_ in A:
    if A_*4*M >= sum(A):
        counter_ += 1
if counter_ >= M:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

cnt = 0
for n in X:
    if n >= (sum(X) / (4 * M)):
        cnt = cnt + 1
        if cnt >= M:
            break

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

Submission status: Accepted

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

Submission status: Accepted

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

a.sort(reverse=True)
su = sum(a)

for i in range(m):
    if a[i] < su/(4*m):
        print("No")
        exit(0)

print("Yes")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

n, m = map(int, sys.stdin.readline().split())
line = sys.stdin.readline().split()
nums = list(map(int, line))

sumi = sum(nums)
barr = (sumi / (4 * m))

if sum([1 for x in nums if x >= barr]) >= 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)

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

Submission status: Accepted

Solution code:
n, m = map(int, input().split())
l = list(map(int, input().split()))
target = sum(l) / (4 * m)
for x in l:
    if x >= target:
        m -= 1
    if m == 0:
        print("Yes")
        exit()
print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N, M = (int(x) for x in input().split())
a = [int(x) for x in input().split()]
b = sum(a)/(4*M)
count = 0
for i in a:
  if i >= b:
    count = count + 1

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

Submission status: Accepted

Solution code:
import numpy as np
import math as mt
N,M=map(int, input().split())
A=list(map(int,input().split()))
boader=1/(4*M)
A.sort(reverse=True)
for i in range(0,M):
    if A[i]<(sum(A)*(1/(4*M))):
        print("No")
        break
    elif i==M-1:
        print("Yes")

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
#商品数を取り込む
line_num = input()
line = line_num.split(" ")
  
    #全得票数を計算する
line2 = input().split(" ")
sum_vote = 0
for i in line2:
   # print(i)
    sum_vote += int(i)
  
#規定得票数を算出する。
numa = sum_vote/int(line[1])
num= numa/4

list =[]
for i in line2:
    if int(i) >=num:
        list.append(i)
    else:
        pass

if len(list)>=int(line[1]):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
from sys import stdin


if __name__ == "__main__":
    _in = [_.rstrip() for _ in stdin.readlines()]
    N, M = list(map(int,_in[0].split(' ')))  # type:list(int)
    A_arr = list(map(int,_in[1].split(' ')))  # type:list(int)
    # vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
    A_arr.sort(reverse=True)
    vote = sum(A_arr)
    TF = 'Yes' if A_arr[M-1] >= vote/(4*M) else 'No'
    # ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    print(TF)

Submission status: Accepted

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

A = list(map(int,input().split()))
A.sort()
A.reverse()
val = sum(A)/(4*M)

flag = False
for count in range(M):
    if A[count] >= val:
        flag = True
    else:
        flag = False
        break;

if flag == True:
    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:
import numpy as np


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

total = np.sum(a)
criteria = total / (4 * m)

count = 0
for i in range(n):
    if a[i] >= criteria:
        count += 1

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
i = input().split()
i_int = [int(n) for n in i]
a = input().split()
A = [int(m) for m in a]
N = i_int[0]
M = i_int[1]

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

##print(threshhold)

c = 0
for val in A:
    if val >= th:
    ##print(val)
        c += 1

if M > c:
    print('No')
else:
    print('Yes')

Submission status: Accepted

Solution code:
i = input().split()
i_int = [int(n) for n in i]
a = input().split()
A = [int(m) for m in a]
N = i_int[0]
M = i_int[1]

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

##print(threshhold)

c = 0
for val in A:
    if val >= th:
    ##print(val)
        c += 1

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
class atcorder:
    
    class atcorder:

        N,M=map(int,input().split())
        A=[]
        A=list(map(int,input().split()))
        Sum=sum(A)
        i=0
        for n in range(len(A)):
            if A[n]>=Sum/(4*M):
                i+=1
            else:
                continue
        if i>=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)
ans = 0
for i in A:
    if i >= B/(4*M):
        ans += 1
if ans >= M:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin
import numpy as np



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

# read data for n sequences.
temp = stdin.readline().split()
N, M = np.asarray(temp).astype(int)
temp = stdin.readline().split()
a = np.asarray(temp).astype(int)

sumvotes = np.sum(a)

c = 0; OUT = False
for data in a:
    if data >= sumvotes/(4*M):
        c += 1
    if c >= M:
        OUT = True
        #break

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

Submission status: Accepted

Solution code:
n,m=map(int,input().split())
a=list(map(int,input().split()))
print("YNeos"[len([x for x in a if x>=sum(a)/4/m])<m::2])

Submission status: Accepted

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

S = sum(li)
cnt = 0
for i in range(N):
    if(4*M*li[i] >= S):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)
a=[int(i) for i in input().split()]

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

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

if able>=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)
sortedA = list()
sum_of_votes = 0
for i in A : 
    sum_of_votes += i
for i in range(m) : #人気商品候補のsortedAリスト
    sortedA.append(A[i])
isOK = True
for i in sortedA: #人気商品候補のうち選べないものはないか？
    if i < sum_of_votes * (1/(4*m)) :
        isOK = False
if isOK == True :
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

    th = sum(a) / (4 * m)
    a_ = [0 if x < th else 1 for x in a]

    print(["Yes", "No"][not m <= sum(a_)])


if __name__ == "__main__":
    main()

Submission status: Accepted

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

s = sum(A[i] / sumA >= 1 / (4 * M) for i in range(N))

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

Submission status: Accepted

Solution code:
from collections import *
from heapq import *
from itertools import *
#from fractions import gcd

from decimal import *
import copy
from bisect import *
import time
import sys
import math

input=lambda :sys.stdin.readline().rstrip()
sys.setrecursionlimit(10**7)
def gcd(a,b):
    if(a%b==0):return(b)
    return (gcd(b,a%b))

N,M=map(int,input().split())
A=sorted(list(map(int,input().split())),reverse=True)
a=sum(A)
Z=a/(4*M)
for m in range(M):
    if A[m]<Z:
        print("No")
        exit()
print("Yes")

Submission status: Accepted

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

Submission status: Accepted

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

ans = 0
suma = sum(A)

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n, m = map(int, input().split())
aa = list(map(int, input().split()))
thre = sum(aa) / (4*m)
cnt = 0
for a in aa:
  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()))

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 = (int(x) for x in input().split()) 
s = list(map(int, input().split()))

t = sum(x>=(sum(s)/(4*m)) for x in s)

if t >= 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)

vote = sum(a)


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

Submission status: Accepted

Solution code:
n,m=map(int,input().split())
l=list(map(int,input().split()))
sum=0
for i in range(n):
  sum+=l[i]

d=sum//(4*m)
if sum//(4*m)!=sum/(4*m):
  d=d+1

ct=0
flag=0
for i in range(n):
  if l[i]>=d:
    ct+=1
  
  if ct>=m:
    flag=1
    break

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

Submission status: Accepted

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

    threshold = sum(a) / (4 * m)
    if sum(1 for i in a if i >= threshold) >= m:
        print("Yes")
    else:
        print("No")


if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n, m  = map(int, input().split())
vote_list = list(map(int, input().split()))
def choose(n, m, vote_list):
    votes = sum(vote_list)
    necessary = votes/(4*m)
    count = 0
    for item in vote_list:
        if item >= necessary:
            count += 1
    if count >= m:
        return "Yes"
    return "No"

print(choose(n, m, vote_list))

Submission status: Accepted

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

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

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

Submission status: Accepted

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

lst.sort(reverse = True)

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