TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: 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`.

Submission attempts (in order):
N, M = map(int, input().split())
List = list(map(int, input().split()))
total = 0
for n in range(N):
    total += List[n]
limit = total/(4*M)
count = 0
for n in range(N):
    if List[n] >= limit:
        count += 1
if count >= M:
    print("yes")
else:
    print("no")

N, M = map(int, input().split())
List = list(map(int, input().split()))
total = 0
for n in range(N):
    total += List[n]
limit = total/(4*M)
count = 0
for n in range(N):
    if List[n] >= limit:
        count += 1
if count >= M:
    print("Yes")
else:
    print("No")

Verdicts: Wrong Answer

Accepted
Problem: 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`.

Submission attempts (in order):
N, M = map(int, input().split())
A = list(map(int, input().split(" ")))

val = sum(A) / (4 * M)
A.sort(reverse=True)
flag = True
for i in range(0,M):
    print(A[i])
    if A[i] < val:
        flag = False
        break
    
if flag:
    print("Yes")
else:
    print("No")

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

val = sum(A) / (4 * M)
A.sort(reverse=True)
flag = True
for i in range(0,M):
    if A[i] < val:
        flag = False
        break
    
if flag:
    print("Yes")
else:
    print("No")

Verdicts: Wrong Answer

Accepted
Problem: 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`.

Submission attempts (in order):
n, m = map(int, input().split())
a = list(map(int, input().split()))
criteria = sum(a) / (m * 4)

ans = 0
for i in a:
    if i >= criteria:
        ans += 1

if ans >= m:
    print('YES')
else:
    print('NO')


n, m = map(int, input().split())
a = list(map(int, input().split()))
criteria = sum(a) / (m * 4)

ans = 0
for i in a:
    if i >= criteria:
        ans += 1

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


Verdicts: Wrong Answer

Accepted
Problem: 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`.

Submission attempts (in order):
n,m = map(int,input().split())
l = list(map(int,input().split()))
l.sort(reverse=True)
if l[n-1] < sum(l)/4/m:
  print('No')
else:
  print('Yes')

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

Verdicts: Wrong Answer

Accepted
Problem: 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`.

Submission attempts (in order):
N, M = list(map(int, input().split()))
A = list(map(int, input().split()))
A_sorted = sorted(A, reverse=True)
max_numbers = A_sorted[:M]
A_sum = sum(A)
print("sum:", sum(A))
for i in max_numbers:
    if i < A_sum / (4 * M):
        print("No")
        break
else:
    print("Yes")

N, M = list(map(int, input().split()))
A = list(map(int, input().split()))
A_sorted = sorted(A, reverse=True)
max_numbers = A_sorted[:M]
A_sum = sum(A)
for i in max_numbers:
    if i < A_sum / (4 * M):
        print("No")
        break
else:
    print("Yes")

Verdicts: Wrong Answer

Accepted
Problem: 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`.

Submission attempts (in order):
N,M = map(int,input().split())
A_i = list(map(int,input().solit()))
sum_A_i = sum(A_i)
X = 0

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

N, M = map(int,input().split())
l = list(map(int,input().split()))
 
T = sum(l)
V = 1/(4*M) * T
S = len(list(filter(lambda x: x>=V, l)) )
 
print( "Yes" if S >= M else "No" )

Verdicts: Runtime Error

Accepted
Problem: 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`.

Submission attempts (in order):
N,M=list(map(int,input().split()))
lst=list(map(int,input().split()))
lst.sort()
if lst[1-M]*4*M>=sum(lst):
  print('Yes')
else:
  print('No')

N,M=list(map(int,input().split()))
lst=list(map(int,input().split()))
lst.sort()
if lst[M-1]*4*M>sum(lst):
  print('Yes')
else:
  print('No')

N,M=list(map(int,input().split()))
lst=list(map(int,input().split()))
lst.sort()
if lst[0-M]*4*M>=sum(lst):
  print('Yes')
else:
  print('No')

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: 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`.

Submission attempts (in order):
n = input().split()
m = input().split()

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

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

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

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

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



n = input().split()
m = input().split()

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

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

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

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

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



Verdicts: Wrong Answer

Accepted
Problem: 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`.

Submission attempts (in order):
N, M = map(int, input().split())
A = list(map(int, input().split()))

vote = []

for j in range(N):
    all += A[j]

for i in range(N):
    if A[i] >= all // (4 * M):
        vote.append(A[i])

if len(vote) >= M:
    print("Yes")

else:
    print("No")

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

vote = []
all = 0

for j in range(N):
    all += A[j]

for i in range(N):
    if A[i] >= all / (4 * M):
        vote.append(A[i])

if len(vote) >= M:
    print("Yes")

else:
    print("No")

Verdicts: Runtime Error

Accepted
Problem: 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`.

Submission attempts (in order):
N, M = map(int, input().split())
A = [int(i) for i in input().split()]

total = sum(A)

for i in range(len(A)):
    if (A[i] / total) < (1 / M):
        print('{}'.format('No'))
        exit()

print('{}'.format('Yes'))



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

total = sum(A)
cnt = 0
for i in range(len(A)):
    if (A[i] / total) >= (1 / (4 * M)): cnt += 1

if cnt >= M:
    print('{}'.format('Yes'))
else:
    print('{}'.format('No'))



Verdicts: Wrong Answer

Accepted
Problem: 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`.

Submission attempts (in order):
import numpy as np
tmp =list(map(int, input().split()))
num=list(map(int, input().split()))
num = np.array(num)

if tmp[1]<=len(num[num>(num.sum()+(4*tmp[1])-1//(4*tmp[1]))]):
    print("Yes")
else:
    print("No")

tmp = list(map(int, input().split()))
num = list(map(int, input().split()))

count = 0
b = sum(num)/(4*tmp[1])
for i in num:
    if i>=b:
        count+=1
        
if tmp[1]<=count:
    print("Yes")
else:
    print("No")

Verdicts: Wrong Answer

Accepted
Problem: 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`.

Submission attempts (in order):
n, m = list(map(int, input().split()))
a = list(map(int, input().split()))
sumA = sum(a)

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

count = 0

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

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

else:
    print("NO")

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

sumBy4 = sumA/(4*m)

count = 0

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

    else:
        count += 1

if(count == m):
    print("YES")

else:
    print("NO")

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

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: 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`.

Submission attempts (in order):
n,m = map(int,input().split())
a=map(int,input().split())
a=sorted(a)
if a[m-1] > sum(a)/4/m:
    print("Yes")
else:
    print("No")


n,m = map(int,input().split())
a=map(int,input().split())
a=sorted(a)
if a[-m] >= sum(a)/4/m:
    print("Yes")
else:
    print("No")

Verdicts: Wrong Answer

Accepted
Problem: 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`.

Submission attempts (in order):
n,m = map(int,input().split())
a= list(map(int,input().split()))
po=list(filter(lambda x: x>=(1/4*m)*sum(a),a))
print("yes" if len(po)>=m else "no")

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

Verdicts: Wrong Answer

Accepted
Problem: 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`.

Submission attempts (in order):
n ,m = map(int, input().split())
a = list(map(int, input().split()))
a.sort().reverse()
total = 0
for i in a:
  total += i
ok = 0
for i in range(m):
  if a[i] >= total / (4 * m):
    ok += 1
 
if ok != m:
  print("No")
else:
  print("Yes")

n ,m = map(int, input().split())
a = list(map(int, input().split()))
a.sort()
total = 0
for i in a:
  total += i
ok = 0
for i in range(1, m + 1):
  if a[-i] >= total / (4 * m):
    ok += 1

if ok != m:
  print("No")
else:
  print("Yes")

Verdicts: Runtime Error

Accepted
Problem: 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`.

Submission attempts (in order):
import sys
N, M = map(int, sys.stdin.readline().split())
li = list(map(int, sys.stdin.readline().split))
li.sort(reverse=False)
if li[M-1] < sum(li)/(4*M):
  print('No')
else:
  print('Yes')

import sys
N, M = map(int, sys.stdin.readline().split())
li = list(map(int, sys.stdin.readline().split()))
li.sort(reverse=False)
if li[M-1] < sum(li)/(4*M):
  print('No')
else:
  print('Yes')


import sys
N, M = map(int, sys.stdin.readline().split())
li = list(map(int, sys.stdin.readline().split()))
li.sort(reverse=True)
if li[M-1] < sum(li)/(4*M):
  print('No')
else:
  print('Yes')


Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: 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`.

Submission attempts (in order):
N, M = map(int, input().split())
A = list(map(int, input().split()))

s = sum(A[i] >= 1 / (4 * M) for i in N)

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

N, M = map(int, input().split())
A = list(map(int, input().split()))
sumA = sum(A[i] for i in range(N))

s = sum(A[i] / sumA >= 1 / (4 * M) for i in range(N))

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

Verdicts: Runtime Error

Accepted
Problem: 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`.

Submission attempts (in order):
n, m = map(int,input().split())
a = list(map(int,input().strip().split()))[:n]
new_papa = sorted(a, reverse=True)
Sum=sum(a)
if(new_papa[m-1]>=Sum/(m*4)):
    print("YES")
else:
    print("No")

n, m = map(int,input().split())
a = list(map(int,input().strip().split()))[:n]
a.sort(reverse=True)
count=0
Sum=sum(a)
if(a[m-1]>=Sum/(m*4)):
    print("YES")
else:
    print("No")

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

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: 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`.

Submission attempts (in order):
a,b = list(map(int,input().split()))
aaa = list(map(int,input().split()))

result = [0]*a
for i in range(a):
    h = aaa[i]
    j = int(sum(aaa) / (4*b))

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

if result.count(1) >= b:
    ans = "yes"
else:
    ans = "no"

print(ans)

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

result = [0]*a
for i in range(a):
    h = aaa[i]
    j = int(sum(aaa) / (4*b))

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

if result.count(1) >= b:
    ans = "yes"
else:
    ans = "no"

print(ans)

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

result = [0]*a
for i in range(a):
    h = aaa[i]
    j = int(sum(aaa) / (4*b))

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

if result.count(1) >= b:
    ans = "yes"
else:
    ans = "no"

print(ans)

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

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

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

if result.count(1) >= b:
    ans = "yes"
else:
    ans = "no"

print(ans)

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

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

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

if result.count(1) >= b:
    ans = "yes"
else:
    ans = "no"

print(ans)

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

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

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

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

print(ans)

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: 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`.

Submission attempts (in order):
# -*- coding: utf-8 -*-

###
# main
if(__name__ == '__main__'):
    # input
    n, m = map(int, input().split(" "))
    a_arr = list(map(int, input().split(" ")))

    sum = 0
    for a in a_arr:
        sum += a
    threshold = sum / (4*m)

    a_arr.sort()

    print(a_arr[n-m])
    if a_arr[n-m] < threshold:
        print("No")
    else:
        print("Yes")

# else:
    # do nothing


# -*- coding: utf-8 -*-

###
# main
if(__name__ == '__main__'):
    # input
    n, m = map(int, input().split(" "))
    a_arr = list(map(int, input().split(" ")))
 
    sum = 0
    for a in a_arr:
        sum += a
    threshold = sum / (4*m)
 
    a_arr.sort()
 
    if a_arr[n-m] < threshold:
        print("No")
    else:
        print("Yes")

# else:
    # do nothing


Verdicts: Wrong Answer

Accepted
Problem: 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`.

Submission attempts (in order):
n, m = map(int, input().split())
a = [int(e) for e in input().split()]

s = sum(a) / (4 * m)
ans = 0
for i in range(len(a)):
    if a[i] >= s:
        ans += 1
    else:
        ans += 0
    if ans >= n:
        print("Yes")
    else:
        print("No")

n, m = map(int, input().split())
a = [int(e) for e in input().split()]

s = sum(a) / (4 * m)
ans = 0
for i in range(len(a)):
    if a[i] >= s:
        ans += 1
    else:
        ans += 0
    if ans == n:
        print("Yes")
    else:
        print("No")

n, m = map(int, input().split())
a = [int(e) for e in input().split()]

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

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: 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`.

Submission attempts (in order):
N=int(input())
A=list(map(int, input().split()))
S=sum(A)

A.sort(reverse=True)
if A[M-1] >= S/(4*M):
  print('Yes')
else:
  print('No')

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


Verdicts: Runtime Error

Accepted
Problem: 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`.

Submission attempts (in order):
import sys
def main():
  n, m = map(int, input().split())
  l = list(map(int, input().split()))
  d = sum(l) / 4 / m
  l.sort()
  for li in l:
    if li < d:
      print ("No")
      return
  print ("Yes")
  return

if __name__ == '__main__':
    main()

def main():
  n, m = map(int, input().split())
  l = list(map(int, input().split()))
  d = sum(l) / 4 / m
  l.sort()
  for i in l:
    if l[i] < d:
      print ("No")
      return
  print ("Yes")
  return

if __name__ == '__main__':
    main()

import sys
def main():
  n, m = map(int, input().split())
  l = list(map(int, input().split()))
  d = sum(l) / (4 * m)
  cnt = 0;
  for li in l:
    if li >= d:
      cnt = cnt + 1
  if cnt >= m :
    print ("Yes")
  else :
    print ("No")
  return

if __name__ == '__main__':
    main()

Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: 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`.

Submission attempts (in order):
#!/usr/bin/env python3
import sys

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

main()



#!/usr/bin/env python3
import sys

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

main()



Verdicts: Runtime Error

Accepted
Problem: 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`.

Submission attempts (in order):

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

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

print(count)

#print(N-n-1)
if count > M:
    print("Yes")
else:
    print("No")

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

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


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

Verdicts: Wrong Answer

Accepted
Problem: 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`.

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

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

Verdicts: Runtime Error

Accepted
Problem: 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`.

Submission attempts (in order):
n, m = map(int,input().split())
a = list(map(int,input().split()))
a.sort()
total = sum(a)
if total/(4*m) > a[m]:
  print("No")
else:
  print("Yes")

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

Verdicts: Runtime Error

Accepted
Problem: 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`.

Submission attempts (in order):
n,m = map(int,input().split())
a = list(map(int,input().split()))
sum_a = sum(a)
border = sum_a / (4*m)
kosu = 0
for i in a:
  if i >= border:
  kosu += 1
if kosu >= m:
  print('Yes')
else:
  print('No')

n,m = map(int,input().split())
a = list(map(int,input().split()))
sum_a = sum(a)
border = sum_a / (4*m)
kosu = 0
for i in a:
  if i >= border
  kosu += 1
if kosu >= m:
  print('Yes')
else:
  print('No')
  

n,m = map(int,input().split())
a = list(map(int,input().split()))
sum_a = sum(a)
border = sum_a / (4*m)
kosu = 0
for i in a:
  if i >= border:
  	kosu += 1
if kosu >= m:
  print('Yes')
else:
  print('No')

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: 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`.

Submission attempts (in order):
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')
    

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

votes = sum(vote)
ans = [i for i in L if i * 4 * M >= votes]

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

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

votes = sum(vote)
ans = [i for i in vote if i * 4 * M >= votes]

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

Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: 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`.

Submission attempts (in order):
N, M = map(int,input().split())
A = map(int,input().split())

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


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

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


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

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


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

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


Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: 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`.

Submission attempts (in order):
data = input().split()

n = int(data[0])
m = int(data[1])

pro = [int(s) for s in input().split()]

vote = 0
for i in pro:
  vote += i

pro.sort(reverse=true)

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


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

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

Verdicts: Runtime Error

Accepted
Problem: 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`.

Submission attempts (in order):
a = int(input())
b = int(input())
c = list(map(int,input().split()))
sum = 0
for i in range c:
  sum = sum + i
count = 0
vote = (1/(4*b))*sum
for j in c:
  if j>=vote:
    count = count + 1
if count>=b:
  print("Yes")
else:
  print("No")

a = int(input())
b = int(input())
c = list(map(int,input().split()))
sum = 0
for i in c:
  sum = sum + i
count = 0
vote = (1/(4*b))*sum
for j in c:
  if j>=vote:
    count = count + 1
if count>=b:
  print("Yes")
else:
  print("No")

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

a,b = map(int,input().split())
c = list(map(int,input().split()))
sum = 0
for i in c:
  sum = sum + i
vote = (1/(4*b))*sum
count = 0
for j in c:
  if j>=vote:
    count = count + 1

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

Verdicts: Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: 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`.

Submission attempts (in order):
M = map(int, input().split())
A = [int(N) for N in input().split()]
X=0
F=int(sum(A)/(4*M))
for i in range(N):
    if A[i] >= F:
        X+=1
if X>=M:
    print('Yes')
else:
    print('No')

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

Verdicts: Runtime Error

Accepted
Problem: 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`.

Submission attempts (in order):
N,M = map(int,input().split())
votes = list(map(int,input().split()))
votes.sort(reverse=True) 
for i in range(M):
  if(votes[i]/sum(votes) < 1/(4*M)):
    print("No")
    
    




N,M = map(int,input().split())
votes = list(map(int,input().split()))
votes.sort(reverse=True) 
ans ="Yes"
for i in range(M):
  if(votes[i]/sum(votes) < 1/(4*M)):
    ans = "No"
    break;
print(ans)




Verdicts: Wrong Answer

Accepted
Problem: 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`.

Submission attempts (in order):
n,m = map(int,input().split())
a = list(map(int,input().split()))
a.sort(reverse=True)
sum_vote = sum(a)
judge = sum_vote /  (4*m)
ans = 'Yes'
for x in a[:m:]:
    print(x,judge)
    if x < judge:
        ans = 'No'
        break
print(ans)

n,m = map(int,input().split())
a = list(map(int,input().split()))
a.sort(reverse=True)
sum_vote = sum(a)
judge = sum_vote /  (4*m)
ans = 'Yes'
for x in a[:m:]:
    if x < judge:
        ans = 'No'
        break
print(ans)

Verdicts: Wrong Answer

Accepted
Problem: 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`.

Submission attempts (in order):
N,M = map(int, input().split())

A = list(map(int, input().split()))
S = sum(A)
x = S/(4*m)

count = 0

for i in A:
    if i >= x:
        count += 1

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

N,M = map(int, input().split())
A = sorted(map(int, input().split()), reverse=True)
S = sum(A)


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



Verdicts: Runtime Error

Accepted
Problem: 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`.

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


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

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

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: 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`.

Submission attempts (in order):
arrayNM = list(map(int, input.split()))
array = list(map(int, input.split()))
tokuhyousuu = 1 / (4 * array[1])
ninnkiCounter = 0
for num in array:
  if ((float)num >= tokuhyosuu):
    ninnkiCounter += 1
    

if (arrayNM[1] <= ninnkiCounter):
  print("Yes")
else:
  print("No")

arrayNM = list(map(int, input().split()))
array = list(map(int, input().split()))
soutoku = 0
for num in array:
  soutoku += num
tokuhyousuu = soutokuku / (4 * float(array[1]))
ninnkiCounter = 0
for num in array:
  if (float(num) >= tokuhyousuu):
    ninnkiCounter += 1
    

if (arrayNM[1] <= ninnkiCounter):
  print("Yes")
else:
  print("No")

arrayNM = list(map(int, input().split()))
array = list(map(int, input().split()))
soutoku = 0
for num in array:
  soutoku += num
tokuhyousuu = soutoku / (4 * float(arrayNM[1]))
ninnkiCounter = 0
for num in array:
  if (float(num) >= tokuhyousuu):
    ninnkiCounter += 1
    

if (arrayNM[1] <= ninnkiCounter):
  print("Yes")
else:
  print("No")

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: 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`.

Submission attempts (in order):
N,M=map(int,input().split())
A=list(map(int,input().split()))
sm=sum(A)
re=0
for a in A:
    if a>(sm/(4*M)):
        re+=1
print(re)
if re>=M:
    print('Yes')
else:
    print('No')


N,M=map(int,input().split())
A=list(map(int,input().split()))
sm=sum(A)
re=0
for a in A:
    if a>(sm/(4*M)):
        re+=1
#print(re)
if re==M:
    print('Yes')
else:
    print('No')


N,M=map(int,input().split())
A=list(map(int,input().split()))
sm=sum(A)
re=0
for a in A:
    if a>=(sm/(4*M)):
        re+=1
#print(re)
if re>=M:
    print('Yes')
else:
    print('No')


Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: 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`.

Submission attempts (in order):
n,m=map(int,input().split())
li=list(map(int,input().split())
ans=0
aaa=soted(li reverse=True)
for i in range(m):
    if aaa[i]*4m>=sum(li):
        ans+=1
if ans==m:
    print("Yes")
else:
    print("No")



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


n,m=map(int,input().split())
li=list(map(int,input().split()))
ans=0
q=sorted(li,reverse=True)
for i in range(m):
    if q[i]*4*m>=sum(li):
        ans+=1
if ans==m:
    print("Yes")
else:
    print("No")


Verdicts: Runtime Error

Runtime Error

Accepted
Problem: 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`.

Submission attempts (in order):
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")

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")

Verdicts: Wrong Answer

Accepted
Problem: 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`.

Submission attempts (in order):
N,M = map(int,input().split())
A = list(map(int,input().split()))
A.sort()

if A[-M]/sum(A) < 1/(2*M) :
    print("No")
else:
    print("Yes")

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

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

Verdicts: Wrong Answer

Accepted
Problem: 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`.

Submission attempts (in order):
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)


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

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

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

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

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


Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: 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`.

Submission attempts (in order):
n,m = map(int,input().split())
A = list(map(int,input().split()))
sum = 0
for i in A:
  sum += i
A.sort()
if A[m-1] > sum/(4*m):
  print("Yes")
else:
  print("No")


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


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


Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: 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`.

Submission attempts (in order):
N, M = list(map(int, input().split()))
A = list(map(int, input().split()))

A.sort()
real = A[M-1] / sum(A)
ideal = 1 / (4 * M)

if real >= ideal:
    print("Yes")
else:
    print("No")


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

A.sort(reverse = True)
real = A[M-1] / sum(A)
ideal = 1 / (4 * M)

if real >= ideal:
    print("Yes")
else:
    print("No")

Verdicts: Wrong Answer

Accepted
Problem: 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`.

Submission attempts (in order):
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")

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")

Verdicts: Wrong Answer

Accepted
Problem: 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`.

Submission attempts (in order):
n,m = map(int, input().split())
l = list(map(int, input().split()))
limit = sum(l)/(4*m)
l.sort(reverse=True)
print(l)
print(l[m-1])
print(sum(l))
print(limit)
if l[m-1] < limit:
    print("No")
else:
    print("Yes")

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

Verdicts: Wrong Answer

Accepted
Problem: 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`.

Submission attempts (in order):
n, m = [int(w) for w in input().strip().split()]
arr = [int(w) for w in input().strip().split()]

ss = sum(arr)
frac = ss//(4*m)
flag = False
arr.sort()
for i in range(m):
  if arr[i] > frac:
    flag = True
  else:
    flag = False
    break
if flag:
  print("Yes")
else:
  print("No")

n, m = [int(w) for w in input().strip().split()]
arr = [int(w) for w in input().strip().split()]
 
ss = sum(arr)
frac = ss/(4*m)
arr.sort(reverse=True)
if arr[m-1] >= frac:
  print("Yes")
else:
  print("No")

Verdicts: Wrong Answer

Accepted
Problem: 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`.

Submission attempts (in order):
N, M = map(int, input().split())
A = list(set((map(int, input().split()))))
print(A)
vote = []
for Ai in A:
    if Ai >= (1 / (4 * M) * sum(A)):
        vote.append(Ai)
if len(vote) >= M:
    print("Yes")
else:
    print("No")

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

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

ans = N - x

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

Verdicts: Wrong Answer

Accepted
Problem: 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`.

Submission attempts (in order):
i1 = input()
i1 = i1.split()
types = int(i1[0])
select = int(i1[1])

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

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

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


import sys
import math

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

s = sum(a)
a.sort(reverse=True)
border = s / (4 * m)

ans = True

for i in range(m):
    if (a[i] >= border):
        pass
    else:
        ans = False
        break

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


Verdicts: Wrong Answer

Accepted
Problem: 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`.

Submission attempts (in order):
N,M = map(int,input().split())
A = list(map(int,input().split()))
A = sorted(A, reverse=True)
if A[M-1]<(Sum(A)/(4*M)):
  print("No")
else:
  print("Yes")

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

Verdicts: Runtime Error

Accepted
Problem: 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`.

Submission attempts (in order):
n,m=map(int, input().split())
a=list(map(float, input().split()))
A=sum(a)/(4*m)
N=sum(x>=A for x in a)
if N>=m:
    print("yes")
else:
    print("No")

n,m=map(int, input().split())
a=list(map(float, input().split()))
A=sum(a)/(4*m)
N=sum(x>=A for x in a)
if N>=m:
    print("Yes")
else:
    print("No")


Verdicts: Wrong Answer

Accepted
Problem: 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`.

Submission attempts (in order):
N,M=map(int,input().split())
A=list(map(int,input().split()))
ALL=sum(A)
print(ALL)
ave=ALL/(4*M)
count=0
for i in range(N):
    if(A[i]>=ave):
        count+=1
    else:
        pass
if(count>=M):
    print("Yes")
else:
    print("No")

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

Verdicts: Wrong Answer

Accepted