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):
def popularVote():
    n, m = list(map(int, input().split()))
    item_votes = list(map(int, input().split()))
    total = sum(item_votes)

    selected = []
    isSelected = False

    req = 1 / (4 * m)
    for item in item_votes:
        if item / total >= req:
            selected.append(item)

        if len(selected) == n:
            isSelected = True
            print("Yes")
            break

    if not isSelected:
        print("No")


popularVote()

def popularVote():
	n, m = list(map(int, input().split()))
    item_votes = list(map(int, input().split()))
    total = sum(item_votes)

    selected = []
    isSelected = False

    req = 1 / (4 * m)
    for item in item_votes:
        if item / total >= req:
            selected.append(item)

        if len(selected) == m:
            isSelected = True
            print("Yes")
            break

    if not isSelected:
        print("No")


popularVote()

def popularVote():
    m, n = list(map(int, input().split()))
    item_votes = list(map(int, input().split()))
    total = sum(item_votes)

    selected = []

    req = 1 / (4 * m)
    for item in item_votes:
        if item / total >= req:
            selected.append(item)

        if len(selected) == n:
            print("yes")
            return

    print("no")
    
popularVote()

    n, m = list(map(int, input().split()))
    item_votes = list(map(int, input().split()))
    total = sum(item_votes)

    selected = []
    isSelected = False

    req = 1 / (4 * m)
    for item in item_votes:
        if item / total >= req:
            selected.append(item)

        if len(selected) == m:
            isSelected = True
            print("Yes")
            break

    if not isSelected:
        print("No")


popularVote()

def popularVote():
    n, m = list(map(int, input().split()))
    item_votes = list(map(int, input().split()))
    total = sum(item_votes)

    selected = []
    isSelected = False

    req = 1 / (4 * m)
    for item in item_votes:
        if item / total >= req:
            selected.append(item)

        if len(selected) == m:
            isSelected = True
            print("Yes")
            break

    if not isSelected:
        print("No")


popularVote()

Verdicts: Wrong Answer

Runtime Error

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, raw_input().split())
A=list(map(int, raw_input().split()))
A.sort()
A.reverse()
K=sum(A)
for i in range(0,N):
    if  A[i]>K/(4*M):
        continue
    else:
        answer=i+1
        break
if answer>=M:
    print("Yes")
else:
    print("No")


A=list(map(int, input().split()))
A.sort()
A.reverse()
K=sum(A)
answer=0
breakflag=0
for i in range(0,N):
  if  A[i]*M*4>=K:
    if i==N-1:
      breakflag=1
    continue
  else:
    answer=i
    break
if breakflag==1:
  answer=N
if answer>=M:
    print("Yes")
else:
    print("No")

N,M= map(int, input().split())
A=list(map(int, input().split()))
A.sort()
A.reverse()
K=sum(A)
answer=0
breakflag=0
for i in range(0,N):
    if  A[i]*M*4>=K:
    	if i==N-1:
        	breakflag=1
      	continue
    else:
      	answer=i
      	break
if breakflag==1:
  answer=N
if answer>=M:
    print("Yes")
else:
    print("No")

N,M=map(int, input().split())
A=list(map(int, input().split()))
A.sort()
A.reverse()
K=sum(A)
answer=0
breakflag=0
for i in range(0,N):
  if  A[i]*M*4>=K:
    if i==N-1:
      breakflag=1
    continue
  else:
    answer=i
    break
if breakflag==1:
  answer=N
if answer>=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):
nm = [int(i) for i in input().split()]
a = [int(i) for i in input().split()]

n = nm[0]
m = nm[1]

a_s = sorted(a)[::-1]
if a_s[m-1] < sum(a)/(4*m):
  print('No')
else:
  print('Yes')vv

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

n = nm[0]
m = nm[1]

a_s = sorted(a)[::-1]
if a_s[m-1] < sum(a)/(4*m):
  print('No')
else:
  print('Yes')

Verdicts: Runtime Error

Accepted
Problem: We have held a popularity poll for N items on sale. Item i received A_i votes.  From these N items, we will select M as popular items. However, we cannot select an item with less than \dfrac{1}{4M} of the total number of votes.  If M popular items can be selected, print `Yes`; otherwise, print `No`.

Submission attempts (in order):
n,m=map(int, input().split())
a=list(map(int, input().split()))
g=0
count=0
for i in a:
    g+=i
b = float(1/(4*m))
for i in a:
    t = float(i/g)
    if t>b:
        count+=1
    if count==m:
        print("yes")
        exit()
if count < m:
    print("no")

n,m=map(int, input().split())
a=list(map(int, input().split()))
g=0
count=0
for i in a:
    g+=i
b = float(1/(4*m))
for i in a:
    t = float(i/g)
    if t>=b:
        count+=1
    if count==m:
        print("Yes")
        exit()
if count < m:
    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()))
can_choice_item_list =[]
for item in a:
  if item < 1 / (4 * m):
    pass
  else:
    can_choice_item_list.append(item)
if m < len(can_choice_item_list):
  print('YES')
else:
  print('NO')

n , m = map(int,input().split())
a = list(map(int,input().split()))
can_choice_item_list =[]
for item in a:
  if item < sum(a) / (4 * m):
    pass
  else:
    can_choice_item_list.append(item)
if m <= len(can_choice_item_list):
  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())
votes = list(map(int, input().split()))
total = sum(votes)
satisfied = [x for x in votes if x >= votes * (1/(4*m))]
if len(satisfied) > m:
  print("Yes")
else:
  print("No")

n, m = map(int, input().split())
votes = list(map(int, input().split()))
total = sum(votes)
satisfied = [x for x in votes if x >= total * (1/(4*m))]
if len(satisfied) >= 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):
if __name__ == '__main__':
	N, M = map(int, input().split())
	A = [int(a) for a in input().split()]

	th = sum(A)/4/M

	A.sort(reverse=True)

	print(A)

	if A[M-1] >= th:
		print('Yes')
	else:
		print('No')

if __name__ == '__main__':
	N, M = map(int, input().split())
	A = [int(a) for a in input().split()]

	th = sum(A)/4/M

	A.sort(reverse=True)



	if A[M-1] >= th:
		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 sys
input = sys.stdin.readline


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

intlist = list(map(int, input().split()))
newlist = sorted(intlist, reverse=True)[:M]

print ( newlist[M-1])
print ( sum(intlist) / (4 * M))
if newlist[M-1] > ( sum(intlist) / (4 * M)):
  print ("Yes")
else:
  print ("No")


import sys
input = sys.stdin.readline


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

intlist = list(map(int, input().split()))
newlist = sorted(intlist, reverse=True)[:M]

if newlist[M-1] >= ( sum(intlist) / (4 * M)):
  print ("Yes")
else:
  print ("No")


Verdicts: Wrong Answer

Accepted
Problem: We have held a popularity poll for N items on sale. Item i received A_i votes.  From these N items, we will select M as popular items. However, we cannot select an item with less than \dfrac{1}{4M} of the total number of votes.  If M popular items can be selected, print `Yes`; otherwise, print `No`.

Submission attempts (in order):
n,m = map(int,input().split())
A = list(map(int,input().split()))
A.sort(reverse=True)
sortedA = list()
sum_of_votes = 0
for i in A : 
    sum_of_votes += i
for i in range(m) : 
    sortedA.append(A[i])
print(sortedA)
isOK = True
for i in sortedA: 
    if i < sum_of_votes * (1/(4*m)) :
        isOK = False
print(isOK)
if isOK == True :
    print("Yes")
else:
    print("No")

n,m = map(int,input().split())
A = list(map(int,input().split()))
A.sort(reverse=True)
sortedA = list()
sum_of_votes = 0
for i in A : 
    sum_of_votes += i
for i in range(m) : 
    sortedA.append(A[i])
isOK = True
for i in sortedA: 
    if i < sum_of_votes * (1/(4*m)) :
        isOK = False
if isOK == True :
    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())
list=[int(i) for i in input().split()]

vote = 0


for v in list :
    if v in list :
        print("No")
        exit(0)
    vote = vote + v

judge = vote // 4 // M

pop = 0
for x in range(0, N) :
    if list[x] > judge :
        pop = pop + 1

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



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

vote = 0


for v in list :
    vote = vote + v

judge = vote / (4 * M)

pop = 0
for x in range(0, N) :
    if list[x] >= judge :
        pop = pop + 1

if pop >= 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=map(int,input().split())
l=list(map(int,input().split()))
t=sum(l)//(4*b)
ans = [True for i in range(b,len(l)-3) if sum(l[i:i+3])]
print('Yes' if ans and all(ans) else 'No')

a,b=map(int,input().split())
l=list(map(int,input().split()))
t=sum(l)/(4*b)
ans = [i for i in l if i>t]
print('Yes' if len(ans)>b and len(ans[:b])>b else 'No')

a,b=map(int,input().split())
l=list(map(int,input().split()))
print('Yes' if l[b-1]<sum(l)//(4*b) else 'No')

a,b=map(int,input().split())
l=list(map(int,input().split()))
t=sum(l)/(4*b)
ans = [i for i in l if i>=t]
print('Yes' if len(ans)>=b 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):
n, m = [for i in input().split()]
a = [int(i) for i in input().split()]

ok_count = 0
for i in a:
    if i > 1 / (4 * sum(a)): ok_count += 1

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

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

ok_count = 0
for i in a:
    if i > 1 / (4 * sum(a)): ok_count += 1

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

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

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

print("Yes" if m <= ok_count else "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 = list(map(int, input().split()))
count = 0
total = 0
for i in a:
  total += i
for j in a:
  if j / total => 1 / (4 * 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
total = 0
for i in a:
  total += i
for j in a:
  if j // total > 1 // (4 * 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
total = 0
for i in a:
  total += i
for j in a:
  if not (j / total < 1 / (4 * m)):
    count += 1
if count >= 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):
n,m=map(int,input().split())
a=list(map(int,input().split()))
 
toku = sum(a) // (4*m)
 
a.sort(reverse=True)
if a[m-1] >= toku:
  print("Yes")
  else:
  print("No")

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

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

a.sort(reverse=True)
if a[m-1] >= toku:
  print("Yes")
  else:
  print("No")

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

toku = sum(a) / (4 * m)
a=sorted(a,reverse=True)
    
if a[m-1] >= toku:
    print("Yes")
else:
    print("No")
    

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: We have held a popularity poll for N items on sale. Item i received A_i votes.  From these N items, we will select M as popular items. However, we cannot select an item with less than \dfrac{1}{4M} of the total number of votes.  If M popular items can be selected, print `Yes`; otherwise, print `No`.

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

if A[M-1] >= sum(A)/M/4 :
	print( 'Yes' )

else :
	print( 'No' )

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

if A[N-M] >= sum(A)/M/4 :
	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):
# coding: utf-8

kind, choose = map(int, input().split())
count = 0
total = 0

num = input().split(" ")
for i in num:
    total += int(i)

ok = total / (4 * kind)
for i in num:
    if int(i) >= total / ok:
        count += 1

if count > choose:
    print("Yes")
else:
    print("No")

# coding: utf-8

kind, choose = map(int, input().split())
count = 0
total = 0

num = input().split(" ")
for i in num:
    total += int(i)

ok = total / (4 * choose)

for i in num:
    if int(i) >= ok:
        count += 1

if count >= choose:
    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):
nm=input().split()
vote=[int(i) in input().split()]
n=int(nm[0])
m=int(nm[1])
selectable=0
for v in vote:
  if v < 4*m:
    continue
  else:
    selectable+=1
if selectable>=m:
  print("Yes")
else:
  print("No")
      

nm=input().split()
vote=[int(i) in input().split()]
n=int(nm[0])
m=int(nm[1])
selectable=0
for v in vote:
	if v < 4*m:
		continue
	else:
		selectable+=1
if selectable>=m:
	print("Yes")
else:
	print("No")


nm=input().split()
vote=[int(i) for i in input().split()]
n=int(nm[0])
m=int(nm[1])
selectable=0
all=sum(vote)
for v in vote:
	if v < all/(4*m):
		continue
	else:
		selectable+=1
if selectable>=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):
import numpy as np
import math
import collections
import fractions
import itertools

def mput(): return map(int, input().split())
def lput(): return list(map(int, input().split()))
def iput(): return int(input())

def solve():
    n, m = mput()
    a = lput()
    line = sum(A) / (4 * m)
    bit = 0
    for i in a:
        if i >= line:
            bit += 1
    if bit >= m:
        print("Yes")
    else:
        print("No")
    return 0

if __name__ == "__main__":
    solve()

import numpy as np
import math
import collections
import fractions
import itertools

def mput(): return map(int, input().split())
def lput(): return list(map(int, input().split()))
def iput(): return int(input())

def solve():
    n, m = mput()
    a = lput()
    line = sum(a) / (4 * m)
    bit = 0
    for i in a:
        if i >= line:
            bit += 1
    if bit >= m:
        print("Yes")
    else:
        print("No")
    return 0

if __name__ == "__main__":
    solve()

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

for _ in range(1):
	n,m = map(int,input().split())
	arr = list(map(int,input().split()))
	arr.sort()
	arr.reverse()
	if arr[m-1] >= sum(arr)/(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())
2 A = list(map(int,input().split()))
3 S = sum(A)
4 cnt = 0
5 for a in A:
6 if a >= S / (4*M):
7 cnt += 1
8 if cnt >= M:
9 print("Yes")
10 else:
11 print("No")

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

Verdicts: 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()))
pop = 1/(4*M)*sum(A)
lis = []

for i in A:
    if i>pop:
        lis.append(i)
if len(lis)>=M:
    print("Yes")
else:
    print("No")

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

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

N,M=map(int,input().split())
A=list(map(int,input().split()))
pop = 1/(4*M)*sum(A)
lis = []
for i in A:
    if i>=pop:
        lis.append(i)
if len(lis)>=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 = map(int, input().split())
A = sorted(map(int, input().split()), reverse=True)
t = sum(A)
if (1/(4*M))*t <= A[M-1]:
    print("YES")
else:
    print("NO")


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


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

limit=sum(a)/(4*m)
c=0
for aa in a:
  if a >=limit:
    c+=1
  else:
    pass
if c==0:
  print('No')
else:
  print('Yes')

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

limit=sum(a)/(4*m)
c=0
for aa in a:
  if aa >=limit:
    c+=1
  else:
    pass
if c>=m:
  print('No')
else:
  print('Yes')

n,m=map(int,input().split())
a=list(map(int,input().split()))
     
limit=sum(a)/(4*m)
c=0
for aa in a:
  if aa >=limit:
    c+=1
  else:
    pass
if c>=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):
N, M = [int(i) for i in input().split()]
A = [int(i) for i in input().split()]
total_votes = sum(A)
minimum_votes = int(total_votes / (4 * M)))
eligible_products = 0

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

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


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

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

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

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

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

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)*(1/(4*m)):
        ans = "No"
        break
 
print(ans)

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 = 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):
        count += 1

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

else:
    print("NO")

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

sumBy4 = sumA/(4*m)

count = 0

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

    else:
        count += 1

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

else:
    print("No")

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

count = 0
x = sum(a_list)/(4*m)
print(x)
for i in range(0,n):
  if a_list[i] >= x :
    count += 1
if count >= m :
  print('Yes')
else :
  print('No')

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

count = 0
x = sum(a_list)/(4*m)
for i in range(0,n):
  if a_list[i] >= x :
    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()]
a = [int(x) for x in input().split()]
total = sum(a)
cnt = n
for i in range(0, n):
  if a[i] < int(total / (4 * m)):
    cnt -= 1
  if cnt < m:
    print("No")
    return
print("Yes")

import sys,math
n,m=[int(x) for x in input().split()]
a = [int(x) for x in input().split()]
total = sum(a)
cnt = n
for i in range(0, n):
  if a[i] < math.ceil(total / (4 * m)):
    cnt -= 1
  if cnt < m:
    print("No")
    sys.exit()
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()))
sort=sorted(a,reverse=True)
b=sum(a)
count=0
for i in sort:
  count+=1
  if i<b/4:
    break
    
if count-1<=m:
  print('Yes')
else:
  print('No')
  

       

n,m=map(int,input().split())
a=list(map(int,input().split()))
sort=sorted(a,reverse=True)
b=sum(a)
count=0
for i in sort:
  count+=1
  if i<b/4*m:
    break
if count-1<=m:
  print('Yes')
else:
  print('No')
  

       

n,m=map(int,input().split())
a=list(map(int,input().split()))
sort=sorted(a,reverse=True)
print(sort)
b=sum(a)
print(b)
count=0
for i in sort:
  count+=1
  if i<b/4*m:
    break
print(count-1)
 
if count-1<=m:
  print('Yes')
else:
  print('No')
  

       

n,m=map(int,input().split())
a=list(map(int,input().split()))
sort=sorted(a,reverse=True)
b=sum(a)
count=0

for i in sort:
  if i<b/(4*m):
    break
  else:
    count+=1

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

       

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: We have held a popularity poll for N items on sale. Item i received A_i votes.  From these N items, we will select M as popular items. However, we cannot select an item with less than \dfrac{1}{4M} of the total number of votes.  If M popular items can be selected, print `Yes`; otherwise, print `No`.

Submission attempts (in order):
num1 = int(input().split())
num2 = list(map(int, input().split()))

num2.sort(reverse=True)
N=num1[0]
M=num1[1]
A=num2[M-1]

if A<N/M/4:
    print('No')
else:
    print('Yes')

num1 = int(input().split())
num2 = sorted(map(int, input().split())

N=num1[0]
M=num1[1]
A=num2[M-1]

if A<N/M/4:
    print('No')
else:
    print('Yes')

num1 = int(input().split())
num2 = list(map(int, input().split()))

num2.sort(reverse=True)
N=int(num1[0])
M=int(num1[1])
A=int(num2[M-1])

if A<N/M/4:
    print('No')
else:
    print('Yes')

num1 = int(input().split())
num2 = list(map(int, input().split())    
            
            
sorted(num2,reverse=True)            
N=num1[0]
M=num1[1]
A=num2[M-1]

if A<N/M/4:
    print('No')
else:
    print('Yes')

num1 = int(input().split())
num2 = list(map(int, input().split()))

sorted(num2, reverse=True)
N=num1[0]
M=num1[1]
A=num2[M-1]

if A<N/M/4:
    print('No')
else:
    print('Yes')

num1=input().split()
num2=input().split()

num2.sort(reverse=True)
N=int(num1[0])
M==int(num1[1])
A=int(num2[int(num1[1])-1])

if A<N/M/4:
    print('Yes')
    else:
    print('No')

num1=input().split()
num2=input().split()

num2.sort(reverse=True)
N=int(num1[0])
M=int(num1[1])
A=int(num2[M-1])

if A<N/M/4:
    print('Yes')
else:
    print('No')


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

if a>=b/4/m:
  print('Yes')
else:
  print('No')
   


Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

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):
M, N = map(int, input().split())
A = list(map(int, input().split()))
A.sort(reverse=True)　
S = sum(A)
if A[M-1] >=  S / 4M
print('Yes')
else:
    ('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):
def main():
    mylist = []
    for i in range(2):
        mylist.append(input())
    N, M = list(map(int, mylist[0].split()))
    votes = list(map(int, mylist[1].split()))

    v_sum = sum(votes)

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

    flag = True
    for i in range(M):
        if votes[i] < v_sum / (4 * M):
            flag = False

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



if __name__ == "__main__":
    main()

def main():
    mylist = []
    for i in range(2):
        mylist.append(input())
    N, M = list(map(int, mylist[0].split()))
    votes = list(map(int, mylist[1].split()))

    v_sum = sum(votes)

    votes.sort(reverse=True)

    flag = True
    for i in range(M):
        if votes[i] < v_sum / (4 * M):
            flag = False

    if flag:
        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())
votes = [int(i) for i in input().split()]
count = [1 for vote in votes if vote >= sum(votes) * 1 / (4 * M)]
if count >= M:
  print('Yes')
else:
  print('No')

N, M = map(int, input().split())
votes = [int(i) for i in input().split()]
count = [1 for vote in votes if vote >= sum(votes) * 1 / (4 * M)]
if sum(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())
l=list(map(int,input().split()))
limit=sum(l)/(M*3)
num=0
for i in l:
  if i >= limit:
    num+=0
if num >=M:
  print("Yes")
else:
  print("No")

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

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

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

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

cnt = 0
for x in A:
  if 4 * m * x >= all:
    cnt++;
  
if cnt >= m:
  print("Yes")
else :
  print("No")


n, m = map(int, input().split())
A = list(map(int, input().split()))
all = sum(A)

cnt = 0
for x in A:
  if 4 * m * A[i] >= all:
    cnt++;
  
if cnt >= m:
  print("Yes")
else :
  print("No")


n, m = map(int, input().split())
A = list(map(int, input().split()))
all = sum(A)

cnt = 0
for x in A:
  if 4 * m * x >= all:
    cnt += 1
  
if cnt >= m:
  print("Yes")
else :
  print("No")


Verdicts: Runtime Error

Runtime Error

Accepted
Problem: We have held a popularity poll for N items on sale. Item i received A_i votes.  From these N items, we will select M as popular items. However, we cannot select an item with less than \dfrac{1}{4M} of the total number of votes.  If M popular items can be selected, print `Yes`; otherwise, print `No`.

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

n, m = map(int, input().split(" "))
a = list(map(int, input().split(" ")))
a.sort(reverse=True)
#print(a)
if a[m - 1] < sum(a) /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):
m, n = list(map(int, input().split(" ")))
a_list = list(map(int, input().split(" "))).sort(reverse=True)
if m == 0:
    print('Yes')
else:
    if a_list[m-1] >= sum(a_list) / (4 * m):
        print('Yes')
    else:
        print('No')

n, m = list(map(int, input().split(" ")))
a_list = sorted(list(map(int, input().split(" "))), reverse=True)
if m == 0:
    print('Yes')
else:
    if a_list[m-1] >= sum(a_list) / (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):
[int(i) for i in input().join(' ')]
N = input()
M = input()

items = [int(i) for i in input().join(' ')]
items.sort()
total = sum(items)

flag = 1
for i in range(M):
  if 1 // (4 * M) >= items[i]:
    pass
  else:
    flag = 0
if not flag:
  print('Yes')
else:
  print('No')

a = [int(i) for i in input().join(' ')]
N = a[0]
M = a[1]

items = [int(i) for i in input().join(' ')]
items.sort()
total = sum(items)

flag = 1
for i in range(M):
  if 1 // (4 * M) >= items[i]:
    pass
  else:
    flag = 0
if not flag:
  print('Yes')
else:
  print('No')

N, M= int(input().join(' '))

items = [int(i) for i in input().join(' ')]
items.sort()
total = sum(items)

flag = 1
for i in range(M):
  if 1 // (4 * M) >= items[i]:
    pass
  else:
    flag = 0
if not flag:
  print('Yes')
else:
  print('No')

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

items = [int(i) for i in input().split()]
items.sort(reverse=True)
total = sum(items)

flag = 1
for i in range(M):
  if total // (4 * M) >= items[i]:
    pass
  else:
    flag = 0
if flag:
  print('Yes')
else:
  print('No')

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

items = [int(i) for i in input().join(' ')]
items.sort()
total = sum(items)

flag = 1
for i in range(M):
  if 1 // (4 * M) >= items[i]:
    pass
  else:
    flag = 0
if not flag:
  print('Yes')
else:
  print('No')

N, M= int(input().join(' '))

items = [i for i in input().join(' ')]
items.sort()
total = sum(items)

flag = 1
for i in range(M):
  if 1 // (4 * M) >= items[i]:
    pass
  else:
    flag = 0
if not flag:
  print('Yes')
else:
  print('No')

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

items = [int(i) for i in input().split()]
items.sort(reverse=True)
total = sum(items)

flag = 1
for i in range(M):
  if total / (4 * M) >= items[i]:
    pass
  else:
    flag = 0
if flag:
  print('Yes')
else:
  print('No')

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

items = [int(i) for i in input().split()]
items.sort()
total = sum(items)

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

N = int(input())
M = int(input())

items = [i for i in input().join(' ')]
items.sort()
total = sum(items)

flag = 1
for i in range(M):
  if 1 // (4 * M) >= items[i]:
    pass
  else:
    flag = 0
if not flag:
  print('Yes')
else:
  print('No')

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

items = [int(i) for i in input().split()]
items.sort(reverse=True)
total = sum(items)

flag = 1
for i in range(M):
  if total / (4 * M) <= items[i]:
    pass
  else:
    flag = 0
if flag:
  print('Yes')
else:
  print('No')

Verdicts: Runtime Error

Runtime Error

Runtime Error

Wrong Answer

Runtime Error

Runtime Error

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=map(int,input().split())
a=list(map(int,input().split()))
a.sort(reverse=True)
count=0
for i in range(m-1):
    if a[i]>=1/4*m:
        count+=1
if count==m:
    print('Yes')
else:
    print('No')

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

#!/usr/bin python3
# -*- coding: utf-8 -*-

import sys
input = sys.stdin.readline

def main():
    N,M = map(int, input().split())
    A = list(map(int, input().split()))
    X = sum(A)/(4*M)
    c = sum([1 for i in A if i >= X])
    if c>=M:
        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())

ls = list(map(int, input().split()))
ls = sorted(ls,reverse=True)
print(ls)
print("Yes" if ls[m-1]*4*m >=sum(ls) else "No")



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

ls = list(map(int, input().split()))
ls = sorted(ls,reverse=True)
print("Yes" if ls[m-1]*4*m >=sum(ls) 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):
a,b=map(int,input().split())
n=list(map(int,input().split()))
c=sum(n)/(4*b)
d=[i for i in n if i>=c]
print(a,b,c,d,sum(n))
if b>len(d):
    print('No')
else:
    print('Yes')

a,b=map(int,input().split())
n=list(map(int,input().split()))
c=sum(n)/(4*b)
d=[i for i in n if i>=c]
if b>len(d):
    print('No')
else:
    print('Yes')

Verdicts: Wrong Answer

Accepted
Problem: We have held a popularity poll for N items on sale. Item i received A_i votes.  From these N items, we will select M as popular items. However, we cannot select an item with less than \dfrac{1}{4M} of the total number of votes.  If M popular items can be selected, print `Yes`; otherwise, print `No`.

Submission attempts (in order):
N, M = list(map(int, input().split()))
A = sorted(map(int, input().split()), reverse=True)
print(N, M , A, sum(A))

border = sum(A) // (4*M)
flag = 'Yes'

for i in range(M):
    if border > A[i]:
        flag = 'No'

print(flag)


import math

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

border = sum(A) / (4*M)
flag = 'Yes'

for i in range(M):
    if border > A[i]:
        flag = 'No'

print(flag)

Verdicts: Wrong Answer

Accepted
Problem: We have held a popularity poll for N items on sale. Item i received A_i votes.  From these N items, we will select M as popular items. However, we cannot select an item with less than \dfrac{1}{4M} of the total number of votes.  If M popular items can be selected, print `Yes`; otherwise, print `No`.

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

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

print(A)

Asum = sum(A)

for i in range(M):
    Amax =  max(A)
    max_index = A.index(Amax)
    A.pop(max_index)
    

if Amax < Asum/4/M:
    print('No')
else:
    print('Yes')

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

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

Asum = sum(A)

for i in range(M):
    Amax =  max(A)
    max_index = A.index(Amax)
    A.pop(max_index)
    

if Amax < Asum/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()))

def vote(a,m):
  a.sort(reverse=True)
  for i in range(m):
    if a[i-1] >= sum(a)/(4*m):
      return True
    else:
      return False
    
ans = "Yes" if vote(A,M) else "No"
print(ans)

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

def vote(a,m):
  a.sort(reverse=True)
  if a[m-1] >= sum(a)/(4*m):
      return True
    else:
      return False
    
ans = "Yes" if vote(A,M) else "No"
print(ans)

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

def vote(a,m):
  a.sort(reverse=True)
  if a[m-1] >= sum(a)/(4*m):
      return True
  else:
      return False
    
ans = "Yes" if vote(A,M) else "No"
print(ans)

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):
_,m=map(int,input().split())
a=list(map(int,input().split()))
cnt=0
temp=sum(a)
for v in a:
    if v>=a/(4*m): cnt+=1
if cnt>=m: print("Yes")
else: print("No")

_,m=map(int,input().split())
a=list(map(int,input().split()))
cnt=0
temp=sum(a)
for v in a:
    if v>=temp/(4*m): cnt+=1
if cnt>=m: print("Yes")
else: print("No")

Verdicts: Runtime Error

Accepted