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:
# -*- coding: utf-8 -*-


def main():
    import sys
    input = sys.stdin.readline

    n, m = map(int, input().split())
    a = list(map(int, input().split()))
    total = sum(a)
    count = 0

    for ai in sorted(a, reverse=True):
        if (ai * 4 * m) >= total:
            count += 1

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

b = [x for x in a if x >= sum(a)/(4*m)]

print(["Yes","No"][len(b)<m])

Submission status: Accepted

Solution code:
# coding: utf-8
n, m = map(int, input().split())
a = list(int(i) for i in input().split())
s = sum(a)
a.sort(reverse=True)
c = 0

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

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

Submission status: Accepted

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

s=sum(A) / (4 * M)
cnt=0
for a in A:
    if a >= s:
        cnt+=1

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

Submission status: Accepted

Solution code:
import math, sys

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

for i in range(b):
  if data[i] >= math.ceil(sum(data) / (4 * b)):
    pass
  else:
    print('No')
    sys.exit()
print('Yes')

Submission status: Accepted

Solution code:
length, select = map(int, input().split())
vote = list(map(int, input().split()))
vote.sort(reverse=True)
max_vote = sum(vote)

flag = False
for v in vote[:select]:
  if v < max_vote/(4*select):
    print('No')
    break
else:
  print('Yes')

Submission status: Accepted

Solution code:
n = [int(e) for e in input().split(" ")]
a = [int(e) for e in input().split(" ")]
c = 0
s = sum(a) / (4 * n[1])
for e_a in a:
    if s <= e_a:
        c += 1
print("Yes" if n[1] <= c else "No")

Submission status: Accepted

Solution code:
N, M = map(int, input().split())
A = list(map(int, input().split()))
for i in range(N-1):
  for j in range(i+1):
    if A[i+1-j] > A[i-j]:
      a = A[i-j]
      A[i-j] = A[i+1-j]
      A[i+1-j] = a

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

if A[M-1] < float(S)/(4.0*float(M)):
  print("No")
else:
  print("Yes")

Submission status: Accepted

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

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

num = 0
s = sum(al)/(4*m)
ans = 'No'

for a in al:
    if s <= a:
        num += 1

if num >= m:
    ans = 'Yes'

print(ans)

Submission status: Accepted

Solution code:
# Problem B - Popular Vote

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

# initialization
A_list = sorted(A_list, reverse=True)
is_ok = True
test_limit = sum(A_list) / (4*M)

# check
test_list = A_list[:M]
for t in test_list:
    if t<test_limit:
        is_ok = False
        break

# output
if is_ok:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
num=list(map(int, input().split()))
a=list(map(int, input().split()))
ok=[]
for i in range(len(a)):
  if a[i]>=sum(a)/(4*num[1]):
  	ok.append(a[i])
if len(ok)>=num[1]:
  print("Yes")
else:
  print("No")
#print(ok)

Submission status: Accepted

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

c=[i for i in a if b<=i]
d=len(c)

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

Submission status: Accepted

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

Submission status: Accepted

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

xs = []
for i in input().split():
    xs.append(int(i))

bound = 1/4/m * sum(xs)

count = 0
for x in xs:
    if x >= bound:
        count += 1

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

Submission status: Accepted

Solution code:
#author : dokueki

import sys
INT_MAX = sys.maxsize
INT_MIN = -(sys.maxsize)
sys.setrecursionlimit(10**7)
mod = 1000000007


def IOE():
    sys.stdin = open("input.txt", "r")
    sys.stdout = open("output.txt", "w")


def main():
    n, m = map(int, sys.stdin.readline().split())
    a = list(map(int, sys.stdin.readline().split()))
    s = sum(a)
    need = s / (4*m)
    cnt = []
    for i in a:
        if i >= need:
            cnt.append(i)
    if len(cnt) >= m:
        print("Yes")
    else:
        print("No")


if __name__ == "__main__":
    try:
        IOE()
    except:
        pass
    main()

Submission status: Accepted

Solution code:
import math
import bisect
def Main(N, M, A):
    A.sort()
    wa = sum(A)
    thres = math.ceil(wa/(4*M))
    i = bisect.bisect_left(A, thres)
    return "Yes" if len(A)-i >= M else "No"
    

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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

z = sum(a)*(1/(4*m))
count = 0
for i in a:
    if i >= z:
        count = 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()))
A.sort(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 = sorted(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:
from collections import Counter

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

border = sum(arr) / (4 * m)
ans = len(list(filter(lambda x: x >= border, arr)))

print('Yes' if ans >= m else 'No')

Submission status: Accepted

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

A = list(map(int, input().split()))
S = sum(A)
x = S/(4*M)

count = 0

for i in A:
    if i >= x:
        count += 1

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

Submission status: Accepted

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


count = 0
for i in A:
    if i >= sum(A)/(4 * M):
        count += 1

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

Submission status: Accepted

Solution code:
list_NM = list(map(int, input().split())) #0:N,1:M
list_A = list(map(int, input().split())) 
i = 0
number_all = 0
N = list_NM[0]
M = list_NM[1]
while all:
    number_all += list_A[i]
    i += 1
    if(i==N):
        break
i = 0
kijun = number_all/(4*M)
flag = 0
while all:
    if(kijun<=list_A[i]):
        flag +=1
    i += 1

    if(i==N):
        break

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

Submission status: Accepted

Solution code:
val1 = input().split()
val2 = input().split()
total = 0
for votes in val2:
  total += int(votes)
thres = total * 1/4 / int(val1[1]) 
i = 0
for votes in val2:
  if int(votes) >= thres:
    i += 1
if i >= int(val1[1]):
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

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

MAX_VOTE_NUM = 1000

x = [-1] * MAX_VOTE_NUM
total_vote_num = 0
for i in range(n):
  x[a[i] - 1] = i
  total_vote_num += a[i]

popular_num = 0
for i in range(MAX_VOTE_NUM):
  index = MAX_VOTE_NUM - i
  if x[index - 1] != -1 and (index * 4 * m) >= total_vote_num:
    popular_num += 1

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N, M = map(int, input().split())
num = 0
As = [int(x) for x in input().split()]
s = sum(As)
for Ai in As:
    if Ai >= s/4/M:
        num += 1
if num >= 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)
result = []
for i in A:
    if i >= (total * (1/(4*M))):
        result.append(i)
if len(result) < M:
    print("No")
else:
    print("Yes")

Submission status: Accepted

Solution code:
def popularity(votes, N, M):

  total_votes = sum(votes)
  limit = total_votes / (4.0 * M)
  cnt = 0
  for vote in votes:
    if vote >= limit:
      cnt += 1
    if cnt >= M:
      return "Yes"

  return "No"
  
N, M = [int (x) for x in input().split()]
votes = [int (x) for x in input().split()]
print(popularity(votes, N, M))

Submission status: Accepted

Solution code:
def popularity(votes, N, M):
    
    total_votes = sum(votes)
    limit = total_votes / (4.0 * M)
    
    cnt = 0
    for vote in votes:
        if vote >= limit:
            cnt += 1
    
    if cnt >= M:
        return "Yes"
    
    return "No"
  
N, M = [int (x) for x in input().split()]
votes = [int (x) for x in input().split()]
print(popularity(votes, N, M))

Submission status: Accepted

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

Submission status: Accepted

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

list.sort(reverse=True)

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
def I(): return(list(map(int,input().split())))
n,m=I()
a=I()
t=math.ceil((1/(4*m))*sum(a))
c=0
for i in a:
	if i>=t:c+=1
print(["No","Yes"][c>=m])

Submission status: Accepted

Solution code:
n, m = map(int, input().split())
a = list(map(int, input().split()))
if len(list(filter(lambda x:x>=sum(a)/(4*m),a)))>=m:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
N,M = map(int,input().split())
A = map(int,input().split())
B = list(A)
C = sorted(B,reverse=True)
S = sum(B)
#print(S)
#print(C)
if C[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()))

s = sum(A)

cnt = len(list(filter(lambda x: x * M * 4 >= s, A)))

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

Submission status: Accepted

Solution code:
import numpy as np

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

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

Submission status: Accepted

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

total_votes = sum(A)

total_votes_checker = lambda M, i, total_votes: (False if i < (1 / (4 * M)) * total_votes else True)

A = list(filter(lambda i: total_votes_checker(M, i, total_votes), A))

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

Submission status: Accepted

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

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()))
sum=num=0
for i in a:
    sum+=i
for i in a:
    if i*m*4>=sum:
        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()))
a.sort(reverse=1)
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 = sorted(list(map(int,input().split())))
lim = sum(a)/(4*m)
cnt = 0
for i in a:
  if i >= lim:
    cnt += 1
if cnt >= m:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
import math

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

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

border = sum(A)*(1/(4 * M))

B=[i for i in A if i >= border]

if len(B) >= M:
  print("Yes")
  exit()
print("No")

Submission status: Accepted

Solution code:
n, m = map(int,input().split())
a = list(map(int,input().split()))
s = sum(a) #sにaの総投票数
a.sort(reverse=True) #aを降順にソート
if a[m-1] >= s*(1/(4*m)):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
def is_popular(products, reference):
	for p in products:
		if p < reference:
			return False
	
	return True


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

a.sort(reverse = True)
reference = sum(a) / (4.0 * m)

if is_popular(a[:m], reference):
	print('Yes')
else:
	print('No')

Submission status: Accepted

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

sumA=sum(A)

A.sort(reverse=True)

if A[M-1]>=sumA/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_po = sum(A)
p = [ i for i in A if i * 4 * M >= sum_po ]
if len(p) >= M :
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n,m = tuple(map(int,input().split()))
arr = [int(x) for x in input().split()]
total = sum(arr)
mm = total /(4*m)
mask  = [ x >= mm for x in arr]
if sum(mask) >= m:
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
input_line = input().split(" ")
N=int(input_line[0])
M=int(input_line[1])
count=0

input_line = input().split(" ")
total=0
for i in range(len(input_line)):
    total=total+int(input_line[i])

border=total/(4*int(M))

for i in range(len(input_line)):
    if int(input_line[i])>=border:
        count=count+1
    

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

# input_line=' '.join(input_line)

Submission status: Accepted

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

a.sort(reverse=True)

for i in range(m):
    if a[i] < sum(a)*(1/(4*m)):
        ans = "No"
        break

print(ans)

Submission status: Accepted

Solution code:
def resolve():
    a, b = map(int, input().split())
    input_data = [int(_) for _ in input().split()]
    input_data.sort(reverse=True)
    sum_data = sum(input_data)
    converge = sum_data * (1 / (4 * b))

    if(converge > input_data[b - 1]):
        print("No")
    else:
        print("Yes")


resolve()

Submission status: Accepted

Solution code:
import numpy as np

def main():
    args1, args2 = input().rstrip().split(' '), input().rstrip().split(' ')
    N, M = int(args1[0]), int(args1[1])
    items = np.array([int(val) for val in args2])
    items = np.sort(items)[::-1]
    items_sum = np.sum(items)
    bottom = items_sum / 4. / M
    
    if(items[M-1] >= bottom):
        print('Yes')
    else:
        print('No')
    
if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
def resolve():
    a, b = map(int, input().split())
    input_data = [int(_) for _ in input().split()]
    input_data.sort(reverse=True)
    sum_data = sum(input_data)
    converge = sum_data * (1 / (4 * b))

    if(converge > input_data[b - 1]):
        print("No")
    else:
        print("Yes")
resolve()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n,m = map(int,input().split())
list = [int(x) for x in input().split()]
sum=0
for i in list:
    sum+=i
resultList = []
for i in list:
    if(sum/4/m <= i):
        resultList.append(i)
if(len(resultList)>=m):
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:


n, m = map(int, input().split())
votes = [int(i) for i in input().split()]
z = sum(votes)
if sum(map(lambda x: x >= z / (4*m), votes)) >= 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
suma = sum(a_list)

for i in range(n):
  if a_list[i] >= (suma / (4*m)):
    count += 1
  
if count >= m:
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

cnt = 0

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

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

Submission status: Accepted

Solution code:
N, M = list(map(int, input().split()))
A = list(map(int, input().split()))
summ = 0
count = 0
for i in range(N):
    summ += A[i]

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

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline


n, m = map(int, input().split())
a = list(map(int, input().split()))
suma, cnt = sum(a), 0

for i in range(n):
    if a[i] >= suma / 4 / m:
        cnt += 1

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

if len([i for i in A if i >= sum(A)/4/N[1]]) >= N[1]:
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N,M=map(int,input().split())
A = list(map(int, input().split()))
select=0
for i in range(len(A)):
    if A[i]>=sum(A)*(1/(4*M)):
        select+=1
    
def ans(M,select):   
    if M<=select:
         return 'Yes'
    
    else:
         return 'No'

print(ans(M,select))

Submission status: Accepted

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

total_vote = 0
for a in list_a:
  total_vote += a
count = 0
for a in list_a:
  if a >= total_vote/(4*m):
  	count += 1
if count >= m:
  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()))
ans = 0
total = sum(A)
for i in range(N):
    if A[i]*4*M >= total:
        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()))
a.sort(reverse=True)

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

Submission status: Accepted

Solution code:
from sys import stdin
N, M = [int(_) for _ in stdin.readline().rstrip().split()]
A = sorted([int(_) for _ in stdin.readline().rstrip().split()], reverse=True)
if A[M-1] >= sum(A) / (4*M):
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
n,m = [int(x) for x in input().split()]
arr = [int(x) for x in input().split()]
res=0
total = sum(arr)
for x in arr:
  if x>=(1/(4*m))*total:
    res+=1
if res>=m:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
#https://atcoder.jp/contests/abc161/tasks/abc161_b
def main():
    n, m = map(int, input().split())
    a = list(map(int, input().split()))
    a.sort(reverse = True)
    s = sum(a)
    for i in range(m-1,-1, -1):
        if a[i]*4*m < s:
            print("No")
            return
    print("Yes")
if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import bisect
N, M = map(int, input().split())
A = list(map(int, input().split()))
A.sort(reverse = True)
thr = sum(A) / (4*M)
ans = 0
for i in A:
    if i >= thr:
        ans+=1
    else:
        break
if ans >= M:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
# coding: utf-8

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

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

for i in range(m):
    if max(v) < (sum/4/m):
        break
    count += 1
    v.remove(max(v))

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)
s = sum(a)
for i in range(m):
    if a[i] < s/(4*m):
        print("No")
        exit()
print("Yes")

Submission status: Accepted

Solution code:
t = list(map(int,input().split()))
a = list(map(int,input().split()))
s = sum(a)
count = 0

for i in range(t[0]):
    if a[i] >= s/(4 * t[1]):
        count += 1

if count >= t[1]:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
num=input().rstrip().split(" ")
N=int(num[0])
M=int(num[1])
date=input().rstrip().split(" ")
sum=0
for i in range(N):
  sum+=int(date[i])
for j in range(len(date)):
  date[j]=int(date[j])
date=sorted(date,reverse=True)
if (sum/4)/M<=int(date[M-1]):
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

s = As.sum()
th = s / (4 * M)
print("Yes") if (As >= th).sum() >= M else print("No")

Submission status: Accepted

Solution code:
#スペース区切りの整数の入力
N,M = map(int, input().split())

#スペース区切りの整数の入力リスト
A_list = list(map(int, input().split()))
A_list_sum = sum(A_list)


count = 0
aa = A_list_sum/(4*M)
#print(aa)
for  i in range(len(A_list)):
  #print(i)
  if(A_list[i]>=aa):
    count = count + 1
    #print(count)
    
if(count >= M):
  print("Yes")
else:
  print("No")
#print(A_list_sum)

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()))
total = sum(a)

count = 0
judge = lambda x: x >= total * (1 / (4 * m))
for vote in a:
  if judge(vote):
    count += 1
  if count >= m:
    print("Yes")
    exit()
print("No")

Submission status: Accepted

Solution code:
def main():
  n,m=map(int,input().split())
  a=list(map(int,input().split()))
  total=sum(a)
  a.sort()
  if a[-m]<total/(4*m):
    print("No")
  else:print("Yes")

if __name__ == "__main__":
  main()

Submission status: Accepted

Solution code:
N, M = [int(i) for i in input().split()]
A = [int(i) for i in input().split()]
minimum_votes = sum(A) * (1 / (4 * M))

eligible_products = [a for a in A if a >= minimum_votes]

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

Submission status: Accepted

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

x = (1 / (4 * M)) * sum(A)
A = [a for a in A if a >= x]

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()))

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

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

Submission status: Accepted

Solution code:
def main():
    N,M=map(int,input().split())
    str=list(map(int,input().split()))
    cal=sum(str)
    str.sort(reverse=True)

    for i in range(M):
        if str[i]<cal*(1/(4*M)):
            print("No")
            return

    print("Yes")
    return

main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
size, comp = input().split()
size = int(size)
comp = int(comp)
vote_list = list(map(int, input().split()))
data = len(list(filter(lambda x: x >=(sum(vote_list)/(4*comp)), vote_list)))
print("Yes" if data>=comp else "No")

Submission status: Accepted

Solution code:
def B():
    NM=list(map(int,input().split()))
    A=list(map(int,input().split()))
    
    sum_A=sum(A)
    ans_list=list(filter(lambda x: x>=sum_A*(1/(4*NM[1])), A))
    
    if len(ans_list)>=NM[1]: print('Yes')
    else : print('No')
        
        
if __name__=='__main__':
    B()

Submission status: Accepted

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

n,m = readInts()
a = readInts()
s = sum(a)
cnt = 0
for i in range(n):
  if a[i]*4*m >= s:
    cnt += 1
if cnt >= m: print("Yes")
else: print("No")