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 = input().split()
A=list(map(int, input().split())) 

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
n = list(map(int,input().split()))
s = list(map(int,input().split()))
x = sum(s)
y = (x//(4*n[1]))

a = [a for a in s if y<=a]
if len(a)>=n[1]:
    print("Yes")
    
else:print("No")

Submission status: Wrong Answer

Solution code:
n = list(map(int,input().split()))
s = list(map(int,input().split()))
x = sum(s)
y = (x//(4*n[1]))

a = [a for a in s if y<=a]
if len(a)<n[1]:
    print("No")
    
else:print("Yes")

Submission status: Wrong Answer

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

X = sum(A)/(4*M)
ans = 0

for i in A:
    if i > X:
        ans += 1

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
flag =0
x = 0
n = list(map(int,input().split()))
s = list(map(int,input().split()))
for i in range(n[0]):
    x += s[i]
y = (x//(4*n[1]))
s = sorted(s)
s = s[::-1]

for j in range(n[1]):
    if y>=s[j]:
        flag = 1
        print("No")
        break
if flag == 0:print("Yes")

Submission status: Wrong Answer

Solution code:
flag =0
x = 0
n = list(map(int,input().split()))
s = list(map(int,input().split()))
for i in range(n[0]):
    x += s[i]
y = (x//(4*n[1]))
s = sorted(s)
s = s[::-1]

for j in range(n[1]):
    if y>s[j]:
        flag = 1
        print("No")
        break
if flag == 0:print("Yes")

Submission status: Wrong Answer

Solution code:
import numpy as np
 
[N, M] = list(map(int, input().split()))
A = list(map(int, input().split()))
threshold = int(np.sum(A) / (4 * M))
#print(threshold)
Th = [a for a in A if threshold <= a]
#print(Th)
if len(Th) < M:
  ans = 'No'
else:
  ans = 'Yes'
print(ans)

Submission status: Wrong Answer

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

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

sort_position = sorted(position,reverse = True)

#print(sort_position)
judge = int(sum(sort_position)/(4*M))

if sort_position[M-1] >= judge:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

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

sort_position = sorted(position,reverse = True)

#print(sort_position)
judge = int(sum(sort_position)/(4*M))

if sort_position[M-1] > judge:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

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

sort_position = sorted(position,reverse = True)

#print(sort_position)
judge = sum(sort_position)/(4*M)

if sort_position[M-1] > judge:
    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)
ans = ''
for i in range(m):
    if a[i] < sum(a)/4*m:
        ans = 'No'
        break
    else:
        ans = 'Yes'
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

for r in rank:
  if r >= (sum(rank)//(4*m)):
    cnt += 1
    if cnt >= m:
      break

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

Submission status: Wrong Answer

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

rank.sort(reverse=True)
print(rank)

flg = True

for i in range(m):
  if rank[i] < (sum(rank)/4*m):
    flg = False
    break

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

for i in range(N):
  if a[i] > sum(a)/(4*M):
    count +=1
    
print("Yes" if count>=M else "No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

for i in range(N):
    if A[i-1] >= int(sum(A)/(4*M)):
        count+=1
if count>= M:
    print("Yes")

else:
    print("No")

Submission status: Wrong Answer

Solution code:
n,m = map(int,input().split())
li = list(map(int,input().split()))
wa = 0
for i in li :
    wa+=i

for i in li :
    if i+1 < (wa/(4*m)) :
        n -= 1

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

Submission status: Wrong Answer

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

possible_choice = len([1 for x in item_list if x>(sum(item_list)/(4*M))])
if possible_choice >= M:
    print('Yes')

else:
    print('No')

Submission status: Wrong Answer

Solution code:
def main():
    N, M = map(int, input().split())
    A = [int(a) for a in input().split()]
    total = sum(A)
    cnt = 0
    for i in range(N):
        if A[i] < total*1.0/(4.0*M):
            pass
        else:
            cnt += 1
    if cnt >= M:
        print("Yes")
    else:
        print("NO")
main()

Submission status: Wrong Answer

Solution code:
def main():
    N, M = map(int, input().split())
    A = [int(a) for a in input().split()]
    total = sum(A)
    cnt = 0
    for i in range(N):
        if A[i] >= total*1.0/(4*M):
            cnt += 1
    if cnt >= M:
        print("Yes")
    else:
        print("NO")
main()

Submission status: Wrong Answer

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

def fun(n, m, a):
    total = sum(a)
    num = float(total)/(4*m)
    flag = sum([i > num for i in a])
    return flag >= m

ans = fun(n, m, a)
if ans:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
nm = [int(x) for x in input().split(' ')]
vote = [int(v) for v in input().split(' ')]

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

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

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

Submission status: Wrong Answer

Solution code:
N=[int(x) for x in input().split()]
A=[int(y) for y in input().split()]
y=sorted(A, reverse=True)
z = sum(y)
j=0
for a in range(0,N[1]):
    if z/8< y[a]:
       j=j+1
if j==N[1]:
   print("Yes")
else:
   print("No")

Submission status: Wrong Answer

Solution code:
N=[int(x) for x in input().split()]
A=[int(y) for y in input().split()]
y=sorted(A, reverse=True)
z = sum(y)
j=0
for a in range(0,N[1]):
    if z/8< y[a]:
       j=j+1
if j==N[1]:
   print("Yes")
else:
   print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import os

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


if __name__ == "__main__":
	main()

Submission status: Wrong Answer

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

for i in range(len(li)):
    if li[i] >= p:
        c+=1

if c < m:
    ans = "No"

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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


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



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

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

Solution code:
N, M = map(int, input().split())
A = sorted(list(map(int, input().split())))[::-1]
A_sum = sum(A)

count = 0;
criteria = A_sum/(4*M)

print("No") if (A[M - 1] <= criteria) else print("Yes")

Submission status: Wrong Answer

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

n = list(map(int, input().split()))
Ai = n[0]
total = sum(n)

if sum(n[1:]) >= total*(1/(4*M)) and max(n) == Ai:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

n = list(map(int, input().split()))
max_vote = max(n)
if max_vote >= 1/(4*M):
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

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

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

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

Submission status: Wrong Answer

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

for i in a:
    if i>ninnki:
        count+=1
        
if count>=M:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

for i in (a):
    if i>ninnki:
        count+=1
        
if count>=M:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

for i in (a):
    if i>ninnki:
        count+=1
        
if count>M:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

sum = 0

for i in range(n):
  sum += A[i]
  
counter = 0
rate = 4 * m
rate = 1 / rate
for i in range(n):
  if A[i] > rate:
    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()))
b = []
for i in range(0, len(a)):
    if a[i]>1/(4*m)*sum(a):
        b.append(a[i])
if len(b) >= m:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

Solution code:
from sys import stdin


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

Submission status: Wrong Answer

Solution code:
import numpy as np


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

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

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N,M=map(int,input().split())
l=list(map(int,input().split()))
limit=sum(l)/(M*3)
num=0
for i in l:
  if i >= limit:
    num+=0
if num >=M:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

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

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

##print(threshhold)

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

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

Submission status: Wrong Answer

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

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

##print(threshhold)

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

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

Submission status: Wrong Answer

Solution code:
n, m = map(int, input().split())
votes = list(map(int, input().split()))
k = (1/(4*m))*sum(votes)

items = []

for i in range(n):
  if votes[i] >= k:
    items.append(i)

if len(items) > m:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

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

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

##print(threshhold)

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

##print(threshhold)

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

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

Submission status: Wrong Answer

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

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

##print(threshhold)

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

threshhold = int(sum(A)/(4 * M))


if M > A.count('>threshhold'):
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
from sys import stdin
import numpy as np


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

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

sumvotes = np.sum(a)

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

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

Submission status: Wrong Answer

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

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

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

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

Submission status: Wrong Answer

Solution code:
n,m = map(int,input().split())
A = list(map(int,input().split()))
A.sort(reverse=True)
sortedA = list()
sum_of_votes = 0
for i in A : 
    sum_of_votes += i
for i in range(m) : #人気商品候補のsortedAリスト
    sortedA.append(A[i])
print(sortedA)
isOK = True
for i in sortedA: #人気商品候補のうち選べないものはないか？
    if i < sum_of_votes * (1/(4*m)) :
        isOK = False
print(isOK)
if isOK == True :
    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[i] >= 1 / (4 * M) for i in range(N))

if s >= 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()]
total = sum(a)//(4*m)
tmp = list(filter(lambda x: x>=total, a))
if len(tmp) >= m:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
from sys import stdin


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

Submission status: Wrong Answer

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

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

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

sumcount = sum(A)
count = 0

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

sumcount = sum(A)
count = 0

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

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

Submission status: Wrong Answer

Solution code:
n,m = (int(x) for x in input().split()) 
s = list(map(int, input().split()))
t = sum(x>=(1/(4*m)) for x in s)
        
if t >=m:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

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


if __name__ == "__main__":
    main()