Problem:


Score : 200 points

Problem Statement

We have held a popularity poll for N items on sale. Item i received A_i votes.

From these N items, we will select M as popular items. However, we cannot select an item with less than \dfrac{1}{4M} of the total number of votes.

If M popular items can be selected, print Yes; otherwise, print No.

Constraints

1 \leq M \leq N \leq 100

1 \leq A_i \leq 1000

A_i are distinct.

All values in input are integers.

Input

Input is given from Standard Input in the following format:

N M
A_1 ... A_N

Output

If M popular items can be selected, print Yes; otherwise, print No.

Sample Input 1

4 1
5 4 2 1

Sample Output 1

Yes

There were 12 votes in total. The most popular item received 5 votes, and we can select it.

Sample Input 2

3 2
380 19 1

Sample Output 2

No

There were 400 votes in total. The second and third most popular items received less than \dfrac{1}{4\times 2} of the total number of votes, so we cannot select them. Thus, we cannot select two popular items.

Sample Input 3

12 3
4 56 78 901 2 345 67 890 123 45 6 789

Sample Output 3

Yes



Sample input:
4 1
5 4 2 1


Sample output:
Yes

Submission status: Accepted

Solution code:
n, m = map(int, input().split())
List = list(map(int, input().split()))
"""
入力
"""

sort = sorted(List)[::-1]
"""
昇順にソート
"""
ans = sort.pop(m - 1)
sum = sum(List)
if ans >= sum / (4 * m):
    print("Yes")
else:
    print("No")




"""
print(n)
print(m)
print(List)
print(sort)
print(ans)
"""

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n,m = map(int, input().split())
nums = [int(i) for i in input().split()]
tot = 0
for i in nums:
  tot+= i
cons = tot/(4*m)
count = 0
for i in nums:
  if i>= cons:
    count+=1
if count>= m:
  print('Yes')
else:
  print("No")

Submission status: Accepted

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

A.sort()
A.reverse()

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

Submission status: Accepted

Solution code:
data = input().split()
 
n = int(data[0])
m = int(data[1])
 
pro = [int(s) for s in input().split()]
 
vote = 0
for i in pro:
  vote += i
 
s_pro = sorted(pro, reverse=True)

if s_pro[m - 1] < vote * 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()))
total = sum(A)
cutoff = total/(4*M)

over=[]
for i in A:
    if i>=cutoff:
        over.append(i)

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

Submission status: Accepted

Solution code:
from sys import stdin
def main():
    #入力
    readline=stdin.readline
    N,M=map(int,readline().split())
    A=list(map(int,readline().split()))
    
    A.sort(reverse=True)
    S=sum(A)
    if 4*M*A[M-1]>=S:
        print("Yes")
    else:
        print("No")
if __name__=="__main__":
    main()

Submission status: Accepted

Solution code:
#!/usr/bin/python3

import sys
# input = sys.stdin.readline
sys.setrecursionlimit(100000)
INF = float('inf')
MOD = 10**9+7
EPS = 10**-7

#N = int(input())
#A = [int(x) for x in input().split()]
#V = [[0] * 100 for _ in range(100)]

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

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

ans = 0
minimum = sum(a) / (4*m)

for i in a:
    if i >= minimum:
        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()))

s=sum(a)

l=s/(4*m)

# print(a,s,l)
a.sort(reverse=True)
if(a[m-1]>=l):
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

sumBy4 = sumA/(4*m)

count = 0

for i in range(n):
    if(a[i] < sumBy4):
        continue

    else:
        count += 1

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

else:
    print("No")

Submission status: Accepted

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

arr.sort(reverse=True)
sum_arr = sum(arr)
flag = True

b = sum_arr/(4*m)
for i in range(m):
    if arr[i] < b:
        flag = False
        break
if flag:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
import numpy as np
n_m = [int(i) for i in input().split()]
ai = np.array([int(i) for i in input().split()])
n = n_m[0]
m = n_m[1]
asum = ai.sum()
thread = asum / (4 * m)
real_m = 0
for a in ai:
  if a < thread:
    continue
  else:
    real_m += 1
print("No") if real_m < m else print("Yes")

Submission status: Accepted

Solution code:
b = list(map(int, input().split()))
n = b[0]
m = b[1]
a = list(map(int, input().split()))
sum = sum(a)
a = sorted(a, reverse=True)

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

Submission status: Accepted

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

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

Submission status: Accepted

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

total = sum(votes)

c = 0
threshold = 1 / (4 * m) * total
for v in votes:
    if c == m:
        break
    if v >= threshold:
        c += 1
if c == m:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

limit = sum(a)/(4*m)
canselect = True
for i in range(0, m):
    if a[i] < limit:
        canselect = False

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

Submission status: Accepted

Solution code:
N, M = list(map(int, input().split()))
A = list(map(int, input().split()))
count = N
X = sum(A)
for a in A:
  if a < X / (4 * M):
    count -= 1
if count < 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)

ok = True

for i in range(m):
    if a[i] * 4 * m < sum(a):
        ok = False

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import numpy as np

n ,m = map(int, input().split())
a = np.array(list(map(int, input().split())))
t = a >= a.sum() * 1/(4*m)
if t.sum() >= 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)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
nm = input().split(" ")
n = int(nm[0])
m = int(nm[1])
 
a = input().split(" ")
 
total = 0
for v in a:
  total += int(v)
  
mv = total / (4 * m)
q = 0
for e in a:
  e = int(e)
  if e >= mv:
    q += 1
    
if q >= m:
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

for A_i in A:
    if A_i >= criteria:
        popular_items += 1
        
if popular_items >= M:
    ans = 'Yes'
else:
    ans = 'No'
    
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
from functools import reduce
input = sys.stdin.readline

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

a.sort(reverse=True)
a_sum = reduce((lambda x,y: x+y), a)
a_min = a_sum * (1/(4*m))

if (a[m-1] >= a_min):
  print('Yes')
else:
  print('No')

Submission status: Accepted

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

bool = True
for i in range(M):
    if sorted(A, reverse=True)[i] < sum(A)*(1/(4*M)):
        # print(f'{i}: {sorted(A,reverse=True)[i]} | {sorted(A,reverse=True)[i]} < {sum(A)*(1/(4*M))}')
        bool = False
    else:
        # print(f'{i}: {sorted(A,reverse=True)[i]} | {sorted(A,reverse=True)[i]} >= {sum(A)*(1/(4*M))}')
        pass

if bool == True:
    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()]
t = sum(a)

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

if c >= 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()))
cnt = 0
for Ai in A:
    k = 1/(4*M)
    if (sum(A))*k <= Ai:
        cnt += 1
if cnt >= M:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

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

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

result = 'Yes' if sel >= m else 'No'
print(result)

Submission status: Accepted

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

Submission status: Accepted

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

total_vote = sum(a)

popular = [p for p in a if p >= total_vote/4/m]

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

Submission status: Accepted

Solution code:
"""
B-Popular Vote
"""

import sys
input = sys.stdin.readline
from collections import Counter, deque


INF = float('inf')


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

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

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

l = list(x for x in a if x >= (sum(a)/(4*m)))

print("Yes" if len(l) >= m else "No")

Submission status: Accepted

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

import sys

N, M = [int(x) for x in sys.stdin.readline().strip().split()]
votes = [int(x) for x in sys.stdin.readline().strip().split()]

thres = sum(votes) / (4.0 * M)
cnt = 0
for v in votes:
    if v >= thres:
        cnt += 1

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

Submission status: Accepted

Solution code:
from math import ceil

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

a.sort(reverse=True)

thold = ceil(sum(a) / (4 * m))

if a[m-1] < thold:
    print('No')
else:
    print('Yes')

Submission status: Accepted

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

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

Submission status: Accepted

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

threshold = mer_sum / (4 * M)
mer_over = [1 if i >= threshold else 0 for i in MER]
mer_threshold = sum(mer_over)

if M <= mer_threshold:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
n,m=map(int,input().split())
A=[int(_) for _ in input().split()]
sum_a=sum(A)
A_x=[a for a in A if a>=sum_a/(4*m)]
if m<= len(A_x):print("Yes")
else:print("No")

Submission status: Accepted

Solution code:
val1= input()
val2= input()
num1= list(map(int,val1.split()))
num2= list(map(int,val2.split()))
n= num1[0]
m= num1[1]
sumup=0;
for i in range(0,n):
    sumup= sumup+ num2[i]

border= sumup/ (4* m)
judge=0
for j in range(0,n):
    if num2[j] >= border:
        judge= judge + 1
if judge >= m:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

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

S = 0

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

m = 0
for j in range (0 , N):
	if A[j] >= (S / ( 4 * M )):
		m = m + 1

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
x = input()
y = input()

n_num = int(x.split()[0])
m_num = int(x.split()[1])
y = y.split()
sum = 0
count = 0

for i in range(0, n_num):
    y_num = int(y[i])
    sum = sum + y_num

for i in range(0, n_num):
    y_num = int(y[i])
    rate = 1 / (4 * m_num)
    if y_num < sum * rate:
        count = count + 1
    else:
        count

if (n_num - m_num) < count:
    print('No')
else:
    print('Yes')

Submission status: Accepted

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

for a in anything:
    if a >= 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())
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=[int(i) for i in input().split()]

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

Submission status: Accepted

Solution code:
N ,M = map(int, input().split())
List = list(map(int, input().split()))
stand = 1 / (4 * M) * sum(List)
arr = []
for i in range(len(List)):
  if List[i] >= stand:
    arr.append(List[i])
if len(arr) >= M:
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

Submission status: Accepted

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

to = 0
s = sum(a)

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
l=sorted(list(map(int,input().split())))
l.reverse()
m=l[0:b]
t='Yes'
for i in m:
    if i<sum(l)*(1/(4*b)):
        t='No'
        break
print(t)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import numpy as np 

kind, popular = map(int, input().split(" "))
data = np.array(input().split(" "), dtype=np.int)
level = np.sum(data) / (4 * popular)
count = 0
for i in range(kind):
    if data[i] >= level:
        count += 1
        
if count >= popular:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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




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


judge = True

for i in range(m):
    if (total / (4*m)) <= A[i]:
        continue
    else:
        judge = not judge
        break

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N,M = map(int, input().split())
x = list(map(int, input().split()))
total_vote = sum(x)
count = 0
for y in x:
    if y >=(total_vote/(4*M)):
        count+=1
      
if count>=M:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
input_line = input()

inputs = input_line.split(' ')
N, M = [int(s) for s in inputs]
input_line = input()
inputs = input_line.split(' ')
A = [int(s) for s in inputs]
A = sorted(A, reverse=True)
a_tot = sum(A)
fg = True
for i in range(M):
    if A[i] < a_tot/(4*M):
        fg = False
if fg:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

if sorted(hoge)[-M] >= sum(hoge)/(4*M):
  print('Yes')
else:
  print('No')

Submission status: Accepted

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

if sorted(hoge)[-M] >= sum(hoge)/(4*M):
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7
 
N, M  = MAP()
A = LIST()
sum_A = sum(A)
c = 0
 
for i in range(N):
  if A[i] >= sum_A/4/M:
    c = c+1
      
if c >= M:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N, M = MAP()
A = LIST()
sum_A = sum(A)
if sum([x >= sum_A/(4*M) for x in A]) >= M:
  		print("Yes")
else:
  		print("No")

Submission status: Accepted

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

cnt = 0
for i in range(n):
    tmp = num.pop(num.index(max(num)))
    if tmp >= sum_num*1/(4*m):
        cnt += 1

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

Submission status: Accepted

Solution code:
# 2309

inputted = list(map(int, input().split()))
N = inputted[0]
M = inputted[1]
A = list(map(int, input().split()))

total_votes = sum(A)
can_select = lambda votes: not (votes < total_votes / (4 * M))
answer = 'Yes' if len(list(filter(can_select, A))) >= M else 'No'

print(answer)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
N, M = list(map(int, input().split()))
a = list(map(int, input().split()))

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:
n_m = [int(n) for n in input().split()]
N = n_m[0]
M = n_m[1]

votes = [int(n) for n in input().split()]

total_votes = sum(votes)
thresh = total_votes / (4 * M) #better with mult?

count = 0

for A in votes:
    if 4*M*A >= total_votes:
        count += 1
    if count >= M:
        print('Yes')
        break

if count < M:
    print('No')

Submission status: Accepted

Solution code:
n,m = map(int, input().split())
a = list(map(int, input().split()))
cnt = 0
s = sum(a)
for i in range(n):
    if 4*a[i]*m >= s:
        cnt += 1

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

Submission status: Accepted

Solution code:
from sys import stdin
N,M=list(map(int,(stdin.readline().strip().split())))
A=list(map(int,(stdin.readline().strip().split())))
hyou=(sum(A)/(4*M))
count=0
for i in range(N):
    if (A[i])<hyou:continue
    count+=1
if count>=M:print("Yes")
else:print("No")

Submission status: Accepted

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

A.sort(reverse=True)

T = (sum(A)/(4*M))
n = 0
for i in range(N):
    if A[i] < T:
        continue
    n += 1

if n >= 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 = 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:
nm_list = input().split()
n = int(nm_list[0])
m = int(nm_list[1])
a_list = input().split()
a = [int(item) for item in a_list]
a.sort(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)

flag = 1
for i in range(M):
  if total / (4 * M) <= items[i]:
    pass
  else:
    flag = 0
if flag:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
import sys
N, M = map(int, sys.stdin.readline().split())
A = list(map(int, sys.stdin.readline().split()))
sum_A = sum(A)
A.sort(reverse = True)

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

Submission status: Accepted

Solution code:
# import inbuilt standard input output  
from sys import stdin, stdout  
  
# suppose a function called main() and 
# all the operations are performed 
def main(): 
  
    # input via readline method 
    info_input = stdin.readline() 
    vote_input = stdin.readline() 

    info = [int(x) for x in info_input.split()] 
    votes = [int(x) for x in vote_input.split()] 

    n = info[0]; m = info[1]; 

    counter = 0 
    bound = 1/(4*m)
    total = sum(votes)

    votes.sort(reverse=True)

    for vote in votes:
    	if vote >= bound*total:
    		counter += 1
    		if counter == m:
    			return "Yes"
    	else:
    		return "No"

   
# call the main method 
if __name__ == "__main__": 
    print(main())

Submission status: Accepted

Solution code:
a,b = map(int, input().split())
List = list(map(int, input().split()))
c = sum(List)
List = sorted(List)[::-1]
d = List[b-1]
if d < c/4/b:
	print("No")
else:
	print("Yes")

Submission status: Accepted

Solution code:
# import inbuilt standard input output  
from sys import stdin, stdout  
  
# suppose a function called main() and 
# all the operations are performed 
def main(): 
  
    # input via readline method 
    info_input = stdin.readline() 
    vote_input = stdin.readline() 

    info = [int(x) for x in info_input.split()] 
    votes = [int(x) for x in vote_input.split()] 

    n = info[0]; m = info[1]; 

    counter = 0 
    bound = 1/(4*m)
    total = sum(votes)

    for vote in votes:
    	if vote >= bound*total:
    		counter += 1
    		if counter == m:
    			return "Yes"
    return "No"

   
# call the main method 
if __name__ == "__main__": 
    print(main())

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N,M=(int(a) for a in input().split());
A=input();
A=A.split()
B = [int(s) for s in A]
sum = sum(B)

line = sum/4/M
point = 0;
length = len(B);

for i in range(length):
    if B[i] >= line:
        point += 1;
    else:
        pass;
    
if point >= M:
    print("Yes");
else:
    print("No");

Submission status: Accepted

Solution code:
N,M = (int(a) for a in input().split());
A = input();

A = A.split();


B = [int(s) for s in A];

sum = sum(B)

line = sum/4/M
point = 0;
length = len(B);

for i in range(length):
    if B[i] >= line:
        point += 1;
    else:
        pass;
    
if point >= M:
    print("Yes");
else:
    print("No");

Submission status: Accepted

Solution code:
def pickup(vote, choice):
	flag = 0
	sum_vote = 0
	for i in vote:
		sum_vote = sum_vote + i
	for i in vote:
		if i >= sum_vote / (choice * 4):
			continue
		else:
			flag = flag + 1
	if  choice <= int(len(vote)) - flag:
		return 0
	else:
		return 1

numbers, choice = list(map(int, input().split()))

vote = [numbers - 1]
vote = list(map(int, input().split()))

if pickup(vote, choice) == 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]/sum(A)<0.25/m:
  print('No')
else:
  print('Yes')

Submission status: Accepted

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

i = list(map(int, input().split()))
a=[]
for x in range(n):
    a.append(i[x])
a.sort(reverse = True)
if a[m-1] >= sum(a)/(4*m):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
n=input().split()
m=input().split()

N=n[0]
Nn=n[1]
l = 0
a = 0

for k in range(int(N)):
    a+=int(m[k])

for i in range(int(N)):
    if int(m[i])/(a/(int(Nn)*4)) >= 1:
        l+=1

if l >= int(Nn) :
    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)
limit = all_A / 4.0 / M

count = 0
for a in A:
  if a >= 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()))
shreshold = sum(A)/(4*M)
ret = [a for a in A if a >= shreshold]
if len(ret) < M:
    print('No')
else:
    print('Yes')

Submission status: Accepted

Solution code:
A = list(map(int, input().split()))
votes = list(map(int, input().split()))
check = []
total = 0
for i in votes:
    total +=i
for i in votes:
  if i >= ((1/4)/A[1])*total:
    check.append(i)
if len(check) >= 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)
p=0
for i in range(n):
       if a[i]>=S/(4*m):
              p+=1
if p>=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)

Border = S/(4*M)

count = 0

for i in A:

    if(i>=Border):
        count +=1

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

else:
    print("No")