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

std = sum(a)*1/(4*m)
print(std)

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



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


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

std = sum(a)*(1/(4*m))

cnt = 0
for i in range(n):
    if a[i] >= std:
        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, k = map(int, input().split())
a = abs( n % k)
b = abs(  a - (n + a) % k)
if a < b:
    print(a)
else:
    print(b)

n, m = map(int, input().split())
a = list(map(int, input().split()))
requiredValue = float(sum(a)) / 4 / m
count = 0

for x in a:
    if x >= requiredValue:
        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 = [int(x) for x in input().split()]
l = [int(x) for x in input().split()]
k = []
for i in l:
  if(i >= sum(l)/(4*m)):
    k.append(i)
if(len(k) < m):
  print("No")
else:
print("Yes")

n, m = [int(x) for x in input().split()]
l = [int(x) for x in input().split()]
k = []
for i in l:
  if(i > sum(l)/(4*m))
  	k.append(i)
if(len(k) < m):
  print("No")
else:
  print("Yes")

n, m = [int(x) for x in input().split()]
l = [int(x) for x in input().split()]
k = []
for i in l:
  if(i >= sum(l)/(4*m)):
    k.append(i)
if(len(k) < m):
  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 =input().split()
A = [int(i) for i in input().split()]
A.sorted(reverse=True)
ans="Yes"
th = sum(A)/(4*M)
print(type(th))
for i in range(M):
  if A[M-1-i] < th:
    ans="No"
    break
print(ans)  

N,M =input().split()
A = list(map(int, input().split()))
A.sort(reverse=True)
ans="Yes"

th = sum(A)/(4*int(M))
for i in range(int(M)):
  if A[int(M)-1-i] < th:
    ans="No"
    break
print(ans)  

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

s = sum(a)

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

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

s = sum(a)

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

N,M = map(int,input().split())
a = sorted(list(map(int,input().split())),reverse=True)
a
s = sum(a)

if a[M-1] >= s/(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):
nm = list(map(int, input().split()))
a = list(map(int, input().split()))
Sum=0
flag=0

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

a.sort(reverse=True)

for i in range(nm[1]):
    if a[i]<sum/(4*nm[1]):
        flag=1
        break

if flag==1:
    print(No)
else:
    print(Yes)


nm = list(map(int, input().split()))
a = list(map(int, input().split()))
Sum=0
flag=0

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

a.sort(reverse=True)

for i in range(nm[1]):
    if a[i]<Sum/(4*nm[1]):
        flag=1
        break

if flag==1:
    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()))

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

L = [i for i in A if i >= judge]
print(L)


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

N, M = map(int, input().split())
A = list(map(int, input().split()))
judge = sum(A) / (4 * M)

L = [i for i in A if i >= judge]

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):
N,M = map(int, input().split())
vote_list = [int(i) for i in input().split()]
vote_list.sort(reverse=True)

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

N,M = map(int, input().split())
vote_list = [int(i) for i in input().split()]
vote_list.sort(reverse=True)

Mth_got_vote = vote_list[M - 1]

if Mth_got_vote < sum(vote_list) / (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):
def main():
    N,M=map(int,input().split())
    str=list(map(int,input().split()))
    cal=sum(str)/(4*M)
    print(sorted(str, reverse=True))


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

    print("Yes")
    return

main()


def main():
    N,M=map(int,input().split())
    str=list(map(int,input().split()))
    cal=sum(str)
    str.sort(reverse=True)

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

    print("Yes")
    return

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):
a=list(map(int,input().split(" ")))
n=a[0]
m=a[1]
touhyou=list(map(int,input().split(" ")))
s=flaot(sum(touhyou)/4/m)
list=[]
for i in touhyou:
  if i>=s:
    list.append(i)
if len(list)>=m:
  print("Yes")
else:
  print("No" )
a=list(map(int,input().split(" ")))
n=a[0]
m=a[1]
touhyou=list(map(int,input().split(" ")))
s=flaot(sum(touhyou)/4/m)
list=[]
for i in touhyou:
  if i>=s:
    list.append(i)
if len(list)>=m:
  print("Yes")
else:
  print("No" )


a=list(map(int,input().split()))
n=a[0]
m=a[1]
touhyou=list(map(int,input().split()))
s=float(sum(touhyou)/4/m)
list=[]
for i in touhyou:
  if i>=s:
    list.append(i)
if len(list)>=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()))

sum_a = sum(a)
a = a.sort()
cnt = 0
for i in a:
    if i >= 1 / (4*sum_a):
        cnt += 1
if cnt >= M:
    print('Yes')
else:
    print('No')

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

sum_a = sum(a)
a = sorted(a)

cnt = 0
for i in a:
    if i >= sum_a / (4*m):
        cnt += 1
if cnt >= 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):
a,b = map(int, input().split())
List = list(map(int, input().split()))
c = sum(List)
List = sorted(List)[::-1]
d = List(b-1)
if d < c/4/b;
	print("No")
elif
	print("Yes")

a,b = map(int, input().split())
List = list(map(int, input().split()))
c = sum(List)
List = sorted(List)[::-1]
d = List(b-1)
if d < c/4/b:
	print("No")
else:
	print("Yes")

a,b = map(int, input().split())
List = list(map(int, input().split()))
c = sum(List)
List = sorted(List)[::-1]
d = List[b-1]
if d < c/4/b:
	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()))
Sum=sum(A)
pop=[]
l=Sum/(4*M)
for i in range(N):
    if(A[i]>l):
        pop.append(A[i])
        
print("Yes" if len(pop)==M else "No")

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


A=list(map(int,input().split()))
Sum=sum(A)
pop=[]
l=Sum/(4*M)
for i in range(N):
    if(A[i]>=l):
        pop.append(A[i])
        
print("Yes" if len(pop)==M else "No")

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


A=list(map(int,input().split()))
Sum=sum(A)
pop=[]
l=Sum/(4*M)
for i in range(N):
    if(A[i]>=l):
        pop.append(A[i])
        
print("Yes" if len(pop)>=M else "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 = list(map(int, input().split()))
a_list.sort(reverse=True)

total_votes = sum(a_list)

print(a_list[m-1])

if a_list[m-1] < total_votes / (4 * m):
    print('Yes')
else:
    print('No')

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

a_list = list(map(int, input().split()))
a_list.sort(reverse=True)

total_votes = sum(a_list)

print(a_list[m-1])

if a_list[m-1] < total_votes / (4 * m):
    print('No')
else:
    print('Yes')

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

a_list = list(map(int, input().split()))
a_list.sort(reverse=True)

total_votes = sum(a_list)

if a_list[m-1] < total_votes / (4 * m):
    print('No')
else:
    print('Yes')

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())
m = int(input())
a = list(map(int,input().split()))
sum = sum(a)
count = 0

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

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

t = list(map(int,input().split()))
a = list(map(int,input().split()))
s = sum(a)
count = 0

for i in range(t[0]):
    if a[i] >= s/(4 * t[1]):
        count += 1

if count >= t[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):
N, M = map(int, input().split())
A = list(map(int, input().split()))
ans = 'Yes'
A.sort(reverse=True)
print(A)
for i in range(M):
    if A[i] < sum(A)/(4*M):
        ans = 'No'
        break
print(ans)


N, M = map(int, input().split())
A = list(map(int, input().split()))
ans = 'Yes'
A.sort(reverse=True)
for i in range(M):
    if A[i] < sum(A)/(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):
from sys import stdin
N,M=list(map(int,(stdin.readline().strip().split())))
A=list(map(int,(stdin.readline().strip().split())))
hyou=int(sum(A)/(4*M))
count=0
for i in range(N):
    if A[i]>hyou:count+=1
if count>=M:print("yes")
else:print("no")

from sys import stdin
N,M=list(map(int,(stdin.readline().strip().split())))
A=list(map(int,(stdin.readline().strip().split())))
hyou=sum(A)/(4*M)
count=0
for i in range(N):
    if (A[i])<hyou:continue
    count+=1
if count>=M:print("yes")
else:print("no")

from sys import stdin
N,M=list(map(int,(stdin.readline().strip().split())))
A=list(map(int,(stdin.readline().strip().split())))
hyou=sum(A)/(4*M)
count=0
for i in range(N):
    if float(A[i])>=hyou:count+=1
if count>=M:print("yes")
else:print("no")

from sys import stdin
N,M=list(map(int,(stdin.readline().strip().split())))
A=list(map(int,(stdin.readline().strip().split())))
hyou=int(sum(A)/(4*M))
count=0
for i in range(N):
    if A[i]>=hyou:count+=1
if count==M:print("yes")
else:print("no")

from sys import stdin
N,M=list(map(int,(stdin.readline().strip().split())))
A=list(map(int,(stdin.readline().strip().split())))
hyou=int(sum(A)/(4*M))
count=0
for i in range(N):
    if A[i]<hyou:count=count
    else:count+=1
if count>=M:print("yes")
else:print("no")

from sys import stdin
N,M=list(map(int,(stdin.readline().strip().split())))
A=list(map(int,(stdin.readline().strip().split())))
hyou=int(sum(A)/(4*M))
count=0
for i in range(N):
    if A[i]>hyou:count+=1
if count>=M:print("yes")
else:print("no")

from sys import stdin
N,M=list(map(int,(stdin.readline().strip().split())))
A=list(map(int,(stdin.readline().strip().split())))
hyou=sum(A)/(4*M)
count=0
for i in range(N):
    if A[i]>=hyou:count+=1
if count>=M:print("yes")
else:print("no")

from sys import stdin
N,M=list(map(int,(stdin.readline().strip().split())))
A=list(map(int,(stdin.readline().strip().split())))
hyou=sum(A)/(4*M)
count=0
for i in range(N):
    if A[i]>=hyou:count+=1
if count>=M:print("yes")
else:print("no")

from sys import stdin
N,M=list(map(int,(stdin.readline().strip().split())))
A=list(map(int,(stdin.readline().strip().split())))
hyou=sum(A)/(4*M)
count=0
for i in range(N):
    if float(A[i])>=hyou:count+=1
if count>=M:print("yes")
else:print("no")

from sys import stdin
N,M=list(map(int,(stdin.readline().strip().split())))
A=list(map(int,(stdin.readline().strip().split())))
hyou=(sum(A)/(4*M))
count=0
for i in range(N):
    if (A[i])<hyou:continue
    count+=1
if count>=M:print("Yes")
else:print("No")

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

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

a.sort(reverse=True)

vote = sum(a)

if a[m-1] => vote*1/(4*m):
  print('Yes')
else:
  print('No')


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

a.sort(reverse=True)

vote = sum(a)

if a[m-1] >= vote*1/(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())
list = [int(i) for i input().split()]

total = 0
for i in range(N):
    if i >= sum(list) / (4 * M):
        total = total + 1

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

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

total = 0
for i in range(N):
    if i >= (sum(list) / (4 * M)):
        total = total + 1

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

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

total = 0
for i in range(N):
    if i >= (sum(list) / (4 * M)):
        total = total + 1

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

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

total = 0
for i in A:
    if i >= (sum(A) / (4 * M)):
        total = total + 1

if total >= M:
    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):
N, M = [int(x) for x in input().split()]
A = [int(x) for x in input().split()]
A.sort()
A.reverse()
total = 0
Flag = True
for i in A:
    total += i
for i in range(M):
    if A[i] < total/(M*4):
        Flag = False
if Flag:
    print("YES")
else:
    print("NO")

N, M = [int(x) for x in input().split()]
A = [int(x) for x in input().split()]
A.sort()
A.reverse()
total = 0
Flag = True
for i in A:
    total += i
for i in range(M):
    if A[i]*4*M < total:
        Flag = False
if Flag:
    print("YES")
else:
    print("NO")

N, M = [int(x) for x in input().split()]
A = [int(x) for x in input().split()]
A.sort()
A.reverse()
total = 0
Flag = True
for i in A:
    total += i
for i in range(M):
    if A[i]*4*M < total:
        Flag = False
if Flag:
    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())
x = list(map(int,input().split()))
x.sort(reverse = True)
sumx = sum(x)
limit = sumx/4/m
print(limit)
if x[m-1]>=limit:
    print("Yes")
else:
    print("No")

n,m = map(int,input().split())
x = list(map(int,input().split()))
x.sort(reverse = True)
sumx = sum(x)
limit = sumx/4/m
#print(limit)
if x[m-1]>=limit:
    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()))
print("Yes" if len([i for i in a if i/sum(a) >= 1/(4 * m)]) >= n else "No")

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


n,m = map(int,input().split())
num = list(map(int,input().split()))
limit = sum(num)/(4*m)
count = 0
for i in range(n):
  if num[i] >= limit: 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):
n,m=map(int,input().split())
a=[2,1,3]
a=list(map(int,input().split()))

b=sorted(a,reverse=True)
if b[m-1]*4*m <= n:
    print("Yes")
else:
    print("No")

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

b=sorted(a,reverse=True)
if b[m-1]*4*m >= sum(b):
    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):
mn = input().split()
ob = input().split()

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

votes = 0

for i in range(n):
    ob[i] = int(ob[i])
    votes += ob[i]

ob.sort(reverse=true)

line = votes/4/m

ans = 0

for i in range(m):
    if ob[i] <= line:
        ans += 1

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


mn = input().split()
ob = input().split()

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

votes = 0

for i in range(n):
    ob[i] = int(ob[i])
    votes += ob[i]

ob.sort(reverse = True)

line = votes/4/m

ans = 0

for i in range(m):
    if ob[i] < line:
        ans += 1

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

a=list(map(int, input().split()))
n=a[0]
m=a[1]
l=list(map(int, input().split()))
lm=sum(l)
for i in range(n):
    if l[i]*4*m<lm:
        print("No")
        exit()
print("Yes")

a=list(map(int, input().split()))
n=a[0]
m=a[1]
l=list(map(int, input().split()))
lm=sum(l)
l=sorted(l)
for i in range(m):
    if l[i]*4*m<lm:
        print("No")
        exit()
print("Yes")

a=list(map(int, input().split()))
n=a[0]
m=a[1]
l=list(map(int, input().split()))
lm=sum(l)
l=sorted(l, reverse=True)
print(l)
for i in range(m):
    if l[i]*4*m<lm:
        print("No")
        exit()
print("Yes")

a=list(map(int, input().split()))
n=a[0]
m=a[1]
l=list(map(int, input().split()))
lm=sum(l)
l=sorted(l, reverse=True)
for i in range(m):
    if l[i]*4*m<lm:
        print("No")
        exit()
print("Yes")

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 = map(int,input().split())
ai = list(map(int,input().split()))
s = sum(ai)
check = s/4/m
count = 0
for i in ai:
  if i > round(check, 0):
    print(round(check, 0))
    count += 1
if count >= m:
  print('Yes')
else:
  print('No')

n,m = map(int,input().split())
ai = list(map(int,input().split()))
s = sum(ai)
count = 0
for i in ai:
  if i >= s/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):
(a, b)=list(map(int, input().split()))

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

ksum= sum(k)
k.sort(reverse=True)
#print(k)
p = 'Yes'
for i in range(b):
    #print(i)
    if k[i] <= ksum/4/b:
        p = 'No'
        break


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

sums = sum(a)
count = 0

for i in a:
  #print(i, sum)
  if i >= (sums / ( M * 4 )):
    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()))

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


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

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


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

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


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

n, m = map(int,input().split())
a = list(map(int,input()split()))
s = sum(a) 
a.sort(reserve=True)
if a[m-1] >= s*(1/4):
    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*(1/(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):
S = input();
 
if S[2]==S[3] and S[4]==S[5]:
  print("Yes");
else:
  print("No");


N,M=(int(a) for a in input().split());
A=input();
A=A.split()
B = [int(s) for s in A]
sum = sum(B)

line = sum/4/M
point = 0;
length = len(B);

for i in range(length):
    if B[i] >= line:
        point += 1;
    else:
        pass;
    
if point >= 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()))

s = sum(A)
A=sorted(A)
for i in range(N):
    if i == M-1:
        if (s/(4*M))>A[i]:
            print('No')
        else:
            print('Yes')

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

s = sum(A)
A.sort(reverse=True)

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

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

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

if cnt < M:
  print("No")
else:
  print("Yes")

n, m = map(int, input().split())
a = list(map(int, input().split()))
cnt = 0
 
for i in a:
  if i >= (1/(4*m)):
    cnt += 1

if cnt < M:
  print("No")
else:
  print("Yes")

n, m = map(int, input().split())
a = list(map(int, input().split()))
cnt = 0
 
for i in a:
  if i >= sum(a)*(1/(4*m)):
    cnt += 1

if cnt >= m:
  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):
N, K = map(int, input().split())
if 0 <= N <= 10^18 and 1 <= K <= 10^18:
    if N>K:
        N = abs(N-K)
        N = abs(N-K)
        print(N)
    else:
        print(N)
else:
    print("0")

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

n, m = map(int, input().split())
a = list(map(int, input().split()))
flg = sum([4 * a[i] * m >= sum(a) for i in range(n)]) >= m
print('Yes' if flg else '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):
line1 = input().split()
n = int(line1[0])
m = int(line1[1])
line2 = input().split()
line2 = [int(i) for i in line2]
total = sum(line2)
line2 = sorted(line2)
if line2[m-1] > total / (4 * m):
  print("Yes")
else:
  print("No")

line1 = input().split()
n = int(line1[0])
m = int(line1[1])
line2 = input().split()
line2 = [int(i) for i in line2]
total = sum(line2)
line2 = sorted(line2, reverse=True)
if line2[m-1] >= total / (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 = input()
lis1 = input().split(' ')
S = sum(lis1)
thresh = S / (4 * M)
lis2 = sorted(lis1)
if lis2[M - 1] < thresh:
  print 'No'
else:
  print 'Yes'

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

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

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

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):
N,M = map(int, input().split())
list_A = input().split()
list_A_int = [int(s) for s in list_A]
list_A_int_sort = sorted(list_A_int, reverse=True)

print(list_A_int_sort)

compare_num = 1/(4*M)

if list_A_int_sort[M-1] < compare_num:
  print("No")
else:
  print("Yes")

N,M = map(int, input().split())
list_A = input().split()
list_A_int = [int(s) for s in list_A]
list_A_int_sort = sorted(list_A_int, reverse=True)

compare_num = sum(list_A_int)/(4*M)

if list_A_int_sort[M-1] < compare_num:
  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)
suma = sum(a)
if a[n - 1] >= suma * (4 * m):
    print('Yes')
else:
    print('No')


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

a.sort(reverse=True)
suma = sum(a)
if a[m - 1] >= suma * (4 * m):
    print('Yes')
else:
    print('No')


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

a.sort(reverse=True)
suma = sum(a)
if a[n - 1] * (4 * m) >= suma:
    print('Yes')
else:
    print('No')


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

a.sort(reverse=True)
suma = sum(a)
if a[m - 1] >= suma / (4 * 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):
N,M = map(int,input().split())
score = list(map(int,input().split()))
score = sorted(score,reverse=True)
if score[M−１]*4*M < sum(score):
    print("No")
else:
    print("Yes")


N,M = map(int,input().split())
score = list(map(int,input().split()))
score = sorted(score,reverse=True)
if score[M-1]*4*M < sum(score):
    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
stdin = sys.stdin

ns = lambda: stdin.readline().rstrip()
ni = lambda: int(stdin.readline().rstrip())
nm = lambda: map(int, stdin.readline().split())
nl = lambda: list(map(int, stdin.readline().split()))

N,M=nm()
A=nl()
A.sort()
A.reverse()
print(A)
th=sum(A)/M/4
flag=True
for i in range(M):
    if(A[i]<th):
        flag=False

print('Yes' if flag==True else 'No' )


import sys
stdin = sys.stdin

ns = lambda: stdin.readline().rstrip()
ni = lambda: int(stdin.readline().rstrip())
nm = lambda: map(int, stdin.readline().split())
nl = lambda: list(map(int, stdin.readline().split()))

N,M=nm()
A=nl()
A.sort()
th=sum(A)/M/4
flag=True
for i in range(M):
    if(A[i]<th):
        flag=False

print('Yes' if flag==True else 'No' )

import sys
stdin = sys.stdin

ns = lambda: stdin.readline().rstrip()
ni = lambda: int(stdin.readline().rstrip())
nm = lambda: map(int, stdin.readline().split())
nl = lambda: list(map(int, stdin.readline().split()))

N,M=nm()
A=nl()
A.sort()
A.reverse()
th=sum(A)/M/4
flag=True
for i in range(M):
    if(A[i]<th):
        flag=False

print('Yes' if flag==True else '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=(int(x) for x in input().split())
a=list(map(int, input().split()))
b=0
c=0
for i in range(N-1):
    b+=a[i]
for i in range(N-1):
    if(a[i]>=b/(4*M)):c+=1
    print(c)
if(c>=M):print('Yes')
else:print('No')


N,M=(int(x) for x in input().split())
a=list(map(int, input().split()))
b=0
c=0
for i in range(N):
    b+=a[i]
    #print(i)
for i in range(N):
    if(a[i]>=b/(4*M)):c+=1
    #print(i)
if(c>=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(map(int, input().split()), reverse=True)
border = sum(a) / (4 * m)
canChoose = a[m-1] >= border
print(canChoose)
print("Yes" if canChoose else "No")

n, m = map(int, input().split())
a = sorted(map(int, input().split()), reverse=True)
border = sum(a) / (4 * m)
canChoose = a[m-1] >= border
print("Yes" if canChoose 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 = deque(sorted(list(map(int, input().split()))))
for a in A:
  if N / (4 * M) > a:
    A.pop()
  else:
    break
print("Yes" if len(A) >= M else "No")

N, M = map(int, input().split())
A = sorted(list(map(int, input().split())))
all = sum(A)
L = len(A)
for a in A:
  if all / (4 * M) > a:
    L -= 1
  else:
    break
print("Yes" if L >= 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):
def popularity(votes, N, M):
    
    total_votes = sum(votes)
    coef = 1.0 / (4.0 * M)
    limit = coef * total_votes
    
    cnt = 0
    for vote in votes:
        if vote > limit:
            cnt += 1
        
    if cnt == M:
    	return "Yes"
    
    return "No"
  
N, M = [int (x) for x in input().split()]
votes = [int (x) for x in input().split()]
print(popularity(votes, N, M))


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


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


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


def popularity(votes, N, M):

  total_votes = sum(votes)
  limit = total_votes / (4.0 * M)
  cnt = 0
  for vote in votes:
    if vote >= limit:
      cnt += 1
    if cnt >= M:
      return "Yes"

  return "No"
  
N, M = [int (x) for x in input().split()]
votes = [int (x) for x in input().split()]
print(popularity(votes, N, M))

Verdicts: Wrong Answer

Wrong Answer

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_A=input().split()
for i in range(len(list_A)):
    list_A[i]=int(list_A[i])
A =int(sum(list_A)/(4*M))
if min(list_A) < A:
    print("No")
elif M<=len([i for i in list_A if i>= A]):
    print("Yes")
else:
    print("No")

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

num = sum(A_list)/(4*M)

A2_list = [s for s in A_list if s >= num]

if len(A2_list)>=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()))
s=sum(a)
cnt=0
for i in range(n):
    if a[i] >= s*(1/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 i in range(n):
    if a[i] >= 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())
 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()))
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):
N, M= map(int,input().split())
A = list(map(int,input().split()))
B = 0
C =  1 / (4 * M)
count = 0
D = 0
print(C)

for i in range(len(A)):
    B += A[i]

D = B * C
for i in range(len(A)):
    if D < A[i]:
        count += 1
if M > count :
    print("No")
else:
    print("Yes")

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


for i in range(len(A)):
    B += A[i]
for i in range(len(A)):
    if A[i] >= B / (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())
rank = list(map(int, input().split()))

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

flg = True

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

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

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

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

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

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

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

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

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

v_sum = sum(a_i)
n = len([a for a in a_i if a >= (1/(4*M))])
if n >= M:
    print('yes')
else:
    print('no')

N, M = list(map(int, input().split()))
a_i = list(map(int, input().split()))
v_sum = sum(a_i)
n = len([a for a in a_i if a >= (v_sum/(4*M))])
if n >= M:
    print('Yes')
else:
    print('No')

Verdicts: Wrong Answer

Accepted