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 = list(map(int, input().split()))
A = list(map(int, input().split()))
total = sum(A)
result = []
for i in A:
    if i > (total * (1/(4*M))):
        result.append(i)
if len(result) < M:
    print("No")
else:
    print("Yes")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

list.sort(reverse=True)

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

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

i = 0
j = 0
while i < M:
  j = j + int(S[i])
  i = i + 1

if int(S[M - 1]) / j >= 1 / (4 * M):
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

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

i = 0
j = 0
while i < M:
  j = j + int(S[i])
  i = i + 1

if int(S[M - 1]) / j >= 1 / 4:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

total_votes = sum(A)

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

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

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

Submission status: Wrong Answer

Solution code:
import math

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

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

border = math.ceil(sum(A) / (4 * M))

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math

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

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

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

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

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

Submission status: Wrong Answer

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

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

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

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

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

Submission status: Wrong Answer

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

sumA=sum(A)

A.sort(reverse=True)

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# N Items on sale
# item I recieves Ai votes
# select M popular items from N
# cannot select 1/4M


# Input:
# N M
# A1 ... An

# Sample Input:
# 4 1
# 5 4 2 1
# total votes = 12
# 1/4M * 12 = 1/4 * 12 = 3, can't select item < 3

first_input = input("").split(" ")
N, M = map(int, first_input)
items = input("")

items = items.split(" ")
total_votes = list(map(float, items))

total_votes = len(total_votes)

min_N = total_votes * ( 1.0 / (4.0 * M) )

if(N < min_N):
    print("No")
else:
    print("Yes")

Submission status: Wrong Answer

Solution code:
# Sample Input:
# 4 1
# 5 4 2 1
# total votes = 12
# 1/4M * 12 = 1/4 * 12 = 3, can't select item < 3

first_input = input("").split(" ")
N, M = map(int, first_input)
items = input("")

items = items.split(" ")
total_votes = list(map(float, items))

total_votes = sum(total_votes)

min_N = total_votes * ( 1.0 / (4.0 * M) )

if(N < min_N):
    print("No")
else:
    print("Yes")

Submission status: Wrong Answer

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

items = items.split(" ")
total_votes = list(map(float, items))

total_votes = sum(total_votes)

min_N = total_votes * ( 1.0 / (4.0 * M) )

print(min_N)

if(N < min_N):
    print("No")
else:
    print("Yes")

Submission status: Wrong Answer

Solution code:
from sys import stdin, stdout
n,m = map(int, stdin.readline().rstrip().split(' '))
l = list(map(int, stdin.readline().rstrip().split(' ')))
sum = sum(l)
k = sum/(4*m)
count = 0
l.sort(reverse = True)
a = (len(l)-1)
for i in (0, a):
  if(l[i]>k):
      print(l[i])
      count =count +1
  else:
      break
if (count>=m):
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
from sys import stdin, stdout
n,m = map(int, stdin.readline().rstrip().split(' '))
l = list(map(int, stdin.readline().rstrip().split(' ')))
sum = sum(l)
k = sum/(4*m)
print(k,sum)
count = 0
l.sort(reverse = True)
a = (len(l)-1)
for i in (0, a):
  if(l[i]>k):
      print(l[i])
      count =count +1
  else:
      break
if (count>=m):
  print("Yes")
else:
  print("No",count)

Submission status: Wrong Answer

Solution code:
from sys import stdin, stdout
n,m = map(int, stdin.readline().rstrip().split(' '))
l = list(map(int, stdin.readline().rstrip().split(' ')))
sum = sum(l)
k = sum/(4*m)
count = 0
l.sort(reverse = True)
a = (len(l)-1)
for i in (0, a):
  if(l[i]>k):
    count =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()))
a.sort(reverse = True)
ans = "Yes"
for i in range(n):
    if a[i] < sum(a)*(1/(4*m)):
        ans = "No"
        break
print(ans)

Submission status: Wrong Answer

Solution code:
import numpy as np

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

Submission status: Wrong Answer

Solution code:
import numpy as np

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())
n=list(map(int,input().split()))
if sum(n)/(4*b)>max(n):
  print("No")
else:
  print("Yes")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
n, m = map(int, input().split())
votes = [int(i) for i in input().split()]
votes.sort()
if m > n:
    print('No')
else:
    for i in range(m):
        if votes[i] < sum(votes) // 4*m:
            print('No')
            break
    else:
        print('Yes')

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] >= sum(a)/(4*m):
    cnt += 1

if cnt >= m:
  print("True")
else:
  print("False")

Submission status: Wrong Answer

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


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

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

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

Submission status: Wrong Answer

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


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())
lst = list(map(int, input().split()))
lst.sort(reverse = True)
sol = lst[:m]
if sol[-1] < sum(lst)/(4*m):
    print("NO") 
else:
    print("YES")

Submission status: Wrong Answer

Solution code:
n, m = map(int,input().strip().split())
lst = list(map(int, input().split()))
lst.sort(reverse = True)
sol = lst[:m]
if sol[-1] < sum(lst)/(4*m):
    print("NO") 
else:
    print("YES")

Submission status: Wrong Answer

Solution code:
n, m = map(int,input().strip().split())
lst = list(map(int, input().split()))
summ = sum(lst)
sol = summ/(m * 4)
counter = 0
for i in range(len(lst)):
    if lst[i] >= sol:
        counter += 1

if counter >= m:
    print("YES")
else:
    print("NO")

Submission status: Wrong Answer

Solution code:
n, m = map(int,input().strip().split())
lst = list(map(int, input().split()))
summ = sum(lst)
# print(summ)
sol = 1/(m * 4)
# # print(sol)
res = sol*summ
# # print(res)
if lst[m-1] >= res:
    print("YES")
else:
    print("NO")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

print(ans(M,select))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import bisect
N, M = map(int, input().split())
A = list(map(int, input().split()))
A.sort()
thr = sum(A) / (4*M)
index = bisect.bisect_left(A, thr)
if len(A) - (index) > M:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
print("Yes")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
n, m = list(map(int, input().split()))
arr = list(map(int, input().split()))
val = 1/(4*m)
total = sum(arr)
gt = total * val
for i in arr:
    if i >= gt and m != 0:
        m -= 1
if m == 0:
    print("yes")
else:
    print("no")

Submission status: Wrong Answer

Solution code:
n, m = list(map(int, input().split()))
arr = list(map(int, input().split()))
val = 1/(4*m)
total = sum(arr)
gt = total * val
for i in arr:
    if i > gt and m != 0:
        m -= 1
if m == 0:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
n, m = list(map(int, input().split()))
arr = list(map(int, input().split()))
val = 1/(4*m)
total = sum(arr)
gt = total * val
for i in arr:
    if i > gt and m != 0:
        m -= 1
if m == 0:
    print("yes")
else:
    print("no")

Submission status: Wrong Answer

Solution code:
n, m = list(map(int, input().split()))
arr = list(map(int, input().split()))
val = 1/(4*m)
total = sum(arr)
gt = total * val
for i in arr:
    if i > gt and m != 0:
        m -= 1
if m == 0:
    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)

if a[m - 1] > sum(a) / (4 * 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()))
A_list_sum = sum(A_list)
count = 0
for  i in range(len(A_list)):
  if(A_list[i]>=(A_list_sum/4*M)):
    count = 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()))

count = 0
for  i in range(len(A_list)):
  if(A_list[i]>=(1/4*M)):
    count = 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()))
a.sort(reverse=True)

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

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

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

for vote in A:
    if vote >= minimum_votes:
        eligible_products += 1

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

Submission status: Wrong Answer

Solution code:
n, m = map(int, input().split())
a = input().split()
ary = [int(s) for s in a]
ary.sort()
all = sum(ary)

diff = all // (m * 4)
result = True;
for i in range(m):
    c = i + 1
    if int(ary[-c]) < diff:
        print('No')
        result = False
if result:
    print('Yes')

Submission status: Wrong Answer

Solution code:
n, m = map(int, input().split())
a = input().split()
ary = [int(s) for s in a]
ary.sort()
all = sum(ary)

diff = all // 4
result = True;
for i in range(m):
    c = i + 1
    if int(ary[-c]) < diff:
        print('No')
        result = False
if result:
    print('Yes')

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

for vote in A:
    if vote >= minimum_votes:
        eligible_products += 1

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

Submission status: Wrong Answer

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

for vote in A:
    if vote >= minimum_votes:
        eligible_products += 1

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

Submission status: Wrong Answer

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

for vote in A:
    if vote > minimum_votes:
        eligible_products += 1

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

Submission status: Wrong Answer

Solution code:
def main():
    N,M=map(int,input().split())
    str=list(map(int,input().split()))
    cal=sum(str)/(4*M)
    print(sorted(str, reverse=True))


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

    print("Yes")
    return

main()

Submission status: Wrong Answer

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

num = m * 4
result = True;
for i in range(m):
    c = i + 1
    if int(a[-c]) < num:
        print('No')
        result = False
if result:
    print('Yes')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import numpy as np

# 入力
N,M = map(int,input().split())
A = np.array([int(x) for x in input().split()])
S = sum(A)/(4*M)

if np.count_nonzero(A>S) >= M:
    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(x) for x in input().split()])
S = sum(A)/(4*M)

if np.count_nonzero(A>S):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
i = input().split()
n = int(i[0])
m = int(i[1])

i2 = input().split()
a = [int(i2) for i2 in i2]
m2 = sum(a) // (4 * m)
c = sum([1 if i3 >= m2 else 0 for i3 in a])
print("Yes" if c >= m else "No", end='')

Submission status: Wrong Answer

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



a = [int(i) for i in x]
b = [int(i) for i in y]

M = a[1]
s = sum(b)
c = 0
f = False

for i in b:
    if i >= ((1/(4*M)*s)):
        c += 1
    if c > 1:
        print("Yes")
        f = True
        break

if not f:
    print("No")

Submission status: Wrong Answer

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



a = [int(i) for i in x]
b = [int(i) for i in y]

M = a[1]
s = sum(b)
c = 0
f = False

for i in b:
    if i >= int((1/(4*M)*s)):
        c += 1
    if c > 1:
        print("Yes")
        f = True
        break

if not f:
    print("No")

Submission status: Wrong Answer

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

total = sum(a)
result = "Yes"
for vote in a:
  if vote < 1/(4*m) * total:
    result = "No"
    break

print(result)

Submission status: Wrong Answer

Solution code:
i = input().split()

n = int(i[0])
m = int(i[1])
a = [int(i2) for i2 in i[2::]]
m2 = sum(a) // (4 * m)
c = sum([1 if i3 >= m2 else 0 for i3 in a])
print("Yes" if c >= m else "No", end='')

Submission status: Wrong Answer

Solution code:
i = input().split()

n = int(i[0])
m = int(i[1])
a = [int(i2) for i2 in i[2::]]
m2 = sum(a) // (4 * m)
c = sum([1 if i >= m2 else 0 for i in a])

print("Yes" if c >= m else "No", end='')

Submission status: Wrong Answer

Solution code:
def merge(array, left_index, right_index, middle, comparison_function):
    left_copy = array[left_index:middle + 1]
    right_copy = array[middle+1:right_index+1]

    left_copy_index = 0
    right_copy_index = 0
    sorted_index = left_index

    while left_copy_index < len(left_copy) and right_copy_index < len(right_copy):

        # We use the comparison_function instead of a simple comparison operator
        if comparison_function(left_copy[left_copy_index], right_copy[right_copy_index]):
            array[sorted_index] = left_copy[left_copy_index]
            left_copy_index = left_copy_index + 1
        else:
            array[sorted_index] = right_copy[right_copy_index]
            right_copy_index = right_copy_index + 1

        sorted_index = sorted_index + 1

    while left_copy_index < len(left_copy):
        array[sorted_index] = left_copy[left_copy_index]
        left_copy_index = left_copy_index + 1
        sorted_index = sorted_index + 1

    while right_copy_index < len(right_copy):
        array[sorted_index] = right_copy[right_copy_index]
        right_copy_index = right_copy_index + 1
        sorted_index = sorted_index + 1


def merge_sort(array, left_index, right_index, comparison_function):
    if left_index >= right_index:
        return

    middle = (left_index + right_index)//2
    merge_sort(array, left_index, middle, comparison_function)
    merge_sort(array, middle + 1, right_index, comparison_function)
    merge(array, left_index, right_index, middle, comparison_function)
    
    
def popular_vote(n, m, items): 
  items = merge_sort(items)
  counter = 0 
  sum = 0 
  
  for i in range(len(items)): 
    sum += items[i]
   
  a = (1/(4*m)) * sum
  
  for i in range(len(items)): 
    if items[i] >= a: 
      if counter == m:
        return True
      else:
        counter += 1
  return false

Submission status: Wrong Answer

Solution code:
i = input().split()

n = int(i[0])
m = int(i[1])
a = [int(i2) for i2 in i[2::]]
m2 = sum(a) // (4 * m)
c = sum([1 if i >= m2 else 0 for i in a])

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

Submission status: Wrong Answer

Solution code:
i = input().split()

n = int(i[0])
m = int(i[1])
a = [int(i2) for i2 in i[2::]]
m2 = sum(a) // (4 * m)
c = sum([1 if i >= m2 else 0 for i in a])

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

Submission status: Wrong Answer

Solution code:
def main():
  n,m = [int(x) for x in input().split()]
  a = [int(x) for x in input().split()]
  total = sum(a)
  
  can_be_selected = list(filter(lambda x: x >= total/4/m, a))
  return len(can_be_selected) >= m

main()

Submission status: Wrong Answer

Solution code:
def main():
  n,m = [int(x) for x in input().split()]
  a = [int(x) for x in input().split()]
  
  can_be_selected = list(filter(lambda x: x > 1/4/m, a))
  return len(can_be_selected) >= m

main()

Submission status: Wrong Answer

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

print(ans(M,select))

Submission status: Wrong Answer

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

print(ans(M,select))

Submission status: Wrong Answer

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

print(ans(N,M,A))

Submission status: Wrong Answer

Solution code:

buf = input().split()
n = int(buf[0])
m = int(buf[1])

buf = input().split()
votes = [int(x) for x in buf]
numVotes = sum(votes)

ct = 0
for v in votes:
  if v >= 1.0 / (4.0 * m):
    ct += 1
  if ct >= m:
    break

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
n, m = input().split()
b = input().split()
sum = 0
for x in b:
    sum += int(x)
yy=0
for y in b:
    if int(y) > sum/(4*int(m)):
        yy+=1
if yy <= int(m):
    print("No")
else:
    print("Yes")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
n, m = input().split()
b = input().split()
sum = 0
for x in b:
    sum += int(x)
yy=0
for y in b:
    if int(y) >= sum/(4*int(m)):
        yy+=1
if yy <= int(m):
    print("No")
else:
    print("Yes")

Submission status: Wrong Answer

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

res = 0
for i in range(N):
    if i < (1/(4*M)*sum(arr)):
        res = res
    else:
        res += 1
if res >= M:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
n, m = input().split()
b = input().split()
sum = 0
for x in b:
    sum += int(x)
yy=0
for y in b:
    if int(y) >= sum/(4*int(m)):
        yy+=1
if yy >= int(m):
    print("No")
else:
    print("Yes")

Submission status: Wrong Answer

Solution code:
n, m = input().split()
b = input().split()
sum = 0
for x in b:
    sum += int(x)
yy=0
for y in b:
    if int(y) >= sum//(4*int(m)):
        yy+=1
if yy >= int(m):
    print("No")
else:
    print("Yes")

Submission status: Wrong Answer

Solution code:
n, m = input().split()
b = input().split()
sum = 0
for x in b:
    sum += int(x)
yy=0
for y in b:
    if int(y) >= sum/(4*int(m)):
        yy+=1
if yy <= int(m):
    print("No")
else:
    print("Yes")

Submission status: Wrong Answer

Solution code:
n, m = input().split()
b = input().split()
sum = 0
for x in b:
    sum += int(x)
yy=0
for y in b:
    if int(y) >= sum/(4*int(n)):
        yy+=1
if yy <= int(m):
    print("No")
else:
    print("Yes")

Submission status: Wrong Answer

Solution code:
n, m = input().split()
b = input().split()
sum = 0
for x in b:
    sum += int(x)
yy=0
for y in b:
    if int(y) < sum/(4*int(n)):
        yy+=1
if yy <= int(m):
    print("No")
else:
    print("Yes")

Submission status: Wrong Answer

Solution code:
n, m = input().split()
b = input().split()
sum = 0
for x in b:
    sum += int(x)
if int(b[int(m)-1]) < sum//int(4*int(n)):
    print("No")
else:
    print("Yes")

Submission status: Wrong Answer

Solution code:
n, m = input().split()
b = input().split()
sum = 0
for x in b:
    sum += int(x)
if int(b[int(m)-1]) < sum/(4.*int(n)):
    print("No")
else:
    print("Yes")

Submission status: Wrong Answer

Solution code:
n,m = input().split()
b = input().split()
sum = 0
for x in b:
    sum += int(x)
print(sum/(4.*int(n)))
if int(b[int(m)-1]) < sum/(4.*int(n)):
    print("No")
else:
    print("Yes")

Submission status: Wrong Answer

Solution code:
n,m=map(int,input().split())
li=list(map(int,input().split()))
li.sort()
li.reverse()
N=sum(li)
M=m*4
x=int(li[m-1])
if x <= N/M:
    print('NO')
else:
    print('Yes')

Submission status: Wrong Answer

Solution code:
n,m=map(int,input().split())
li=list(map(int,input().split()))
li.sort()
li.reverse()
N=sum(li)
M=m*4
x=int(li[m-1])
if x < N/M:
    print('NO')
else:
    print('Yes')

Submission status: Wrong Answer

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