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())
score = list(map(int,input().split()))
score = sorted(score,reverse=True)
if score[M-1]*4*M < sum(score):
    print("No")
else:
    print("Yes")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
N, M = map(int, input().split())
A = list(map(int, input().split()))

A_sum = sum(A)
Flag = A_sum / (4 * M)
A_fav = [i for i in A if i >= Flag]
#print(A_fav, Flag)
if len(A_fav) >= M:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
def calc():
    summ  = sum(A)
    low = summ / (4*M)
    newlist = [i for i in A if i >= low]
    num = len(newlist)
    
    if M <= num:
        print ("Yes")
    else:
        print ("No")

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

#N, M = 5, 2
#A = [110, 2, 20, 10, 0]
calc()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#def calc():
    #summ  = sum(A)
    #print(summ)
    
    #low = summ / (4*M)
    #print(low)

    #newlist = [i for i in A if i >= low]
    #print(newlist)

    #num = len(newlist)
    #print(num)

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

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

#N, M = 5, 2
#A = [110, 2, 20, 10, 0]
#calc()

S = sum(A)
cnt = 0

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

Submission status: Accepted

Solution code:
import sys

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")
        sys.exit()
print("No")

Submission status: Accepted

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

new_a=sorted(a,reverse=True)
sums=sum(a)

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
import math
num, m = map(int,input().split())
list = [int(x) for x in input().split()]


count = 0

for i in range(num):
    if list[i] < sum(list)/(4*m):
        None
    else:
        count += 1

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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



def check(A,M):
    flag = 0
    condition = sum(A)/(4*M)
    if(M==1 and max(A)>condition):
        return "Yes"
    for i in A:
        if(i < condition):
            continue
        elif(i >= condition):
            flag+=1
            if(flag==M):
                return "Yes"
    return "No"

print(check(A,M))

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(300000)

def I(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LMI(): return list(map(int, sys.stdin.readline().split()))
MOD = 10 ** 9 + 7
INF = float('inf')


N, M = MI()
A = LMI()

s = sum(A)
print('Yes' if len(list(filter(lambda x: 4 * x * M >= s, A))) >= M else 'No')

Submission status: Accepted

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

Submission status: Accepted

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

num = sum(A)/4/M
cur = 0
for a in A:
    if a >= num:
        cur += 1
        if cur == M:
            print('Yes')
            sys.exit()
print('No')

Submission status: Accepted

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

A.sort(reverse=True)

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

Submission status: Accepted

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

Submission status: Accepted

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

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

lmt = sum(P) / (4*m)

if lmt <= P[-1*m]:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# N, Mの入力
N, M = map(int, input().split())

# 得票数の入力
A = list(map(int,input().split()))

# 総得票数
total = sum(A)

# 得票数が1/4M以上の商品数のカウント
cnt = 0
for n in A:
    if (n >= total/(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()))
a.sort(reverse=True)

cnt=0
for j in range(n):
    cnt+=a[j]

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

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

Submission status: Accepted

Solution code:
def main(n: int, m: int, a: list):
    ans = 0
    base = sum(a) / (4 * m)

    for i in a:
        if i >= base:
            ans += 1

        if ans >= m:
            print("Yes")
            return

    print("No")


if __name__ == "__main__":
    n, m = map(int, input().split())
    a = list(map(int, input().split()))

    main(n, m, a)

Submission status: Accepted

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

A_sum =sum(A)

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

a.sort(reverse=True)

vote = sum(a)

if a[m-1] >= vote*1/(4*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()]

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

count = 0
for a in A:
    if a >= point:
        count += 1

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

Submission status: Accepted

Solution code:
n,b= map(int, input().split())
 
a= list(map(int, input().split()))
 
new_list = sorted(a, reverse=True)
sums = sum(a)

if new_list[b-1] >= sums/(b*4):
    	print("Yes")
else:
    	print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
NM = [int(_) for _ in input().split()]
N = NM[0]
M = NM[1]

A = [int(_) for _ in input().split()]

def solve(N, M, A):
    
    d = sum(A) / (4 * M)
    
    a = [i for i in A if i>=d ]
    
    if  len(a) >= M:
        return "Yes"
    else:
        return "No"

print(solve(N, M, A))

Submission status: Accepted

Solution code:
nmlist = list(map(int, input().split()))
svote = list(map(int, input().split()))
allvote = sum(svote)
maxvote = max(svote)
svote.sort(reverse=True)
n0 = nmlist[1] - 1
n1 =  svote[n0] / allvote
n2 = 1 / (4 * nmlist[1])
if n1 >= n2:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
N, M = map(int, input().split())
votes = list(map(int, input().split()))
min_votes = sum(votes) * 1.0 / (4*M)
votes_greater_than_min = list(filter(lambda x: x >= min_votes, votes))
if len(votes_greater_than_min) >= 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(4*M*A[M-1]>=s):
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
import math
N,M = (int(y) for y in input().split())
A = list(map(int, input().split()))
X = math.ceil(sum(A)/(4*M))
B = [i for i in A if i >= X]

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

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
N,M = map(int, input().split())
#print(M)
S = list(map(int,input().split()))
S.sort(reverse=True)
#print(S)
L = len(S)
SUM = sum(S)
#print(SUM)
#print(L)
#print(S[M-1])
if S[M-1] / SUM >= 1/(4*M):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
i1 = input()
i1 = i1.split()
types = int(i1[0])
select = int(i1[1])

i2 = input()
i2 = [int(n) for n in i2.split()]
i2.sort(reverse=True)

summary = sum(i2)
threshold = summary / (select * 4)
#print("i2=", i2)
#print("summary=", summary)
#print("threshold=", threshold)

if i2[select-1] < threshold :
    print("No")
else:
    print("Yes")

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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

C = map(int, input().split())

A = list(C)

#if N < M:
#    print('No')
#if M == 0:
#    print('No')

B = []
for i in range(len(A)):
    if A[i] >= sum(A)/4/M:
        B.append(1)
    else:
        B.append(0)

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

Submission status: Accepted

Solution code:
import sys
input = lambda: sys.stdin.readline().rstrip()
yes = lambda boolean: print('Yes') if boolean else print('No')
input_ints = lambda: list(map(int, input().split()))
 
N, M = input_ints()
A = input_ints()
A.sort(reverse=1)
yes(A[M-1]*4*M>=sum(A))

Submission status: Accepted

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


'''

'''

import numpy as np

N, M = map(int, input().split())
a = list(map(int, input().split()))
a = np.array(a)
s = int(a.sum())
level = 1 / (4 * M)
# print(a)
# print(level)

cnt = (a >= level * s).sum()

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

Submission status: Accepted

Solution code:
num, choice = map(int, input().split())
tmp = input().split()
product_list = [int(s) for s in tmp]
product_list.sort(reverse=True)
sum = 0
for i in range(num):
    sum += product_list[i]
if product_list[choice-1] >= sum/(choice*4):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
def has_duplicates2(seq):
    seen = []
    unique_list = [x for x in seq if x not in seen and not seen.append(x)]
    return len(seq) != len(unique_list)

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

NGcount = 0
sumA = sum(A)
Z = -(-sumA // (4 * M))

for x in range(M):
    if A[x] < Z:
        NGcount = NGcount + 1

if M > N:
    print('No')
elif has_duplicates2(A):
    print('No')
elif min(A) == 0:
    print('No')
else:
    if NGcount == 0:
        print('Yes')
    else:
        print('No')

Submission status: Accepted

Solution code:
import math
def RA():
    l = input().split()
    return [int(i) for i in l]
 
[n, m] = RA()
votes = RA()
 
s = [0] * 1001
for v in votes:
  s[v] = 1
 
start = math.ceil(sum(votes)/(4 * m))
count = 0
for i in range(start, 1001):
  if s[i] == 1:
    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()))

A.sort(reverse = True)
if M > 1:
    for i in range(M):
        if A[i] >= sum(A)*(1/(4*M)):
            del[i]
        else:
            print('No')
            exit()
    print('Yes')
elif M == 1:
    if A[1] >= sum(A)*(1/(4*M)):
        print('Yes')
    else:
        print('No')

Submission status: Accepted

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

cnt = 0
sum1 = sum(A)
p = 1/(4*M)

for i in range(len(A)):
    A[i] = A[i]/sum1

for i in A:
    if i >= p:
        cnt = 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()))
popular = 0
for i in range(n):
    if a[i] >= sum(a) / (4 * m):
        popular += 1

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

Submission status: Accepted

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

Submission status: Accepted

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

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

ans = N - x

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

Submission status: Accepted

Solution code:
n, m = map(int, input().split())
a = list(map(int, input().split()))
total = sum(a)
div = 4 * m
limit = total / div
a.sort()
a.reverse()
ans = True
for i in range(m):
    if a[i] < limit:
        ans = False
        break

if ans:
    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)
u = s / (4*m)
c = 0
for i in a:
    if i >= u: 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()))


t = 0
check=False
for x in range(len(a)):
  t += a[x]

for i in reversed(range(len(a))):
  for j in range(i):
    if(a[j] < a[j+1]):
      a[j], a[j+1] = a[j+1],a[j]

for y in range(m):
  if(a[y] >= t/(4*m)):
    check = True
  else:
    check=False
    break

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def swap(a,b):
  return b,a
n,m = map(int,input().split())
arr = list(map(int,input().split()))
sum = 0
for i in arr:
  sum += i
sum = sum/(4*m)
count=0
for i in arr:
  if (i>=sum):
    count+=1
if (count>=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()))
m = 0
s = sum(A)
for i in range(N):
  if A[i] < math.ceil(s/(4*M)):
    pass
  else:
    m += 1

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

Submission status: Accepted

Solution code:
_, M = map(int,input().split())
A = list(map(int,input().split()))
sum_A = sum(A)
count = 0
result = "No"
for i in A:
    if i >= sum_A * 1/(4*M):
        count += 1
    if count == M:
        result = "Yes"
        break
print(result)

Submission status: Accepted

Solution code:
def num():
    n,m=map(int,input().split())
    a=list(map(int,input().split()))
    a=sorted(a,reverse=True)
    for i in range(m):
        if a[i]<(sum(a)/(4*m)):
            # print(sum(a)/12)
            return "No"
    return "Yes"
print(num())

Submission status: Accepted

Solution code:
n,m=map(int,input().split())
List=[int(i) for i in input().split()]
s=sum(List)
for i in range(m):
    a=max(List)    
    if a>=s*(1/(4*m)):
        del List[List.index(a)]
        a=1
       
    else:
        
        a=0

print('Yes' if a==1 else 'No')

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

b = 0

for num in range(0,li[0]):
    b += la[num]

c = b/4/li[1]

d = 0

for i in range(0,li[0]):
    if la[i] >= c:
        d += 1

if d >= li[1]:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

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

num = 0;
th = sum(l)/(4*m);
for i in range(len(l)):
    if l[i] >= th:
        num += 1;
if num >= m:
    print('Yes');
else:
    print('No');

Submission status: Accepted

Solution code:
f=lambda:map(int,input().split());_,m=f();l=sorted(f());print('YNeos'[l[-m]*4*m<sum(l)::2])

Submission status: Accepted

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

a = len(m)
sum = 0
for i in range(a):
  sum += int(m[i])

item2 = []
for i in range(a):
  item2.append(int(m[i]) / sum)

ans = 1 / (4 * int(n[1]))

item3 = []
for i in range(a):
  if item2[i] >= ans:
    item3.append(item2[i])

if int(n[1]) <= int(len(item3)):
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:

n, m = (int(x) for x in input().split())
a_list = list(map(int, input().split()))

border = sum(a_list) / (4 * m)

# print('border')
# print(border)

count = 0

for i in range(len(a_list)):

    # print('a_list')
    # print(a_list[i])

    if border <= a_list[i] :
        # print('カウント!')
        count = count + 1

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N, M = map(int, input().split())
a_list =  list(map(int, input().split()))
a_list.sort(reverse = True)
a_total = sum(a_list)
count = 0
for voted in a_list[:M]:
  if voted < (1/(4*M))*a_total:
    print("No")
    break
else:
  print("Yes")

Submission status: Accepted

Solution code:
n, m = map(int, input().split())
a_list = input().split()
a_sum = 0
for i in range(len(a_list)):
    a_list[i] = int(a_list[i])
    a_sum += a_list[i]
a_list.reverse()
 
ok_num = 0
kijyun = int(a_sum/(4*m))
if a_sum % (4*m) == 0:
    kijyun -= 1
for i in a_list:
    if i > kijyun:
        ok_num += 1
    if ok_num == m:
        print('Yes')
        quit()
print('No')

Submission status: Accepted

Solution code:
n,m = (int(x) for x in input().split())
list = (input().split())
for i in range(len(list)):
  list[i] = int(list[i])
la = sorted(list, reverse=True)
sum = 0
for i in range(len(list)):
  sum += list[i]
if la[m-1]<sum/(4*m):
  print('No')
else:
  print('Yes')

Submission status: Accepted

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

v = sum(A) / 4.0 / M

c = 0
for i in range(N):
    if A[i] >= v:
        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()))
c = sum(a)/(4*m)
ans = sorted(a, reverse=True)
ans_0 = ans[:m]
if min(ans_0) < c:print('No')
else:print('Yes')

Submission status: Accepted

Solution code:
from sys import stdin
N,M = map(int,input().split())
A=  [int(x) for x in stdin.readline().rstrip().split()]
A.sort()
s = sum(A)
if ( s / (4 * M) > A[-M]) :
  print("No")
else:
  print("Yes")

Submission status: Accepted

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

arr.sort()
arr.reverse()

ans=0
total=sum(arr)
#print(total)
for i in range(m):
    if(arr[i]>=(total/(4*m))):
        ans+=1

#print(ans)
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()))
S=sum(A)
c=0

for i in A:
    if (1/(M*4)) <= (i/S):
        c+=1
print("Yes" if M<=c else "No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def inputs(): return [int(x) for x in input().split()]
n,m = inputs()
A = inputs()
A = sorted(A,reverse=True)
cnt = 0
a = sum(A)
for i in A:
    if a<=i*4*m:
        cnt+=1
if m<=cnt:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
import sys

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

total_votes = sum(A)
threshold = total_votes * (1 / (4 * M))

chooseable = 0

for a in A:
  if a >= threshold:
    chooseable += 1
    if chooseable >= M:
      print("Yes")
      sys.exit(0)

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 i in a:
    if (i * 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()))
check = ((1 / (4 * M)) * sum(A))
x = 0
for item in A:
    if item < check:
        x += 1
ans = N - x
if ans >= M :
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

n = M - 1
K = sum(A)

if A[n] < K / (4 *M):
  print('No')
else:
  print('Yes')

Submission status: Accepted

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

#print(lists)
sums = sum(lists)/4/m
#print(sums)
lens = len(lists)
state = 0
for i in range(m):
    if lists[lens-1-i] < sums:
        state = 1        
        break
if state ==1:
  	print("No")
else:
  	print("Yes")

Submission status: Accepted

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

Submission status: Accepted

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

c = 0
m = sum(A)/(4.0*M)
for a in A:
    if a >= m:
        c += 1

if c >= M:
    print "Yes"
else:
    print "No"

Submission status: Accepted

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

#print(M)
A.sort()
#print(A)
limit = sum(A)/(4*M)
#print(limit)
count = 0
for i in range(N):
    if A[i] >= limit:
        count +=1

#print(count)

#print(N-n-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()))

zenbu = sum(A)
waruno = 4 * M
joken = zenbu / waruno

ninki = sum( i >= joken for i in A)

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

Submission status: Accepted

Solution code:
import numpy as np
n, m = list(map(int,(input().split())))
a = np.array(list(map(int,(input().split()))))

all_b = sum(a)
t = 1/(4*m)*all_b
#all_t =a*t

ans = np.where(a>=t)
#print(ans)
#print(all_b[all_b >t])
#print(all_b,t)
#print(len(ans[0]))
if len(ans[0]) >= m:
  print('Yes')
else:
  print('No')

Submission status: Accepted

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

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

if A[nm[1]-1] >= s/4/nm[1]:
    print("Yes ")
else:
    print("No ")

Submission status: Accepted

Solution code:
#coding: utf-8
A = list(map(int, input().split()))
B =	list(map(int, input().split()))
num = A[0]
jud = A[1]
all = sum(B)
n = 0
C = 0
AN = 0

while n < num :
	AN = B[n]
	n += 1
    
	if AN < all / (jud*4):
		continue
	
	else:
		C += 1
    
if C >= jud:
	print("Yes")
else:
	print("No")

Submission status: Accepted

Solution code:
N, M = map(int, input().split())
A = sorted(map(int, input().split()), reverse=True)
# print(A)
v_min = sum(A) / (4 * M)
# print(v_min)
cnt = 0
for item in A:
    if item >= v_min:
        cnt += 1
    else:
        break
if cnt >= M:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
import numpy as np
l_input = [int(e) for e in input().split()]
A = [int(e) for e in input().split()]
A = np.array(A)
N = l_input[0]
M = l_input[1]
A_dash = A-1/(4*M)*sum(A)
cnt = 0
for i in A_dash:
    if i >=0:
        cnt += 1
if cnt >= M:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

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

A = []
kosuu = 0

tmp = input().split()
for i in range(N):
  A.append(int(tmp[i]))

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

for i in A:
  if i >= tmp:
    kosuu += 1

if kosuu >= 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)
X = 4*M
 
lr = [i for i in l if i >= S/X]
 
if len(lr) >= M:
  	print("Yes")
else:
  	print("No")

Submission status: Accepted

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

aaa.sort(reverse=True)
result = [0]*b
for i in range(b):
    h = aaa[i]
    j = sum(aaa) / (4*b)

    if h >= j:
        result[i] = 1
    else:
        result[i] = 0

if result.count(1) >= b:
    ans = "Yes"
else:
    ans = "No"

print(ans)

Submission status: Accepted

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

def unko(A,M):
    for i in range(M):
        if A[i]< sum(A)/(4*M):
            return print("No")
    print("Yes")
unko(A,M)

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
n=input().split()
N=int(n[0])
M=int(n[1])
a=input().split()
#print(a)
a = [int(i) for i in a] 
b=sum(a)/(4*M)
c=sorted(a)[Ｍ*-1]
if  b <= c :
     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)
cnt = 0
for i in range(0, N):
    if A[i] < (total/(4*M)):
        continue
    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)
itemList = list(map(int, input().split()))
itemList.sort()
index = -1
answer = True
for i in range(M):
  if itemList[index] < (sum(itemList)*(1/(4*M))):
    answer = False
    break
  index -= 1
  
if answer:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
import sys
 
stdin = sys.stdin
 
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  # ignore trailing spaces

n,m = na()
ar = na()
sm = sum(ar)
cnt = 0
for A in ar:
    if A*4*m >= sm:
        cnt += 1
print('Yes' if cnt >= m else 'No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys


def main(argv):
    n, m = [int(i) for i in sys.stdin.readline().rstrip("\n").split(" ")]
    a = [int(i) for i in sys.stdin.readline().rstrip("\n").split(" ")]
    s = sum(a)
    items = list(filter(lambda i: True if i >= s / (4 * m) else False, a))
    print("Yes" if len(items) >= m else "No")
    return 0
    
    
if __name__ == "__main__":
    sys.exit(main(sys.argv))

Submission status: Accepted

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

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

total = sum(votes)

cnt = 0

for vote in votes:
    if vote >= total*(1/(4*m)):
        cnt += 1

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

Submission status: Accepted

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

t = sum(a)

a = sorted(a)

chosen = a[-m:]

r = 1 / (4 * m) * t

ans = 'Yes'

for a in chosen:
    if a < r:
        ans = 'No'

print(ans)

Submission status: Accepted

Solution code:
n,m= map(int, input().split())
A = list(map(int, input().split()))
b=sum(A)
c=1/(4*m)*b
d=[i for i in A if i>=c]
e=len(d)
if e>=m:
    print("Yes")
else:print("No")

Submission status: Accepted

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