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):
am,n = list(map(int,input().split()))
arr = list(map(int,input().split()))
got = 0
for i in range(am):
	if arr[i]>=1/(4*am):
      got+=1
if got >=n:
	print("YES")
else:
  print("NO")

am,n = list(map(int,input().split()))
arr = list(map(int,input().split()))
got = 0
for i in range(am):
    if arr[i]>=1/(4*am):
        got+=1
if got >=n:
    print("YES")
else:
    print("NO")

am,n = list(map(int,input().split()))
arr = list(map(int,input().split()))
got = 0
s = sum(arr)
for i in range(am):
    if arr[i]>=s*(1/(4*n)):
        got+=1
if got >=n:
    print("Yes")
else:
    print("No")

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=[input().split() for i in range(1)]

all=0
for i in range(N):
    all+=int(A[0][i])
FLAG=int(1/(4*M)*all)
flag=0

for i in range(N):
    if FLAG>int(A[0][i]):
        flag+=1
if flag==0:
    print('Yes')
else:
    print('No')

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

all=0
for i in range(N):
    all+=int(A[0][i])

FLAG=1/(4*M)*all
flag=0

for i in range(N):
    if FLAG<=int(A[0][i]):
        flag+=1

if flag>=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()))
sum=0
for i in range(len(a)):
    sum=sum+a[i]
    
x= (sum)//(4*m)

l=[]
for j in range(len(a)):
    if(a[i]>=x):
        l.append(a[i])
        
if(len(l)>=m):
    print("Yes")
else:
    print("No")


n,m=map(int,input().split())
a=list(map(int,input().split()))
sum=0
for i in range(n):
    sum=sum+a[i]
    
x= (sum)/(4*m)
#print(x)
l=[]
for j in range(n):
    if(a[j] >= x):
        l.append(a[j])
#print(l)        
if(len(l)>=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):
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()

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

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

#s = sum(l)
s = 0
for i in l:
    s += i
    
print('s=%d' %s)

l = sorted(l,reverse=True)

print(l)

x = s * (1 / 4*m)
ans = 0

print('x = %d' %x)


for i in range(m):
    if(l[i] >= x):
        ans = ans + 1

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

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

sum = sum(l)
l = sorted(l,reverse=True)
x = sum / (1 / 4*m)
ans = 0



for i in range(m):
    if(l[i] >= x):
        ans = ans + 1

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

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

s = sum(l)
    
#print('s=%d' %s)

l = sorted(l,reverse=True)

#print(l)

x = (1 / (4*m)) * s
ans = 0

#print('x = %d' %x)


for i in range(m):
    if(l[i] >= x):
        ans = ans + 1
    #print('l[%d]=%d' %(i,l[i]))

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, M = map(int, input(). split())
A = list(map(int, input().split())
A.sort()
S = sum(A)
         
if 1/(4*M) <= A[N-M]/S :
	print("YES")
else:
	print("NO")

N, M = map(int, input(). split())
A = list(map(int, input().split())
A.sort()
S = sum(A)
         
if 1/(4M) <= A[N-M]/S :
	print("YES")
else:
	print("NO")

N, M = map(int, input(). split())
A = list(map(int, input().split()))
A.sort()
S = sum(A)
         
if 1/(4*M) <= A[N-M]/S :
	print("YES")
else:
	print("NO")

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

Verdicts: Runtime Error

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())
plist = list(map(int, input().split()))
plist.sort(reverse=True)
if(plist[m-1]<sum(plist)/4/m):
    print('no')
else:
    print('yes')

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

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()))
b=sum(a)
for i in range(n):
    if a[i]>=b/(4*m):
        a[i]=x
if a.count(x)>=m:
    print('Yes')
else:
    print('No')

n,m=map(int,input().split())
a=list(map(int,input().split()))
b=sum(a)
for i in range(n):
    if a[i]>=b/(4*m):
        a[i]=-1
if a.count(-1)>=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())
c=0
v=list(map(int,input().split()))
s=sum(v)
val=s/(m*4)
for i in range(n):
	if(val<=v[i]):
		c=c+1
if(c>=m):
	print("YES")
else:
	print("NO")

n,m=map(int,input().split())
m=4*m
m1=m//4
c=0
v=list(map(int,input().split()))
s=sum(v)
val=s/m
for i in range(n):
	if(val<=v[i]):
		c=c+1
if(c>=m1):
	print("YES")
else:
	print("NO")

from math import *
from copy import *
from string import *				
from random import *
from sys import stdin
from sys import maxsize
from operator import *				
from itertools import *
from collections import Counter		



n,m=map(int,input().split())
m=4*m
m1=m//4
c=0
v=list(map(int,input().split()))
s=sum(v)
val=s//m
for i in range(n):
	if(val<=v[i]):
		c=c+1
if(c>=m1):
	print("YES")
else:
	print("NO")

n,m=map(int,input().split())
c=0
v=list(map(int,input().split()))
s=sum(v)
v.sort(reverse=True)
val=s/(m*4)
if(v[m-1]>=val):
	print("YES")
else:
	print("NO")

n,m=map(int,input().split())
val=4*m
c=0
for i in range(n):
  v=int(input())
  v=v/val
  if(v<m):
    c=c+0
  else:
    c=c+1
if(c>=m):
  print("YES")
else:
  print("NO")

n,m = input().split()
N = int(n)
M = int(m)
a = [int(i) for i in input().split()]
a.sort(reverse=True)
k = sum(a)/(4*M)
if k > a[M-1]:
    print('No')
else:
    print('Yes')

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

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 = input().split()
m = int(m)

votes = input().split()
votes = [int(i) for i in votes]
votes.sort(reverse=True)

total = sum(votes)

valid = True
for i in range(m):
    if votes[i] <= total/(4*m):
        valid = False
        break

if valid:
    print('yes')
else:
    print('no')

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

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

total = sum(votes)

valid = True
for i in range(m):
    if votes[i] <= total/(4*m):
        valid = False
        break

if valid:
    print('yes')
else:
    print('no')

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

votes = input().split()
votes = [int(i) for i in votes]
votes.sort(reverse=True)

total = sum(votes)

valid = True
for i in range(m):
    if votes[i] < total/(4*m):
        valid = False
        break

if valid:
    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):
num = []
vote = []
num = list(map(int,input().split()))
vote = list(map(int,input().split()))
N = num[0]
M = num[1]
j = sum(vote)/(4*M)
print(j)

cnt = 0
for i in range(0,len(vote)):
    if  vote[i]>=j:
        cnt += 1
    else:
        pass
if M<=cnt:
    print("Yes")
else:
    print("No")


num = []
vote = []
num = list(map(int,input().split()))
vote = list(map(int,input().split()))
N = num[0]
M = num[1]
j = sum(vote)/(4*N)
cnt = 0
for i in range(0,len(vote)-1):
    if  vote[i]>=j:
        cnt += 1
    else:
        pass
if N<=cnt:
    print("Yes")
else:
    print("No")


num = []
vote = []
num = list(map(int,input().split()))
vote = list(map(int,input().split()))
N = num[0]
M = num[1]
j = sum(vote)/(4*M)
#print(j)

cnt = 0
for i in vote:
    if  i>=j:
        cnt += 1
    else:
        pass
#print(cnt)
if M<=cnt:
    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())
List = list(map(int, input().split()))
stand = 1 / (4 * M) * sum(List)
arr = []
for i in range(List):
  if List[i] >= stand:
    arr.append(List[i])
if len(arr) >= M:
  print("Yes")
else:
  print("No")
  

N ,M = map(int, input().split())
List = list(map(int, input().split()))
stand = 1 / (4 * M) * sum(List)
arr = []
for i in range(len(List)):
  if List[i] >= stand:
    arr.append(List[i])
if len(arr) >= 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 math
n,m=map(int,input().split())
a=list(map(int,input().split()))
a.sort()
if a(n-m)<math.ceil(sum(a)//(4*m)):
  print('No')
else:
  print('Yes')


n,m=map(int,input().split())
a=list(map(int,input().split()))
count=0
for i in a:
  if i>=sum(a)/(4*m):
    count+=1
if count>=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):
m = input()
a = list(input())
x = int(0)

n, m = m.split()
n = int(n)
m = int(m)

list.sort(a)

for i in range(len(a)- 1, n, -1):
    print(i)
    x += int(a[i])

for i in range(len(a)- 1, len(a) - m -1, -1):
    print(i)
    if int(a[i]) // 4 * int(m) < 0:
        print('No')
        exit()

print('Yes')


m = input()
a = input()
x = int(0)
y1, y2 = int(0)

n, m = m.spilit()

for i in range(0, len(a), 2):
    x += int(a[i])
    y2 = y1 if y1 < int(a[i]) else y2
    y1 = int(a[i]) if y1 < int(a[i]) else y1

if not y1 // 4 * m or y2 // 4 * m:
    print('Yes')

else:
    print('No')


m = input()
b = input()
x = int(0)
a = list()

n, m = m.split(' ')
n = int(n)
m = int(m)

b = b.split(' ')
for i in range(len(b)):
    a.append(int(b[i]))

list.sort(a, reverse = True)

for i in range(len(a)):
    x += int(a[i])

for i in range(m):
    print(a)
    if int(a[i]) < x / (4 * m):
        print('No')
        exit()

print('Yes')


m = input()
b = input()
x = int(0)
a = list()

n, m = m.split(' ')
n = int(n)
m = int(m)

b = b.split(' ')
for i in range(len(b)):
    a.append(int(b[i]))

list.sort(a, reverse = True)

for i in range(len(a)):
    x += int(a[i])

for i in range(m):
    if int(a[i]) < x / (4 * m):
        print('No')
        exit()

print('Yes')


Verdicts: Wrong Answer

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

b = list(map(int, input().split()))
n = b[0]
m = b[1]
a = list(map(int, input().split()))
sum = sum(a)
a = sorted(a, reverse=True)

if a[m - 1] < (1 / (4 * m)) * sum:
    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()))
a.sort(reverse=True)
s = sum(a)
print(a,s)
if a[m-1] < s/(4*m):
    print("No")
else:
    print("Yes")

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


N,M=map(int,input().split())
s=int(input())
S=sum(s)
if sorted(s)[-1:-M]<S/(4*M):
    print('No')
else:
    print('Yes')


x,y = map(int,input().split())
A=[int(input())  for i in range(x)]
T=sum(A)
a=0
for i in range(x):
  if A[i]<1/(4*T):
    a+=1
if a>=y:
  print('Yes')
else:
  print('No')


N,M,s=map(int,input().split())
S=sum(s)
if sorted(s)[-1:-M]<S/(4*M):
    print('No')
else:
    print('Yes')


N,M,s=map(int,input().split())
S=sum(s)
if sorted(s)[-1:-m]<S/(4*M):
    print('No')
else:
    print('Yes')



N,M,s=map(int,input().split())
S=sum(s)
m=sorted(s)[-M]
if m<S/(4*M):
    print('No')
else:
    print('Yes')


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


Verdicts: Wrong Answer

Runtime Error

Runtime Error

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):
N, M = map(int, input().split())
A_list = list(map(int, input().split()))

cnt = N
A_sum = sum(A_list)

for i in range(N):
    if A_list[i] <= int(A_sum/4/M):
        cnt -= 1
if cnt >= M:
    print("yes")
else:
    print("No")

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

cnt = 0
A_sum = sum(A_list)

for i in range(N):
    if A_list[i] >= A_sum/4/M:
        cnt += 1
if cnt >= M:
    print("yes")
else:
    print("No")

import math

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

cnt = 0
A_sum = sum(A_list)

for i in range(N):
    if A_list[i] >= math.ceil(A_sum/4/M):
        cnt += 1
if cnt >= M:
    print("yes")
else:
    print("No")


import math

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

cnt = M
A_sum = sum(A_list)

for i in range(N):
    if A_list[i] <= int(A_sum/4/M):
        cnt -= 1
if cnt >= M:
    print("yes")
else:
    print("No")


import math

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

cnt = 0
A_sum = sum(A_list)

for i in range(N):
    if A_list[i] >= math.ceil(A_sum/4/M):
        cnt += 1
if cnt >= M:
    print("Yes")
else:
    print("No")


Verdicts: 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):
n,m = input().split()n,m = input().split()
n = int(n)
m = int(m)
arr = list(map(int,input().split()))
minn = sum(arr)*(1/(4*m))
t = 0
for i in arr:
  if i >= minn:
    t += 1
if t >= m:
  print("Yes")
else:
  print("No")

n,m = input().split()
n = int(n)
m = int(m)
arr = list(map(int,input().split()))
minn = sum(arr)*(1/(4*m))
t = 0
for i in arr:
  if i >= minn:
    t += 1
#print(t)
if t >= 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(" "))
lis2=[]
for i in range(0,n):
	lis2.append(int(input()))
lis2=sorted(lis2,reverse=True)
sum1=sum(lis2)
count=0
for i in range(0,m):
  if(lis2[i]>=((1/(4*m))*sum1)):
    count=0
  else:
    count=1
    break
if(count==1):
  print("No")
else:
  print("Yes")

n,m=map(int,input().split(" "))
lis2=[]
for i in range(0,n):
	lis2.append(int(input()))
lis2=sorted(lis2,reverse=True)
sum1=sum(lis2)
count=0
for i in range(0,m):
  if(lis2[i]>=((1/(4*m))*sum1)):
    count=0
  else:
    count=1
    break
if(count==1):
  print("No")
else:
  print("Yes")

n,m=map(int,input().split(" "))
lis2=map(int,input().split(" "))

lis2=sorted(lis2,reverse=True)
sum1=sum(lis2)
count=0
for i in range(0,m):
  if(lis2[i]>=((1/(4*m))*sum1)):
    count=0
  else:
    count=1
    break
if(count==1):
  print("No")
else:
  print("Yes")

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()))
count =0
s = sum(A)
m = s//(4*M)
for i in range(N):
  if A[i] >= m:
    count += 1
if count == M:
  print("Yes")
else:
  print("No")


N,M=map(int, input().split())
A = list(map(int, input().split()))
count =0
s = sum(A)
m = s/(4*M)
for i in range(N):
  if A[i] >= 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(set((map(int, input().split()))))
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(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: 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):
# -*- coding: utf-8 -*-
N, M = list(map(int, input().split()))
A = list(map(int, input().split()))
A = sorted(A, reverse=True)
if (A[M - 1] > sum(A) / (4 * M)):
    print('yes')
else:
    print('No')

# -*- coding: utf-8 -*-
N, M = list(map(int, input().split()))
A = list(map(int, input().split()))
A = sorted(A, reverse=True)
if (A[M - 1] >= 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())
l = list(map(int, input().split()))  

S = sum(l)

lr = [i for i in l if i >= S/4M]

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

N, M = map(int, input().split())
l = list(map(int, input().split()))  
 
S = sum(l)
X = 4*M
 
lr = [i for i in l if i >= S/X]
 
if len(lr) >= M:
  	print("Yes")
else:
  	print("No")

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_lst = []
a_lst = list(map(int, input().split()))
# print()
percent = sum(a_lst) / (4 * m)
cnt = 0
for i in range(n):
    print("a", a_lst[i])
    
    if a_lst[i] >= percent:
        cnt += 1
if cnt >= m:
    print('Yes')
else:
    print('No')

n, m = map(int, input().split())
a_lst = []
a_lst = list(map(int, input().split()))
# print()
percent = sum(a_lst) / (4 * m)
cnt = 0
for i in range(n):
    # print("a", a_lst[i])
    
    if a_lst[i] >= percent:
        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())
A = list(map(int, input().split()))

sumA = sum(A)

filteredA = list(filter(lambda x: x < (sumA / (4*M)), A))

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


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

sumA = sum(A)

filteredA = list(filter(lambda x: x >= (sumA / (4*M)), A))

if M <= len(filteredA):
    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):
try:
    N_s,M_s=input().split(' ')
    N=int(N_s)
    M=int(M_s)
    
    if N>=1 and N<=100 and M>=1 and M<=100:
        votes=input().split(' ')
        counter=0
        vote= list(map(int, votes))
        summer=sum(vote)
        percent=summer/(4*M)
        print(percent)
        for i in vote:
            if i>percent:
                counter+=1
        if counter>=M:
            print('Yes')
        else :
            print('No')
        
except Exception as e:
    print(e)


try:
    N_s,M_s=input().split(' ')
    N=int(N_s)
    M=int(M_s)
    
    if N>=1 and N<=100 and M>=1 and M<=100:
        votes=input().split(' ')
        counter=0
        vote = [int(i) for i in votes]
        summer=sum(vote)
        percent=summer/(4*M)
        for i in votes:
            if int(i)>=percent:
                counter+=1
        if counter>=M:
            print('Yes')
        else :
            print('No')
        
except Exception as e:
    print(e)

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

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

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

print(A[M-1])

result = 'No' if A[M-1] < sum(A) / (4 * M) else 'Yes'
print(result)


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

result = 'No' if A[M-1] < sum(A) / (4 * M) else 'Yes'
print(result)


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().strip().split())
A = map(int, input().strip().split())
t = (1 / (4 * m)) * sum(A)
s = sum([(v >= t) for v in A])
print('Yes') if s >= m else print('No')


n, m = map(int, input().strip().split())
A = list(map(int, input().strip().split()))
t = (1 / (4 * m)) * sum(A)
g = [(v >= t) for v in A]
s = sum(g)
print('Yes') if s >= m 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):

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


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

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):
M, N = list(map(int, input().split()))
a = list(map(int, input().split()))
a.sort(reverse=True)

flg = True

soutouhyou = int(sum(a) * (1 / (4 * M)))

count = 0

if soutouhyou > 0:
    for num in list(range(M)):
        if a[num] >= soutouhyou:
            count += 1

if count > N:
    print('Yes')
else:
    print('No')


N, M = list(map(int, input().split()))
a = list(map(int, input().split()))
a.sort(reverse=True)

rate = sum(a) * (1 / (4 * M))

count = 0

for num in list(range(M)):
    if a[num] >= rate:
        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):

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

list.sort(a, reverse=True)

ans = "No"


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

n,k = map(int,input().split())

ans1 = n%k

if ans1 > k-ans1:
  ans1 = k-ans1
print(ans1)

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

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

list.sort(a, reverse=True)

ans = "No"

if a[2] > 4*m :
  ans = "Yes"
print (ans)

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

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

list.sort(a, reverse=True)

ans = "No"


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

Verdicts: Runtime Error

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=list(map(int,input().split()))
A.sort
B=len(A)
c=0
for i in range(B):
 c+=A[i]
if A[B-M]>=c/4:
 print("Yes")
else:
 print("No")

N,M = map(int,input().split())
A = list(map(int,input().split()))
c=0
for i in range(len(A)):
 c+=A[i]
d=c/4/M
e=0
for i in range(len(A)):
 if A[i]>=d:
  e+=1
if e>=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 = map(int,input().split()) 
G = sum(a) 
num = 1/(4*G)
s = 
yesman = 0
while a(:n)
if s >= num:
  yesman = yesman + 1
  
if yesman >= m:
  print("Yes")
else : print("No")

N,M = map(int,input().split())
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")

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()))
u = sum(a) / (4*m)
print(u)
l = 0
for i in a:
    if i >= u:
        l += 1
print("Yes") if l >= m else print("No")

n, m = map(int, input().split())
a = list(map(int, input().split()))
u = sum(a) / (4*m)
l = 0
for i in a:
    if i >= u:
        l += 1
print("Yes") if l >= m 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 = [int(x) for x in input().strip().split()]
a= n, m = [int(x) for x in input().strip().split()]

a.sort(reverse=True)
s = sum(a)
thresh = s/(4*m)
flag=True
for i in range(m):
    if a[i]< thresh:
        flag=False
        break

if flag:
    print("YES")
else:
    print("NO")

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

a.sort(reverse=True)
s = sum(a)
thresh = s/(4*m)
flag=True
for i in range(m):
    if a[i]< thresh:
        flag=False
        break

if flag:
    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):
from sys import stdin

N, M = [int(x) for x in stdin.readline().rstrip().split()]
A = [int(x) for x in input().split()]

# print(N, M, A)
A.sort()
b = sum(A)*(1/(4*M))
# print(b)
if A[N-1-M-1] >= b:
    print("Yes")
else:
    print("No")
# print(A)


from sys import stdin

N, M = [int(x) for x in stdin.readline().rstrip().split()]
A = [int(x) for x in input().split()]

# print(N, M, A)
A.sort()
if sum(A) % (4*M) == 0:
    b = sum(A)//(4*M)
else:
    b = sum(A)//(4*M)+1
# print(b,A,A[N-1-M+1])
if A[N-1-(M-1)] >= b:
    print("Yes")
else:
    print("No")
# print(A)


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):
a,b,c = list(map(int,input().split()))
a,b = b,a
a,c = c,a
print(a," ",b," ",c)

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: 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())
lis = list(map(int,input().split()))
lis.sort()
t = sum(lis)
c=0
condition = 1/(2*m)
cost = t*condition
for i in range(len(lis)):
  if(lis[i]>cost):
    c+=1
if(c>=m):
  print("Yes")
else:
  print("No")

n,m = map(int,input().split())
lis = list(map(int,input().split()))
lis.sort()
t = sum(lis)
c=0
for i in range(m):
  if(lis[i]>(1/(2*m))):
    c+=1
  else:
    break
if(c==m):
  print("YES")
else:
  print("NO")

n,m = map(int,input().split())
lis = list(map(int,input().split()))
lis.sort()
t = sum(lis)
c=0
condition = 1/(4*m)
cost = t*condition
for i in range(len(lis)):
  if(lis[i]>cost):
    c+=1
if(c>=m):
  print("YES")
else:
  print("NO")

n,m = map(int,input().split())
lis = list(map(int,input().split()))
lis.sort()
t = sum(lis)
c=0
for i in range(len(lis)):
  if(lis[i]>(1/(2*m))):
    c+=1
  else:
    break
if(c==m):
  print("YES")
else:
  print("NO")

n,m = map(int,input().split())
lis = list(map(int,input().split()))
lis.sort()
t = sum(lis)
c=0
for i in range(len(lis)):
  if(lis[i]>(1/(2*m))):
    c+=1
if(c>=m):
  print("YES")
else:
  print("NO")

n,m = map(int,input().split())
lis = list(map(int,input().split()))
lis.sort()
t = sum(lis)
c=0
condition = 1/(4*m)
cost = t*condition
for i in range(len(lis)):
  if(lis[i]>=cost):
    c+=1
if(c>=m):
  print("Yes")
else:
  print("No")

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):
nmlist = list(map(int, input().split()))
svote = list(map(int, input().split()))
allvote = sum(svote)
maxvote = max(svote)
n0 = nmlist[1] - 1
n1 =  n0 / allvote
n2 = 1 / (4 * nmlist[1])
if n1 > n2:
    print("Yes")
else:
    print("No")


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


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(x) for x in input().split())
num_point = [int(x) for x in input().split()]
count = 0

print(sum(num_point))
for n in num_point:
    n > (sum(num_point)/(4*m))
    count += 1

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


n, m = (int(x) for x in input().split())
num_point = [int(x) for x in input().split()]
count = 0

for n in num_point:
    n > sum(num_point) * 1 / (4 * m)
    count += 1
    print(n)

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


n, m = (int(x) for x in input().split())
num_point = [int(x) for x in input().split()]
count = 0
 
for n in num_point:
    if n >= (sum(num_point) / (4 * m)):
        count += 1
 
if count >= 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 = list(map(int,input().split()))

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

min_hyou = 1/(4*m) * sum
count = 0
for i in range(len(a)):
    if min_hyou < a[i]:
        count+=1
if count==m:
    print("Yes")
else:
    print("No")

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

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

min_hyou = int(1/(4*m) * sum)
print(min_hyou)

count = 0
for i in range(len(a)):
    if min_hyou < a[i]:
        count+=1
if count>=m:
    print("Yes")
else:
    print("No")

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

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

min_hyou = sum/(4*m)

count = 0
for i in range(len(a)):
    if min_hyou <= a[i]:
        count+=1
if count>=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=list(map(int, input().split()))

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


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

cnt=0
sou=sum(a)
for i in range(n):
    if a[i]>=sou/(4*m):
        cnt+=1
print('Yes' if cnt>=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()))
all_vote = 0
x = 1 # =true


for i in range(N-1):
    all_vote = all_vote + A[i]
    if A[i] < (1/4)*M*all_vote:
        x = 0 # =false

if x == 1:
    print("Yes")
else:
    print("No")


N, M = map(int, input().split())
A = list(map(int, input().split()))
all_vote = sum(A)
count = 0


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

if count < 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):

m, n = input().split()
a = input().split()
sum_a = sum(a) / (4 * m)

yes_num = 0
no_num = 0

ok = m
ng = n - m

for i in a:
    if i < sum_a:
        no_num += 1
    else:
        yes_num += 1
    if no_num > ng:
        break
    if yes_num >= ok:

        exit(0)

print("No")



n, m = input().split()
m = int(m)
n = int(n)
a = input().split()
sum_a = sum(int(i) for i in a) / (4 * m)

yes_num = 0
no_num = 0

ok = m
ng = n - m

for i in a:
    if int(i) < sum_a:
        no_num += 1
    else:
        yes_num += 1
    if no_num > ng:
        break
    if yes_num >= ok:
        print("Yes")
        exit(0)

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

num = 0

for i in list:
    if i >= sum(list)/(4*M):
        num+=1

print(num)

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

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

num = 0

for i in list:
    if int(i) >= sum(list)/(4*M):
        num+=1

if num >= M:
    print('yes')
else:
    print('No')


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

num = 0

for i in list:
    if i >= sum(list)/(4*M):
        num+=1

if num >= 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().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")

n, m = map(int,input().strip().split())
lst = list(map(int, input().split()))
summ = 0
for i in lst:
    summ += i
# print(summ)
sol = 1/(m * 4)
# print(sol)
res = sol*summ
# print(res)
if lst[m] > res:
    print("YES")
else:
    print("NO")

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


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

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

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

Verdicts: Wrong Answer

Runtime Error

Wrong Answer

Wrong Answer

Wrong Answer

Accepted