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: Wrong Answer

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

cnt = 0
for i in a:
	if i > asum / (4 * m):
		cnt = cnt + 1

	if (m==cnt):
		print('Yes')
		exit(0)

print('No')

Submission status: Wrong Answer

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: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from sys import stdin

n, m = [int(x) for x in stdin.readline().rstrip().split()]
a_list = [int(x) for x in stdin.readline().rstrip().split()]

pick = [ x for x in a_list if x >= sum(a_list) / 4 / m]

print("Yes" if len(pick) > m else "No")

Submission status: Wrong Answer

Solution code:
from sys import stdin

n, m = [int(x) for x in stdin.readline().rstrip().split()]
a_list = [int(x) for x in stdin.readline().rstrip().split()]

pick = [ x for x in a_list if x > sum(a_list) / 4 / m]

print("Yes" if len(pick) > m else "No")

Submission status: Wrong Answer

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

else:
  print("No")

Submission status: Wrong Answer

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

ans = 0
for i in A:
    if i >= vote/4*M:
        ans += 1

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

Submission status: Wrong Answer

Solution code:
n, m = map(int, input().split())
a = list(map(int, input().split()))
votes = sum(a)
selected = [i for i in a if i >= votes / (4 * m)]
print("Yes" if len(selected) > m else "No")

Submission status: Wrong Answer

Solution code:
if __name__ == '__main__':
    n, m = map(int, input().split())
    a = list(map(int, input().split()))
    bound = sum(a) // (4 * m)
    if len([i for i in a if i >= bound]) >= m:
        print("Yes")
    else:
        print("No")

Submission status: Wrong Answer

Solution code:
x,y = map(int,input().split())
li = list(map(int,input().split()))	
cnt = 0
for i in range(len(li)):
    if li[i] > sum(li) * (1/(4*y)):
        cnt += 1
else:
    pass

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

Submission status: Wrong Answer

Solution code:
x,y = map(int,input().split())
li = list(map(int,input().split()))	
cnt = 0
for i in range(len(li)):
    if li[i] > sum(li) * (1/float(4*y)):
        cnt += 1
else:
    pass

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

sum_a = (sum(int(i) for i in a))

if sum_a/(M*4) > float(sorted(a)[::-1][M-1]):
  print("No")
else:
  print("Yes")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

    A_SUM = sum(A_list)
    THRESHOLD = int(A_SUM * (1 / (4 * M)))

    count = 0
    for a in A_list:
        if THRESHOLD <= a:
            count += 1

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

if __name__ == "__main__":
    resolve()

Submission status: Wrong Answer

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

sum_list = sum(A_list)
n = sum_list*0.25*M

a = 0
for i in A_list:
    if i>=n:
        a+=1

if a>=M:
    print('Yes')
else:
    print('Yes')

Submission status: Wrong Answer

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

sum_list = sum(A_list)
n = sum_list*0.25*M

a = 0
for i in A_list:
    if i>=n:
        a+=1

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N, M=map(int,input().split())
alist = list(map(int,input().split()))
alist.sort(reverse = True)
su = 0
for i in alist:
    su += i
if alist[M-1] < 1/4*su:
    print("No")
else:
    print("Yes")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

s = sum(a)

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
s = [input() for i in range(2)]
n = int(s[0].split()[0])
m = int(s[0].split()[1])
a = list(map(int, s[1].split()))

sumVote = sum(a)
border = 1 / (4 * m)
select = 0
for item in a:
    if border <= item:
        select += 1
    if select == m:
        print("Yes")
        exit()
print("No")

Submission status: Wrong Answer

Solution code:
s = [input() for i in range(2)]
n = int(s[0].split()[0])
m = int(s[0].split()[1])
a = list(map(int, s[1].split()))

sumVote = sum(a)
border = 1 / 4 * m
select = 0
for item in a:
    if border <= item:
        select += 1
    if select == m:
        print("Yes")
        exit()
print("No")

Submission status: Wrong Answer

Solution code:
s = [input() for i in range(2)]
n = int(s[0].split()[0])
m = int(s[0].split()[1])
a = list(map(int, s[1].split()))

sumVote = sum(a)
border = 1 / 4 * m
select = 0
for item in a:
    if border < item:
        select += 1
    if select == m:
        print("Yes")
        exit()
print("No")

Submission status: Wrong Answer

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

ans = "Yes"
for i in range(M):
    if A[i] < sum_A // (4 * M):
        ans = "No"
        break

print(ans)

Submission status: Wrong Answer

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

ans = "Yes"
for i in range(M):
    if A[i] < sum_A // (4 * M):
        ans = "No"
        break

print(ans)
#print("N = {}, M = {}, A = {}".format(N, M, A))

Submission status: Wrong Answer

Solution code:
def resolve():
    n,m=map(int, input().split())
    l=list(map(int, input().split()))
    sou=sum(l)
    cnt=0
    l.sort(reverse=True)
    for i in range(n):
        if l[i]>=sou*1/(4*m):
            cnt+=1
    if cnt>m:
        print('Yes')
    else:
        print('No')
resolve()

Submission status: Wrong Answer

Solution code:

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

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

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

Submission status: Wrong Answer

Solution code:

def main():
  n, m = map(int, input().split())
  arr = tuple(map(int, input().split()))

  threshold = sum(arr) / (4 * m)

  ans = "Yes" if len(tuple(filter(lambda a: a > threshold, arr))) >= m else "No"

  print(ans)

main()

Submission status: Wrong Answer

Solution code:

def main():
  n, m = map(int, input().split())
  arr = tuple(map(int, input().split()))

  threshold = sum(arr) * m / 4

  ans = "Yes" if len(tuple(filter(lambda a: a > threshold, arr))) >= m else "No"

  print(ans)

main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

vote.sort(reverse=True)
popular = vote[0:m-1]
sum = sum(vote)

yes = True

for win in popular:
    if win < sum / (4*m):
        print('No')
        yes = False
        break

if yes:
    print('Yes')

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
n,m=[int(i) for i in input().split()]
list=[int(i) for i in input().split()]
x=1/(4*m)
count=0
for i in range(1,n+1):
  if list[i-1]>=x:
    count+=1

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

Submission status: Wrong Answer

Solution code:
n,m=[int(i) for i in input().split()]
list=[int(i) for i in input().split()]
x=1/(4*m)
count=0
for i in range(1,n+1):
  if list[i-1]>=x:
    count+=1

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n,m = map(int,input().split())
a = list(map(int,input().split()))
x = 1/(4*m)
count=0
#print(x)
for i in range(len(a)):
    if x > a[i]/sum(a):
        count+=1
if m < count:
    print("YES")
else:
    print("NO")

Submission status: Wrong Answer

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

N, M = map(int, input().split())
A = list(map(int, input().split()))
A.sort(reverse = True)
quart = sum(A) / N
for i in range(M):
    if A[i] < quart:
        print('No')
        exit()
else:
    print('Yes')

Submission status: Wrong Answer

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

import math

N, M = map(int, input().split())
A = list(map(int, input().split()))
A.sort(reverse = True)
quart = math.floor(sum(A) / N)
for i in range(M):
    if A[i] < quart:
        print('No')
        exit()
else:
    print('Yes')

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

flg = False
A.sort(reverse=True)
for i in range(M):
    if 1 / 4 * M <= A[i]:
        flg = True
    else:
        flg = False

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

Submission status: Wrong Answer

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

flg = False
A.sort(reverse=True)
for i in range(M):
    if 1 / 4 / M <= A[i]:
        flg = True
    else:
        flg = False

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

Submission status: Wrong Answer

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

flg = False
A.sort(reverse=True)
for i in range(M):
    if 1 / 4 / sum(A) <= A[i]:
        flg = True
    else:
        flg = False

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

Submission status: Wrong Answer

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

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

bool = True
for i in range(m):
    if a[i] >= min:
        continue
    else:
        bool = False

if bool == True:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import numpy as np
n, m = map(int, input().split())
A = np.array([int(i) for i in input().split()], dtype=int)
print('Yes' if np.sum(A >= 4*m) >= m else 'No')

Submission status: Wrong Answer

Solution code:
import numpy as np
n, m = map(int, input().split())
A = np.array([int(i) for i in input().split()], dtype=int)
print('Yes' if np.sum(A > 4*m) >= m else 'No')

Submission status: Wrong Answer

Solution code:
import numpy as np
n, m = map(int, input().split())
A = np.array([int(i) for i in input().split()], dtype=int)
A -= sum(A) // (4 * m)
print('Yes' if np.sum(A > 0) >= m else 'No')

Submission status: Wrong Answer

Solution code:
import numpy as np
n, m = map(int, input().split())
A = np.array([int(i) for i in input().split()], dtype=np.float64)
A -= sum(A) / (4 * m)
print('Yes' if np.sum(A > 0) >= m else 'No')

Submission status: Wrong Answer

Solution code:
n,m = map(int, input().split())
s = input()
t = s.rstrip().split(' ')
c = 0
for a in t:
  c += int(a)
d = 0
for a in t:
  if int(a) >= c:
    d += 1
if d < m:
  print('No')
else:
  print('Yes')

Submission status: Wrong Answer

Solution code:
line = input().rstrip().split(" ")
N = [str(i) for i in line]

vote = input().rstrip().split(' ')
V = [str(i) for i in vote]
flag = 0
C = N[0]
for i in range(int(C)):
  if int(V[i]) >= (1/(4*int(N[1]))):
    flag = flag + 1
    
if flag >= int(N[1]) :
    print("Yes")
    
else:
    print('No')

Submission status: Wrong Answer

Solution code:
line = input().rstrip().split(" ")
N = [str(i) for i in line]

vote = input().rstrip().split(' ')
V = [str(i) for i in vote]
flag = 0
C = N[0]
for i in range(int(C)):
  if int(V[i]) > (1/(4*int(N[1]))):
    flag = flag + 1
    
if flag >= int(N[1]) :
    print("Yes")
    
else:
    print('No')

Submission status: Wrong Answer

Solution code:
line = input().rstrip().split(" ")
N = [str(i) for i in line]

vote = input().rstrip().split(' ')
V = [str(i) for i in vote]
flag = 0
C = N[0]
for i in range(int(C)):
  if int(V[i]) > (1/(4*int(N[1]))):
    flag = flag + 1
    
if flag >= int(N[1]) or flag :
    print("Yes")
    
else:
    print('No')

Submission status: Wrong Answer

Solution code:
line = input().rstrip().split(" ")
N = [str(i) for i in line]

vote = input().rstrip().split(' ')
V = [str(i) for i in vote]
flag = 0
C = N[0]
for i in range(int(C)):
  if int(V[i]) > (1/(4*int(N[1]))):
    flag = flag + 1
    
if flag == int(N[1]):
    print("Yes")
    
elif flag != 1:
    print('No')

Submission status: Wrong Answer

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

S = sum(An)
A = [a for a in An if a * 4 * M >= S]

if len(A)>=M:
    print('Yes')
else:
    print('NO')

Submission status: Wrong Answer

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

S=sorted(An,reverse= True)
if S[M-1] > sum(An)/(4*M):
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
[N,M]=list(map(int,input().split()))
A=list(map(int,input().split()))
print(["No","Yes"][int(len (list(filter(lambda Ai:Ai>sum(A)/4/M,A)))>M-1)])

Submission status: Wrong Answer

Solution code:
N,M=map(int,input().split())
A=list(map(int,input().split()))
G=sum(A)/(4*M)
A.sort()
A.reverse()
m=0
i=0
while A[i]>G:
  m+=1
  if m==M:
    print("Yes")
    exit()
  i+=1
print("No")

Submission status: Wrong Answer

Solution code:
a=input()
b=input()
a=a.split()
b=b.split()
b=sorted(b, reverse=True)
c=0
for i in range(len(b)):
  c+=int(b[i])
for i in range(int(a[1])-1):
  del b[0]
if int(b[0])<c/(4*int(a[1])):
  print("No")
else:
  print("Yes")

Submission status: Wrong Answer

Solution code:
#import numpy as np
import math


def solve():
    tv = sum(a)
    min_votes = math.ceil(tv * 1/4 / m)
    print(min_votes)
    cnt = 0
    for ai in a:
        if ai>=min_votes:
            cnt+=1
    if cnt>=m:
        print("Yes")
    else:
        print("No")
    return


#s = input()

n, m = [int(i) for i in input().split(" ")]
a = [int(i) for i in input().split(" ")]
solve()

Submission status: Wrong Answer

Solution code:
#import numpy as np
import math


def solve():
    tv = sum(a)
    min_votes = math.ceil(tv * 1/4 * m)
    cnt = 0
    for ai in a:
        if ai>=min_votes:
            cnt+=1
    if cnt>=m:
        print("Yes")
    else:
        print("No")
    return


#s = input()

n, m = [int(i) for i in input().split(" ")]
a = [int(i) for i in input().split(" ")]
solve()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

else :
    print('No')

Submission status: Wrong Answer

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

p = sum(L)/4*M

cnt = 0
for i in range(N):
    if L[i] >= p:
        cnt += 1
    else:
        cnt += 0
if cnt >= M:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

sum = 0

item = 0

for i in range(len(vote)):
  sum += vote[i]

for i in range(len(vote)):
  if vote[i] >= 1 / 4*sum:
    item += 1

if item >= num[1]:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import numpy as np


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

min_ = sum(A) / (4*M)
item = sum(x>min_ for x in A)
print("Yes" if item>= M else "No")

Submission status: Wrong Answer

Solution code:
import numpy as np


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

min_ = sum(A) / (4*M)
item = sum(x>min_ for x in A)
print("Yes" if item>M else "No")

Submission status: Wrong Answer

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

ans = 'No'
count = 0
s = sum(A)
for a in A:
    if 4 * a * M > s:
        count += 1
        if count >= M:
            ans = 'Yes'
            break

print(ans)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

check=0
for a in A:
    if a>=limit:
        check+=1
if check>=M:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

check=0
for a in A:
    if a>=limit:
        check+=1
if check>=M:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:

x = input().split(" ")
a = input().split(" ")
n = int(x[0])
m = int(x[1])
sum = 0
counter = 0
for i in a:
  sum += int(i)

bunsu = sum / 4 / m
 
for i in a:
    if float(i) > bunsu:
      if counter <= m:
        counter += 1
if counter >= m:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

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

comp = 1 / (4 * m)
total = 0
suma = sum(a)
for i in range(n):
    if a[i] / suma > comp:
        total += 1
if total >= m:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:

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

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

Submission status: Wrong Answer

Solution code:
from sys import stdin
n,m = map(int,input().split())
sen = list(map(int,input().split()))
count = 0
al = len(sen)
for i in sen:
    if i >= al/(4*m):
        count += 1
if count >= m:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
from sys import stdin
n,m = map(int,input().split())
sen = list(map(int,input().split()))
count = 0
al = 0
for i in sen:
    al += i
for i in sen:
    if i > al/(4*m):
        count += 1
if count >= m:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
n=[int(i) for i in input().split()]
m=[int(j) for j in input().split()]
a=sum(m)*1/(4*n[1])
l=[]
for k in m:
    if k>=a:
        l.append(k)

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n=[int(i) for i in input().split()]
m=[int(j) for j in input().split()]
a=sum(m)*1/(4*n[1])
l=[]
for k in m:
    if k>a:
        l.append(k)

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

Submission status: Wrong Answer

Solution code:
N,M=(int(x) for x in input().split())
a=list(map(int, input().split()))
c=0
for i in range(N-1):
    if(a[i]<=1/(4*M)):c+=1
if(c<=M):print('Yes')
else:print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

# aa = sorted(aa)
mn = 1/(4*m)
count = 0

for a in aa: 
  if (a >= mn): 
    count += 1
    
print("Yes" if count >= m else "No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
print("Yes")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())
c=list(map(int,input().split()))
c.sort(reverse=True)
d=sum(c)
if d-c[0]>=d/(4*b):
  print('Yes')
else :
  print('No')

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())
c=list(map(int,input().split()))
c.sort(reverse=True)
d=sum(c)
if d-c[0]>d/(4*b):
  print('Yes')
else :
  print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

cnt=0
for a in A:
  if a*4*M>total:
  	cnt=cnt+1

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