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 = input().split()
a_sum = 0
for i in range(len(a_list)):
    a_list[i] = int(a_list[i])
    a_sum += a_list[i]
a_list.reverse()

ok_num = 0
kijyun = int(a_sum/(4*m))
if a_sum % (4*m) == 0:
    kijyun += 1
for i in a_list:
    if i > kijyun:
        ok_num += 1
    else:
        break
    if ok_num == m:
        print('Yes')
        quit()
print('No')



n, m = map(int, input().split())
a_list = input().split()
a_sum = 0
for i in range(len(a_list)):
    a_list[i] = int(a_list[i])
    a_sum += a_list[i]
a_list.reverse()

ok_num = 0
kijyun = int(a_sum/(4*m))
for i in a_list:
    if i > kijyun:
        ok_num += 1
    else:
        break
    if ok_num >= m:
        print('Yes')
        quit()
print('No')

n, m = map(int, input().split())
a_list = input().split()
a_sum = 0
for i in range(len(a_list)):
    a_list[i] = int(a_list[i])
    a_sum += a_list[i]
a_list.reverse()

ok_num = 0
kijyun = int(a_sum/(4*m))
if a_sum % (4*m) == 0:
    kijyun -= 1
for i in a_list:
    if i > kijyun:
        ok_num += 1
    else:
        break
    if ok_num == m:
        print('Yes')
        quit()
print('No')



n, m = map(int, input().split())
a_list = input().split()
a_sum = 0
for i in range(len(a_list)):
    a_list[i] = int(a_list[i])
    a_sum += a_list[i]
a_list.reverse()
 
ok_num = 0
kijyun = int(a_sum/(4*m))
if a_sum % (4*m) == 0:
    kijyun -= 1
for i in a_list:
    if i > kijyun:
        ok_num += 1
    if ok_num == m:
        print('Yes')
        quit()
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):
x = input().split()
y = input().split()


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

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

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

print("No")


x = input().split()
y = input().split()



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

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

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

if not f:
    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):
input_d21 = list(map(int, input().split()))
input_d22 = list(map(int, input().split()))

N = input_d21[0]
M = input_d21[1]

A = input_d22

sohyo = sum(A)
zyoken = float(sohyo) / float(4 * M)


A = sorted(A, reverse=True)
print(A)
print(sohyo)
print(zyoken)

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

input_d21 = list(map(int, input().split()))
input_d22 = list(map(int, input().split()))

N = input_d21[0]
M = input_d21[1]

A = input_d22

sohyo = sum(A)
zyoken = float(sohyo) / float(4 * M)


A = sorted(A, reverse=True)

if A[M-1] >= zyoken:
    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()))
select=0
for i in range(len(A)-1):
    if A[i]>sum(A)*(1/(4*M)):
        select+=1
    
def ans(M,select):   
    if M>=select:
         return 'Yes'
    
    else:
         return 'No'

print(ans(M,select))

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

print(ans(M,select))

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

print(ans(M,select))

Verdicts: Wrong Answer

Wrong Answer

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

Submission attempts (in order):
num, choice = map(int, input().split())
tmp = input().split()
product_list = [int(s) for s in tmp]
product_list.sort()
sum = 0
for i in range(num):
  sum += product_list[i]
if product_list[choice-1] >= sum/(choice*4):
  print("Yes")
else:
  print("No")

num, choice = map(int, input().split())
tmp = input().split()
product_list = [int(s) for s in tmp]
product_list.sort(reverse=True)
sum = 0
for i in range(num):
    sum += product_list[i]
if product_list[choice-1] >= sum/(choice*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):
n,m = map(int,input().split())
a = sorted(list(map(int,input().split())),reverse=True)
print("YNeos"[sum([sum(a)/(4*m)>=a[i] for i in range(m)])<m::2])

n,m = map(int,input().split())
a = sorted(list(map(int,input().split())),reverse=True)
print("YNeos"[sum(a[i]<sum(a)/(4*m)for i in range(m))<m::2])

n,m = map(int,input().split())
a = sorted(list(map(int,input().split())),reverse=True)
print("YNeos"[sum(a[i]>=sum(a)/(4*m)for i in range(m))<m::2])

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()))
s = sum(A)
tou = -(-1//(4*M))*s
count = 0
for i in A:
    if i > tou:
        count += 1
if count >= M:
    print('Yes')
else:
    print('No')

N , M = (map(int , input().split()))
A = list(map(int , input().split()))
s = sum(A)
tou = (1/(4*M))*s
count = 0
for i in A:
    if i < tou:
        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(map(int, input().split()))

A = sum(a)
l = a.sort(reverse=True)

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

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

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

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

Verdicts: Runtime Error

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

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

P=0 
for a in A:
    if a>=s/(4*M):
        P+=1
    else:
        break
        
if P==M:
    print("Yes")
else:
    print("No")

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

s=sum(A)

P=0 
for a in A:
    if 4*M*a>=s:
        P+=1
        
if P==M:
    print("Yes")
else:
    print("No")

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

P=0 
for a in A:
    if a>=s/(4*M):
        P+=1
    else:
        break
        
if P==M:
    print("Yes")
else:
    print("No")

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

s=sum(A)

P=0 
for n in range(N):
    if 4*M*A[n]>=s:
        P+=1
        
if P==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)

P=0 
for a in A:
    if a>=s/(4*M):
        P+=1
    else:
        break
        
if P==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

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()))
cnt=0
a.sort(reverse=True)
ALL=0
print(a)

for i in a:
    ALL+=i

print(ALL)


for i in range(m):
    if a[i]>=ALL/(4*m):
        cnt+=1
        if cnt==m:
            print("Yes")
    else:
        print("No")
        break


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

for i in a:
    ALL+=i


for i in range(m):
    if a[i]>=ALL/(4*m):
        cnt+=1
        if cnt==m:
            print("Yes")
    else:
        print("No")
        break


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

for i in range(n):
  if a_list[i] >= (sum(a_list) / (4*m)):
    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
suma = sum(a_list)

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

Verdicts: Wrong Answer

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

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

souwa = sum(A)

hyou = 1/(4*souwa)
ninki = 0

for number in A:
    if number > hyou:
      ninki = ninki + 1

if m == souwa:
     print('Yes')
else:
    print('No')

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

souwa = sum(A)
print(souwa)

hyou = 1(4*souwa)i
ninki = 0

for i in range(A):
    if A(i)>hyou:
      ninki = ninki + 1

if m == souwa:
     print('Yes')
else:
    print('No')

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

souwa = sum(A)
hyou = souwa/(4*m)
ninki = 0

for number in A:
  if number >= hyou:
    ninki = ninki + 1

if m <= ninki:
    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 = sorted([int(x) for x in input().split()], reverse=True)
Asum = sum(A)
lmt = (Asum/(m*4))

print(A[m-1] )
if A[m-1] >= lmt:
    print("Yes")
else:
    print("No")

n, m = map(int, input().split())
A = sorted([int(x) for x in input().split()], reverse=True)
Asum = sum(A)
lmt = (Asum/(m*4))


if A[m-1] >= lmt:
    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, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
# from fractions import gcd
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from functools import reduce
from bisect import bisect_left, insort_left
from heapq import heapify, heappush, heappop

INPUT = lambda: sys.stdin.readline().rstrip()
INT = lambda: int(INPUT())
MAP = lambda: map(int, INPUT().split())
S_MAP = lambda: map(str, INPUT().split())
LIST = lambda: list(map(int, INPUT().split()))
S_LIST = lambda: list(map(str, INPUT().split()))
ZIP = lambda: zip(*(MAP() for _ in range(n)))

sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7


def main():
    N, M = MAP()
    A = LIST()

    W = sum(A)
    A = sorted(A, reverse=True)
    print(A)

    for i, a in enumerate(A):
        if a < W / (4*M):
            print("No")
            sys.exit()
        print(i)
        if i == M:
            print("Yes")
            sys.exit()


if __name__ == '__main__':
    main()


import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
# from fractions import gcd
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from functools import reduce
from bisect import bisect_left, insort_left
from heapq import heapify, heappush, heappop

INPUT = lambda: sys.stdin.readline().rstrip()
INT = lambda: int(INPUT())
MAP = lambda: map(int, INPUT().split())
S_MAP = lambda: map(str, INPUT().split())
LIST = lambda: list(map(int, INPUT().split()))
S_LIST = lambda: list(map(str, INPUT().split()))
ZIP = lambda: zip(*(MAP() for _ in range(n)))

sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7


def main():
    N, M = MAP()
    A = LIST()

    W = sum(A)
    A = sorted(A, reverse=True)

    for i in range(M):
        if A[i] < W / (4*M):
            print("No")
            sys.exit()

    print("Yes")


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


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

a = list(map(int, input().split()))
for i in range(n):
  c += a[i]
v = c/(4*m)
a.sort(reverse = True)
if a[m-1] < v:
  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()))
vote = sum(A)
cnt = 0

print(N, M)
print(A)

for i in range(N):
  if A[i] >= vote / 4 / M:
    cnt += 1
  else:
    continue

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

N, M = map(int, input().split())
A = list(map(int, input().split()))
vote = sum(A)
cnt = 0

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

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

for i in A:
    if i > sum(A)/(4*M):
        count += 1
    else:
        continue

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

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

Verdicts: Runtime Error

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

Submission attempts (in order):
n, m = map(int, input().split())
a = map(int, input().split())
s=0
can=0
for b in a:
    s+=b 
for b in a:
    if b >= s / (4*m):
        can+=1
if can > m:
    print("Yes")
else:
    print("No")


n, m = map(int, input().split())
a = map(int, input().split())
s=0
can=0
for b in a:
    s+=b 
for b in a:
    if b >= s / (4*m):
        can+=1
if can >= m:
    print("Yes")
else:
    print("No")


n, m = map(int, input().split())
a = list(map(int, input().split()))
s=0
can=0
for b in a:
    s+=b 

for c in a:
    if c >= s / (4*m):
        can+=1

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

Verdicts: Wrong Answer

Wrong Answer

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

Submission attempts (in order):
N, M = map(int, input().split())
A = list(map(int, input().split()))
t = 0
S = 0
for Ai in A:
    S=S+Ai

for Ai in A:
    if Ai >= S/(4*M):
        t = t+1

if t >= M:
    print('yes')
else:
    print('no')









N, M = map(int, input().split())
A = list(map(int, input().split()))
t = 0
for Ai in A:
    if Ai >= 1/(4*M):
        t = t+1

if t >= M:
    print('yes')
else:
    print('no')



N, M = map(int, input().split())
A = list(map(int, input().split()))
t = 0
S = 0
for Ai in A:
    S=S+Ai

for Ai in A:
    if Ai >= S/(4*M):
        t = t+1

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









Verdicts: Wrong Answer

Wrong Answer

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

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

lim = 1/(4*m)
A = A/sum(A)
ans = 0
for a in A:
  if a>=lim:
    ans += 1
    
if ans >= m:
  print("Yes")
else:
  print("No")


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

lim = 1/(4*m)

ans = 0
for a in A:
  a /= sum(A)
  if a>=lim:
    ans += 1
    
if ans >= 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():
    from builtins import int, map, list, print
    import sys
    sys.setrecursionlimit(10 ** 6)

    input = sys.stdin.readline
    input_list = (lambda: input().rstrip().split())
    input_number = (lambda: int(input()))
    input_number_list = (lambda: list(map(int, input_list())))

    N, M = input_number_list()
    A = input_number_list()
    total = sum(A)
    cnt = 0
    for a in A:
        if a >= total / (4 * M):
            cnt += 1
    print('YNeos'[cnt < M::2])

    if __name__ == '__main__':
        main()


def main():
    from builtins import int, map, list, print
    import sys
    sys.setrecursionlimit(10 ** 6)

    input = sys.stdin.readline
    input_list = (lambda: input().rstrip().split())
    input_number = (lambda: int(input()))
    input_number_list = (lambda: list(map(int, input_list())))

    N, M = input_number_list()
    A = input_number_list()
    total = sum(A)
    cnt = 0
    for a in A:
        if a >= total / (4 * M):
            cnt += 1
    print('YNeos'[cnt < M::2])

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

if min(a)>n/4*m:
  print('Yes')
else:
  print('No')

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

total_vote=sum(A)/(4*M)
sele=0

for i in A:
  if i >= total_vote:
    sele+=1
  else:
    pass

if M<=sele:
  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 bisect
n,m = [int(i) for i in input().split()]
al = sorted([int(i) for i in input().split()])
total = sum(al)

idx = bisect.bisect_left(al,total/(4*m))
idx = bisect.bisect_left(al,789)

if n - idx > m:
    print('Yes')
elif al[idx+1] == total/(4*m):
    print('No')
else:
    print('No')


import bisect
n,m = [int(i) for i in input().split()]
al = sorted([int(i) for i in input().split()],reverse = True)
total = sum(al)

l = al[:m]

if l[-1] >= total/(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(n,m = map(int,input().split())
a = list(map(int,input().split()))

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

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

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

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

if c >= 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()))

t = 0
check=False
for i in range(len(a)):
  t += a[i]

for i in reversed(range(len(a))):
  for j in range(i):
    if(a[j] < a[j+1]):
      a[j], a[j+1] = a[j+1],a[j]
print(a)

print(int(t/(4*m)))
for i in range(m):
  if(a[i] < int(t/(4*m))):
    check=False
    break    
  else:
    check = True 
    
if(check):
  print('Yes')
else:
  print('No')


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

t = 0
check=False
for i in range(len(a)):
  t += a[i]

for i in reversed(range(len(a))):
  for j in range(i):
    if(a[j] < a[j+1]):
      a[j], a[j+1] = a[j+1],a[j]
    elif(a[j] == a[j+1]):
      check=False
      break

if(check == True):
  for i in range(m):
    if(a[i] > t/(4*m)):
      check = True
    else:
      check=False
    
    
if(check):
  print('Yes')
else:
  print('No')

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


t = 0
check=False
for x in range(len(a)):
  t += a[x]

for i in reversed(range(len(a))):
  for j in range(i):
    if(a[j] < a[j+1]):
      a[j], a[j+1] = a[j+1],a[j]

for y in range(m):
  if(a[y] >= t/(4*m)):
    check = True
  else:
    check=False
    break

if(check):
  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=[int(e) for e in input().split()]
a=[int(e) for e in input().split()]
count = 0
sum = 0
for i in range(n):
    sum += a[i]
print(sum)
for i in range(n):
    if a[i] >= sum / (4*m):
        count +=1
if count >= m:
    print("Yes")
else:
    print("No")

n,m=[int(e) for e in input().split()]
a=[int(e) for e in input().split()]
count = 0
sum = 0
for i in range(n):
    sum += a[i]
for i in range(n):
    if a[i] >= sum / (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):
nm = input('')
n = int(nm.split(' ')[0])
m = int(nm.split(' ')[1])
alist = input('').split(' ')

t = 0
for i in range(n):
  t += int(alist[i])
lm = t/(m*4)
print(lm)
s = 0
for i in range(n):
  a = int(alist[i])
  if a > lm:
    s+=1

if s > m:
  print('Yes')
else:
  print('No')



nm = input('')
n = int(nm.split(' ')[0])
m = int(nm.split(' ')[1])
alist = input('').split(' ')

t = 0
for i in range(n):
  t += int(alist[i])

  s = 0
for i in range(n):
  a = int(alist[i])
  if a*4*m >= t:
    s+=1

if s >= 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()))

ans = "Yes"
sum_M = sum(A)
an = 0
for i in range(M):
    if A[i] < sum_M*1/4/M:
        an += 1
        
if an<M:
    ans = "No"

print(ans)
    

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

ans = "Yes"
sum_M = sum(A)
an = 0
for i in range(len(A)):
    if A[i] >= sum_M/(4*M):
        an += 1
        
if an<M:
    ans = "No"

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):
import math
n,m = list(map(int,input().split()))
a = list(map(int,input().split()))
t = sum(a)
c = 0
f = 0
for i in range(n):
	if a[i] >= t//(4*m):
		c += 1

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

import math
n,m = list(map(int,input().split()))
a = list(map(int,input().split()))
t = sum(a)
c = 0
f = 0
for i in range(n):
	if a[i] >= math.ceil(t/(4*m)):
		c += 1
	if c==m:
		f = 1
		print("YES")
		break
if f==0:
	print("NO")

import math
n,m = list(map(int,input().split()))
a = list(map(int,input().split()))
t = sum(a)
c = 0
f = 0
for i in range(n):
	if a[i] >= math.ceil(t/(4*m)):
		c += 1

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

import math
n,m = list(map(int,input().split()))
a = list(map(int,input().split()))
t = sum(a)
c = 0
f = 0
for i in range(n):
	if a[i] >= math.ceil(t/(4*m)):
		c += 1

if c>=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):
def getInput():
    return [int(i) for i in input().rstrip().split(' ')]

N, M = getInput()
A = getInput()
_4M = int(sum(A)/(4*M) + .9)
print(_4M)
A.sort(reverse=True)
cnt = 0
for i in A:
    if i >= _4M:
        cnt += 1

print('Yes') if cnt >= M else print('No')

def getInput():
    return [int(i) for i in input().rstrip().split(' ')]
N, M = getInput()
A = getInput()
_4M = math.ceil(sum(A) / (4*M))
A.sort(reverse=True)
cnt = 0
for i in A:
    if i >= _4M:
        cnt += 1
print('Yes') if cnt >= M else print('No')

import math
def getInput():
    return [int(i) for i in input().rstrip().split(' ')]
N, M = getInput()
A = getInput()
_4M = math.ceil(sum(A) / (4*M))
A.sort(reverse=True)
cnt = 0
for i in A:
    if i >= _4M:
        cnt += 1
print('Yes') if cnt >= M 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()))
A_sum = sum(A)
tmp = A_sum/4/M
A.sort()
if A[M-1] <tmp:
    print("No")
else:
    print("Yes")

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

N,M = map(int, input().split())
A = list(map(int, input().split()))
A_sum = sum(A)
tmp = A_sum/4/M
A.sort()
if A[N-M] <tmp:
    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,M=map(int,input().split())
A=list(map(int,input().split()))
x=sum(A)
if sum([i if a>=x/4/M else 0 for a in A])>=M:
  print('Yes')
else:
  print('No')

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

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



sfhgfh

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

sum= 0.0
for i in range(n):
    sum = cl2[i]+ sum
print(sum)
cl2 = sorted(cl2,reverse=True)
if(cl2[m-1] > sum//(4*m)):
    print("Yes")
else:
    print("No")

cl1 = input().split()
cl2 = input().split()
n = int(cl1[0])
m = int(cl1[1])
cl1 = [int(s) for s in cl1]
cl2 = [int(s) for s in cl2]
sum= 0.0
for i in range(n):
    sum = cl2[i]+ sum
cl2 = sorted(cl2,reverse=True)
if(cl2[m-1] < sum/(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()))
A.sort(reverse=True)

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

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

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

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

c=0
for i in range(M):
    if A[i]<sum(A)/(4*M):c+=1
    else:c+=0
if c==0: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()))
ans = 0
total = 0
 
for i in range(len(A)):
    total += A[i]
print(total)
 
A = sorted(A, reverse=True)
print(A)
for i in range(M):
    if(A[i] >= total/(4*M)):
        ans += 1
        print("p")
    else:
        ans += 0
        print("s")
if(M == ans):
    print("Yes")
else:
    print("No")

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

Verdicts: Wrong Answer

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

Submission attempts (in order):
N,M = map(int,input().split(" "))
MER = map(int,input().split(" "))
mer_sum = sum(MER)
 
threshold = mer_sum / (4 * M)
mer_over = [1 if i >= threshold else 0 for i in MER]
mer_threshold = sum(mer_over)
 
if N <= mer_threshold:
  print("Yes")
else:
  print("No")

N,M = map(int,input().split(" "))
MER = map(int,input().split(" "))
mer_sum = sum(MER)

threshold = mer_sum / (4 * M)
mer_over = [1 if i < threshold else 0 for i in MER]
mer_threshold = sum(mer_over)

if N <= mer_threshold:
  print("Yes")
else:
  print("No")

N,M = map(int,input().split(" "))
MER = list(map(int,input().split(" ")))
mer_sum = sum(MER)

threshold = mer_sum / (4 * M)
mer_over = [1 if i >= threshold else 0 for i in MER]
mer_threshold = sum(mer_over)

if M <= mer_threshold:
  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()))

MAX_VOTE_NUM = 1000

x = [-1] * MAX_VOTE_NUM
total_vote_num = 0
for i in range(n):
  x[a[i] - 1] = i
  total_vote_num += a[i]

  popular_num = 0
  for i in range(MAX_VOTE_NUM):
    index = MAX_VOTE_NUM - i - 1
    if x[index] != -1 and ((index + 1) * 4 * m) >= total_vote_num:
      popular_num += 1

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


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

MAX_VOTE_NUM = 1000

x = [-1] * MAX_VOTE_NUM
total_vote_num = 0
for i in range(n):
  x[a[i] - 1] = i
  total_vote_num += a[i]

popular_num = 0
for i in range(MAX_VOTE_NUM):
  index = MAX_VOTE_NUM - 
  if x[index - 1] != -1 and (index * 4 * m) >= total_vote_num:
    popular_num += 1

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

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

MAX_VOTE_NUM = 1000

x = [-1] * MAX_VOTE_NUM
total_vote_num = 0
for i in range(n):
  x[a[i] - 1] = i
  total_vote_num += a[i]

popular_num = 0
for i in range(MAX_VOTE_NUM):
  index = MAX_VOTE_NUM - i
  if x[index - 1] != -1 and (index * 4 * m) >= total_vote_num:
    popular_num += 1

if popular_num >= 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):
nums = list(map(int, input().split()))
n = nums[0]
m = nums[1]

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

sum = 0
for v in a:
  sum += v

result = []
for s in a:
    if s >= sum * (1 / (4 * m)):
        result.append(s)
print(result)
if len(result) >= m:
    print("Yes")
else:
    print("No")

nums = list(map(int, input().split()))
n = nums[0]
m = nums[1]

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

sum = 0
for v in a:
  sum += v

result = []
for s in a:
    if s >= sum * (1 / (4 * m)):
        result.append(s)
print(result)
if len(result) >= m:
    print("Yes")
else:
    print("No")


nums = list(map(int, input().split()))
n = nums[0]
m = nums[1]

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

sum = 0
for v in a:
  sum += v

result = []
for s in a:
    if s >= sum * (1 / (4 * m)):
        result.append(s)
if len(result) >= m:
    print("Yes")
else:
    print("No")

Verdicts: Wrong Answer

Wrong Answer

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

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

N,M=map(int,input().split())
A=list(map(int,input().split()))
count=0
a=sum(A)
for i in range(N):
    if A[i]>=a/(4*M):
        count=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):
vote = input("Enter the vote: ")
if 

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

Verdicts: Runtime Error

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

Submission attempts (in order):

first_input = list(map(lambda x:int(x), input().split(" ")))
second_input = list(map(lambda x:int(x), input().split(" ")))

second_input.sort(reverse=True)
criteria = sum(second_input)/float(4*first_input[1])

count = 0
for i in range(len(second_input)):
    if second_input[i]>=criteria:
        count = count+1
    else:
        break

if count >= first_input[1]:
    print("Yes")
else:
    print("No")
break



first_input = list(map(lambda x:int(x), input().split(" ")))
second_input = list(map(lambda x:int(x), input().split(" ")))

second_input.sort(reverse=True)
criteria = sum(second_input)/float(4*first_input[1])

count = 0
for i in range(len(second_input)):
    if second_input[i]>=criteria:
        count = count+1
    else:
        break

if count >= first_input[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):
import sys
input = sys.stdin.readline


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

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

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


import sys
input = sys.stdin.readline


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

for i in range(n):
    if a[i] >= suma / 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()))
sumA=sum(a)
cnt=0
for i in a:
    if i>=sum/(4*m):
        cnt=cnt+1
if cnt>=m:
    print('Yes')
else:
    print('No')

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

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

n,m=map(int,input().split())
a=list(map(int,input().split()))
sumA=sum(a)
cnt=0
for i in a:
    if i>=sumA/(4*m):
        cnt=cnt+1
    else:
        cnt=cnt
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,m = map(int, input().split())
s = input()
t = s.rstrip().split(' ')
c = 0
for a in t:
  c += int(a)
d = 0
for a in t:
  if int(a) >= c:
    d += 1
if d < m:
  print('No')
else:
  print('Yes')

n,m = map(int, input().split())
s = input()
t = s.rstrip().split(' ')
c = 0
for a in t:
  c += int(a)
d = 0
for a in t:
  if int(a) >= c/4/m :
    d += 1
if d < 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):
import math
n,m = map(int,input().split())

l = list(map(int,input().split()))
s = sum(l)
ans = 0
t = s/(4*m)

for i in l:
  if i>=math.ceil(t):
    ans+=1
  if ans>=m:
    print("Yes")
  else:
    print("No")

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

l = list(map(int,input().split()))
s = sum(l)
ans = 0
t = s/(4*m)

for i in l:
  if i>=math.ceil(t):
    ans+=1
  
if ans>=m:
  print("Yes")
else:
  print("No")


Verdicts: Wrong Answer

Accepted