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 = input().split()
N= int(N)
M = int(M)
itemList = input().split()
itemList.sort()
index = -1
answer = true
for i in range(M):
  if itemList[index] < (N*(1/(4*M))):
    answer = false
    break
  index -= 1
  
if answer:
  print("Yes")
else:
  print("No")

N, M = input().split()
N= int(N)
M = int(M)
itemList = list(map(int, input().split()))
itemList.sort()
index = -1
answer = True
for i in range(M):
  if itemList[index] < (sum(itemList)*(1/(4*M))):
    answer = False
    break
  index -= 1
  
if answer:
  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())
item_vote = list(map(int, input().split()))

total_vote = sum(item_vote)
item_vote = sorted(item_vote)
boder = 1/4*M
if item_vote[M-1] < boder:
    print('Yes')
else:
    print('No')

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

total_vote = sum(item_vote)
item_vote = sorted(item_vote, reverse=True)
boder = total_vote/4*M
print(item_vote, boder)
if item_vote[M-1] >= boder:
    print('Yes')
else:
    print('No')

N, M = map(int, input().split())
item_vote = list(map(int, input().split()))
total_vote = sum(item_vote)
item_vote = sorted(item_vote, reverse=True)
boder = total_vote/(4*M)
if item_vote[M-1] < boder:
    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()))
num=len([x for x in a if x>=1/(4*m)])
if num >= m:
    print("yes")
else:
    print("no")

n,m=map(int,input().split())
a=list(map(int,input().split()))
a_sum=sum(a)
num=len([x for x in a if x>=a_sum/(4*m)])
if num >= 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()))

cnt = 0
for i in range(N):
	if A[i] >= sum(A)*int((1/4*M)):
		cnt += 1
		print(cnt)
	else:
		cnt = cnt
		print(cnt)

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


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

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

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

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

Verdicts: Runtime Error

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

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

total = sum(A)

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

if selcnt >= M:
    print("yes")
else:
    print("no")


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

total = sum(A)

selcnt = 0
for a_i in A:
    if a_i >= total * (1/(4*M)):
        break
    selcnt += 1

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


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

total = sum(A)

selcnt = 0
for a_i in sorted(A):
    if a_i >= total * (1/(4*M)):
        break
    selcnt += 1

if selcnt >= M:
    print("yes")
else:
    print("no")


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

total = sum(A)

selcnt = 0
for a_i in sorted(A):
    if a_i < total * (1/(4*M)):
        break
    selcnt += 1

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


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

total = sum(A)

selcnt = 0
for a_i in reversed(sorted(A)):
    if a_i < total * (1/(4*M)):
        break
    selcnt += 1

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


Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

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

Submission attempts (in order):
from sys import stdin
N,M = map(int,input().split())
A=  [int(x) for x in stdin.readline().rstrip().split()]
m = min(A)
s = sum(A)
if ( s / (4 * M) > m) :
  print("no")
else:  
  print("yes")

from sys import stdin
N,M = map(int,input().split())
A=  [int(x) for x in stdin.readline().rstrip().split()]
m = max(A)
s = sum(A)
if ( s / (4 * M) > m) :
  print("no")
else:  
  print("yes")

from sys import stdin
N,M = map(int,input().split())
A=  [int(x) for x in stdin.readline().rstrip().split()]
m = min(A)
s = sum(A)
if ( s / (4 * M) > m) :
  print("No")
else:  
  print("Yes")

from sys import stdin
N,M = map(int,input().split())
A=  [int(x) for x in stdin.readline().rstrip().split()]
m = max(A)
s = sum(A)
if ( s / (4 * M) < m) :
  print("no")
else:  
  print("yes")

from sys import stdin
N,M = map(int,input().split())
A=  [int(x) for x in stdin.readline().rstrip().split()]
m = max(A)
s = sum(A)
if ( s / (4 * m) < M) :
  print("no")
else:  
  print("yes")
                   

from sys import stdin
N,M = map(int,input().split())
A=  [int(x) for x in stdin.readline().rstrip().split()]
A.sort()
s = sum(A)
if ( s / (4 * M) > A[-M]) :
  print("No")
else:
  print("Yes")

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

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

Submission attempts (in order):
N,M=(int(x) for x in input().split())
As=[int(x) for x in input().split()]
p = sum(As)/4M
ov = [1 if x>=p else 0 for x in As]
if sum(ov)>=M:
  print('Yes')
else:
  print('No')

N,M=(int(x) for x in input().split())
As=[int(x) for x in input().split()]
p = sum(As)/(4*M)
ov = [1 if x>=p else 0 for x in As]
if sum(ov)>=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()))

all_sum = sum(a)
standard = all_sum//(4*M)
ans = 0

for i in a:
  if i >= standard:
    ans += 1

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


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

all_sum = sum(a)
standard = all_sum//(4*M)
ans = 0

for i in a:
  if a[i] >= standard:
    ans += 1

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

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

all_sum = sum(a)
standard = all_sum/(4*M)
ans = 0

for i in a:
  if i >= standard:
    ans += 1

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


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

all_sum = sum(a)
standard = all_sum/(4*m)
ans = 0

for i in a:
  if i >= standard:
    ans += 1

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


Verdicts: Runtime Error

Runtime Error

Runtime Error

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

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

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

Verdicts: Runtime Error

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

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

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

Verdicts: Runtime Error

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

Submission attempts (in order):
def LI():
	return [ int(s) for s in input().split() ]
N,M = LI()
A = LI()

print('Yes') if sum(map(lambda x: x >= (1/4/M))) >= M else print('No')



def LI():
	return [ int(s) for s in input().split() ]
N,M = LI()
A = LI()
sum_A = sum(A)
 
print('Yes') if sum(map(lambda x: x >= sum_A*(1/4/M), A)) >= M else print('No')

Verdicts: Runtime Error

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

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

n,m = map(int,input().split())
a = list(map(int,input().split()))
b = [0]*n
b = sorted(a,reverse=True)
c = sum(a)
if(b[m-1]>=c/(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()))
S = sum(A)
cnt = 0
for a in A:
	if a >= S / (4*M):
	cnt += 1
if cnt >= M:
	print("Yes")
else:
print("No")

package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

// 文字列を1行入力
func StrStdin() (stringReturned string) {
	scanner := bufio.NewScanner(os.Stdin)

	scanner.Scan()
	stringReturned = scanner.Text()

	stringReturned = strings.TrimSpace(stringReturned)
	return
}

// 空白や空文字だけの値を除去したSplit()
func SplitWithoutEmpty(stringTargeted string, delim string) (stringReturned []string) {
	stringSplited := strings.Split(stringTargeted, delim)

	for _, str := range stringSplited {
		if str != "" {
			stringReturned = append(stringReturned, str)
		}
	}
	return
}

// デリミタで分割して文字列スライスを取得
func SplitStrStdin(delim string) (stringReturned []string) {
	// 文字列で1行取得
	stringInput := StrStdin()

	// 空白で分割
	// stringSplited := strings.Split(stringInput, delim)
	stringReturned = SplitWithoutEmpty(stringInput, delim)

	return
}

// デリミタで分割して整数値スライスを取得
func SplitIntStdin(delim string) (intSlices []int, err error) {
	// 文字列スライスを取得
	stringSplited := SplitStrStdin(" ")

	// 整数スライスに保存
	for i := range stringSplited {
		var iparam int
		iparam, err = strconv.Atoi(stringSplited[i])
		if err != nil {
			return
		}
		intSlices = append(intSlices, iparam)
	}
	return
}

func main() {
	input, _ := SplitIntStdin(" ")
	N, M := input[0], input[1]

	input, _ = SplitIntStdin(" ")
	input = input[0:N]
	sum := 0
	for _, x := range input {
		sum += x
	}

	var M_f float64 = float64(M)
	var sum_f float64 = float64(sum)

	count := 0
	for _, x := range input {
		var x_f float64 = float64(x)
		if x_f >= sum_f/(4.0*M_f) {
			count += 1
		}
	}
	fmt.Println(sum_f / (4.0 * M_f))
	fmt.Println(count)
}

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

cnt = 0
for i in b:
    if i >= sum(b)/(4*a[1]):
        cnt +=1
    else:
        pass
    
if cnt >= a[1]:
    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()))

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

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

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

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

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

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

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

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

Verdicts: Runtime Error

Runtime Error

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

Submission attempts (in order):
N,M = map(int,input().split())
m = 0
v = input().split()
for i in range(N): v[i] = int(v[i])
  
v.sort(reverse=True)
v_min = sum(v)/4/M
print(v_min)

while len(v):
  if v.pop(0) >= v_min:
    m += 1
  else:
    break

if M <= m:
  print("Yes")
else:
  print("No")

N,M = map(int,input().split())
m = 0
v = input().split()
for i in range(N): v[i] = int(v[i])
  
v.sort(reverse=True)
v_min = sum(v)/4/M

while v[0]:
  if v.pop(0) >= v_min:
    m += 1

if M <= m:
  print("Yes")
else:
  print("No")

N,M = map(int,input().split())
m = 0
v = input().split()
for i in range(N): v[i] = int(v[i])
  
v.sort(reverse=True)
v_min = sum(v)/4/M

while len(v):
  if v.pop(0) >= v_min:
    m += 1
  else:
    break

if M <= m:
  print("Yes")
else:
  print("No")

Verdicts: Wrong Answer

Runtime Error

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

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

allvote=0
allvote=sum(A)


c=0
for a in A:
    if a>=allvote/(4*k) :
        c+=1

if c>=k :
    ans = "Yes"
else:
    ans = "No"
print(ans,allvote,c)

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

allvote=0
allvote=sum(A)


c=0
for a in A:
    if a>=allvote/(4*k) :
        c+=1

if c>=k :
    ans = "Yes"
else:
    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):
n, m = map(int, input().split())
A = list(map(int, input().split()))

all_vote = sum(A)

cnt = 0

for a in A:
        if a * 4 * m >= all_vote    
        cnt += 1
if cnt >= m:
    print('Yes')
else:
    print('No')

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

all_vote = sum(A)

cnt = 0

for a in A:
    #if a >= all_vote / (4*m):
    if a * 4 * m >= all_vote    
        cnt += 1
if cnt >= m:
    print('Yes')
else:
    print('No')

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

all_vote = sum(A)

cnt = 0

for a in A:
        if a * 4 * m >= all_vote
        cnt += 1
if cnt >= m:
    print('Yes')
else:
    print('No')

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

all_vote = sum(A)

cnt = 0

for a in A:
    #if a >= all_vote / (4*m):
    if a * 4 * m >= all_vote:   
        cnt += 1
if cnt >= m:
    print('Yes')
else:
    print('No')

Verdicts: Runtime Error

Runtime Error

Runtime Error

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

Submission attempts (in order):
N, M = map(int, input().split())
A = list(map(int, input().split()))
S = A[N-1]
for i in range(N-1):
  S += A[i]
  if A[i+1] < A[i]:
    a = A[i+1]
    A[i+1] = A[i]
    A[i] = a

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

N, M = map(int, input().split())
A = list(map(int, input().split()))
for i in range(N-1):
  for j in range(i+1):
    if A[i+1-j] > A[i-j]:
      a = A[i-j]
      A[i-j] = A[i+1-j]
      A[i+1-j] = a

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

if A[M-1] < float(S)/(4.0*float(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):
val1 = input().split()
val2 = input().split()
total = 0
for votes in val2:
  total += int(votes)
thres = total * 1/4 / int(val1[1]) 
i = 0
for votes in val2:
  if int(votes) >= thres:
    i += 1
if i >= int(val1[1]):
  print("yes")
else:
  print("no")


val1 = input().split()
val2 = input().split()
total = 0
for votes in val2:
  total += int(votes)
thres = total * 1/4 / int(val1[1]) 
i = 0
for votes in val2:
  if int(votes) >= thres:
    i += 1
if i >= int(val1[1]):
  print("Yes")
else:
  print("No")


Verdicts: Wrong Answer

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

Submission attempts (in order):
n, m = map(int, input().split())
a = map(int, input().split())
ans = 0

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

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

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

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

Verdicts: Runtime Error

Wrong Answer

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

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

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

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

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

Verdicts: Runtime Error

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

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

N, M = map(int, input().split())
A = list(map(int, input().split()))
TOTAL = 0
for i in range(len(A)):
    TOTAL += A[i]
if A[-1] <= (1/(4*M))*TOTAL:
    print("No")
else:
    print("Yes")

N, M = map(int, input().split())
A = list(map(int, input().split()))
TOTAL = 0
for i in range(len(A)):
    TOTAL += A[i]
if A[-1] < (1/(4*M))*TOTAL:
    print("No")
else:
    print("Yes")

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

N, M = map(int, input().split())
lists, count = [int(x) for x in input().split()], 0
for x in lists:
    if x >= ((1 / (4 * M)) * sum(lists)):
        count += 1
print('Yes' if count >= M else 'No')

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

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

Submission attempts (in order):
n, m = map(int, input().split())
arr = list(map(int, input().split()))
sums = 0
for i in arr:
    sums = sums + i
check = (1 / (4*m))*sums
for i in arr:
    if i < check:
        print("No")
        break
    else:
        continue
print("Yes")

n, m = map(int, input().split())
arr = list(map(int, input().split()))
sums = 0
count = 0
for i in arr:
    sums = sums + i
check = (1 / (4*m))*sums
for i in arr:
    if i < check:
        count = 1
        break
    else:
        continue
if count >= 1:
    print("No")
else:
    print("Yes")

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

n, m = map(int, input().split())
acc = n+m
arr = list(map(int, input().split()))
sums = 0
count = 0
for i in arr:
    sums = sums + i
check = (1 / (4*m))*sums
for i in arr:
    if i < check:
        count += 1
    else:
        if i == sums
            count = 0
            break
        continue
if count >= 1:
    print("No")
else:
    print("Yes")

n, m = map(int, input().split())
arr = list(map(int, input().split()))
sums = 0
for i in arr:
    sums = sums + i
check = (1 / (4*m))*sums
for i in arr:
    if i < check:
        print("No")
        break
    else:
        continue


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

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

ans = N - x

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

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Runtime Error

Wrong Answer

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

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

S = 0

for k in range (0 , N):
	S += A[k]

for j in range (0 , N):
  	m = 0
  	if A[j] >= S / ( 4 * M ):
    	m = m + 1
    
if m >= M:
  	print ( "Yes" )
else:
 	print ( "No" ) 
    

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

S = 0

for k in range (0 , N):
	S += A[k]

m = 0
for j in range (0 , N):
	if A[j] >= (S / ( 4 * M )):
		m = m + 1

if m >= 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()))
count = 0
total = 0

for i in range(n):
	total=total+a[i]
th=total/(4*m)
print(total,th)

for i in range(n):
  if(a[i]>=(th)):
    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
total = 0

for i in range(n):
	total=total+a[i]
th=total/(4*m)
#print(total,th)

for i in range(n):
  if(a[i]>=(th)):
    count=count+1
#print(count)
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):

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





i = list(map(int, input().split()))
N = i[0]
M = i[1]
A  = list(map(int, input().split()))
S=sum(A)
A_sorted=sorted(A,reverse=True)
if A_sorted[M-1] >= S*1/(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, = map(int, input().split())

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

selectable = False

if  total_point * (1 / (4 * M)) =< A[M-1]:
    selectable = True

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


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

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

selectable = False

if total_point * (1 / (4 * M)) <= A[M-1]:
    selectable = True

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


Verdicts: Runtime Error

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

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

newlist = sorted(a,reverse=True)

print(newlist)

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

if ans==m:
    print("Yes")

else:
    print("No")

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

newlist = sorted(a,reverse=True)

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

if ans==m:
    print("Yes")

else:
    print("No")

Verdicts: Wrong Answer

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

Submission attempts (in order):
INPUT = input().split()
N = int(INPUT[0])
M = int(INPUT[1])
score_list = input().split()
score_list_int =  [int(n) for n in score_list]

border = sum(score_list_int)/4

answer = "yes"

for i in score_list_int:
    if i < border:
        N -= 1

if N < M:
    answer = "no"
    
print(answer)

INPUT = input().split()
N = int(INPUT[0])
M = int(INPUT[1])
score_list = input().split()
score_list_int =  [int(n) for n in score_list]

border = sum(score_list_int)/4/M

answer = "yes"

for i in score_list_int:
    if i < border:
        N -= 1

if N < M:
    answer = "no"
    
print(answer)

INPUT = input().split()
N = int(INPUT[0])
M = int(INPUT[1])
score_list = input().split()
score_list_int =  [int(n) for n in score_list]

border = sum(score_list_int)/4/M

answer = "Yes"

for i in score_list_int:
    if i < border:
        N -= 1

if N < M:
    answer = "No"
    
print(answer)

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
sums = 0

for _ in range(N):
  sums += A[_]


for i in range(N):
  if A[i]//sums >= 1//4*M:
    ans += 1
  else:
    pass
  
  
  

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

from fractions import Fraction

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

ans = 0
sums = 0

for _ in range(N):
  sums += A[_]


for i in range(N):
  a = Fraction(A[i],sums)
  b = Fraction(1,4*M)
  if a >= b:
    ans += 1
  else:
    pass
  
  
  

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

Verdicts: Wrong Answer

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

Submission attempts (in order):

NM = input("").split()
A = list(map(int, input().strip().split()))

N = int(NM[0])
M = int(NM[1])
ALL = sum(A)
k = 0
c = ALL/(4*M)

print(N, M, ALL, c)
for Ai in A:
    if Ai>=c:
        k += 1

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


N = int(NM[0])
M = int(NM[1])
ALL = sum(A)
k = 0
c = ALL/(4*M)

print(N, M, ALL, c)
for Ai in A:
    if Ai>=c:
        k += 1

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



NM = input("").split()
A = list(map(int, input().strip().split()))

N = int(NM[0])
M = int(NM[1])
ALL = sum(A)
k = 0
c = ALL/(4*M)

for Ai in A:
    if Ai>=c:
        k += 1

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


Verdicts: Wrong Answer

Runtime Error

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

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

item.sort(reverse=True)

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

n, m = map(int, input().split())
item = input().split()
item = [int(x) for x in item]

item.sort(reverse=True)

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


n, m = map(int, input().split())
item = input().split()
item = [int(x) for x in item]

item.sort(reverse=True)

s = sum(item)
res = 0
for i in range(n):
  if item[i] >= s / (4*m):
    res += 1
    if res >= m:
      print('Yes')
      break
  else:
    print('No')
    break


Verdicts: Wrong Answer

Wrong Answer

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

Submission attempts (in order):
N, M = list(map(lambda x: int(x), input().split(" ")))
A = list(map(lambda y: int(y), input().split(" ")))
A.sort()
 
print("Yes") if 0.25 * sum(A) / M <= A[M - 1] else print("No")

N, M = list(map(lambda x: int(x), input().split(" ")))
A = list(map(lambda y: int(y), input().split(" ")))
A.sort(reverse=True)
 
print("Yes") if 0.25 * sum(A) / M <= A[M - 1] 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=[int(i) for i in input().split()]
count=0

A=sum(a)//(4＊m)
for i in range(n):
  if a[i]>A:
    count+=1
if count>=m:
  print("Yes")
else:
  print("No")

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

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


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


Verdicts: Wrong Answer

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

Submission attempts (in order):
n, m = list(map(int,input().split()))
a = list(map(int,input().split()))
a.sort(reverse=True)

limit = sum(a)/(4*m)
canselect = True
for ae in a:
    if ae < limit:
        canselect = False

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

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

limit = sum(a)/(4*m)
canselect = True
for i in range(0, m):
    if a[i] < limit:
        canselect = False

if canselect:
    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())
N = input().split()
N = [int(n) for n in N]
A = []
soutoku = 0
for i in N:
    soutoku += int(i)
N = sorted(N, reverse=True)
for i in range(M):
    A.append(N[i])
b = soutoku / (4*M)

print(N[int(M-1)])
if int(N[int(M-1)]) < b:
    print("No")
else:
    print("Yes")

N, M = map(int, input().split())
N = input().split()
N = [int(n) for n in N]
A = []
soutoku = 0
for i in N:
    soutoku += int(i)
N = sorted(N, reverse=True)
for i in range(M):
    A.append(N[i])
b = soutoku / (4*M)

if int(N[int(M-1)]) < b:
    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 = input().split()
list_a = [int(n) for n in A]
count = 0

waru = 4 * M
SUM = sum(list_a)
vote = SUM / waru

for i in range(0, N):
    if list_a[i] > vote:
        count += 1
    else:
        pass

print(count)

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


N, M = map(int, input().split())
A = input().split()
list_a = [int(n) for n in A]
count = 0

waru = 4 * M
SUM = sum(list_a)
vote = SUM / waru

for i in range(0, N):
    if list_a[i] >= vote:
        count += 1
    else:
        pass

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())
x = input()
total_vote = sum(x)
count = 0
for y in x:
    if y >=(total_vote/(4*M)):
        count+=1
      
if count>=M:
    print('Yes')
else:
    print('No')


N,M = map(int, input().split())
x = list(map(int, input().split()))
total_vote = sum(x)
count = 0
for y in x:
    if y >=(total_vote/(4*M)):
        count+=1
      
if count>=M:
    print('Yes')
else:
    print('No')


Verdicts: Runtime Error

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

Submission attempts (in order):
import math
num, m = map(int,input().split())
list = [int(x) for x in input().split()]

sorted(list, reverse = True)
least = math.floor(sum(list) * (1/(4*m)))
count = 0

print(least)

for i in range(m):
    if list[i] < least:
        print("No")
        print(list[i],"<",least)
        break
    else:
        count += 1

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


import math
num, m = map(int,input().split())
list = [int(x) for x in input().split()]


count = 0

for i in range(num):
    if list[i] < sum(list)/(4*m):
        None
    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 = input().split()
for i in a:
  if int(i) >= sum(map(int,a))* 1/(4*M):
    ans+=1

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

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


N, M = map(int, input().split())
A = sorted(list(map(int, input().split())))
ans = sum(x >= (sum(A) / (4 * M)) for x in A)
print('No' if ans < M else '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 = input.split()
a = list.split()
a.sort(reverse=True)
if a[M-1] >= sum(a) / 4*M:
  print("Yes")
else:
  print("No")


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


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

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

Verdicts: 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):
def pickup(vote, choice):
	flag = 0
	for i in vote:
		if i >= 1 / choice * 4:
			continue
		else:
			flag = flag + 1
	if  choice >= int(len(vote)) - flag:
		return 0
	else:
		return 1

numbers, choice = list(map(int, input().split()))

vote = [numbers]
vote = list(map(int, input().split()))

if pickup(vote, choice) == 0:
	print("Yes")
else:
	print("No")


def pickup(vote, choice):
	flag = 0
	for i in vote:
		if i >= 1 / choice * 4:
			continue
		else:
			flag = flag + 1
	if  choice >= len(vote) - flag:
		return 0
	else:
		return 1

numbers, choice = list(map(int, input().split()))

vote = [numbers]
vote = list(map(int, input().split()))

if pickup(vote, choice) == 0:
	print("Yes")
else:
	print("No")


def pickup(vote, choice):
	flag = 0
	sum_vote = 0
	for i in vote:
		sum_vote = sum_vote + i
	for i in vote:
		if i >= sum_vote / (choice * 4):
			continue
		else:
			flag = flag + 1
	if  choice <= int(len(vote)) - flag:
		return 0
	else:
		return 1

numbers, choice = list(map(int, input().split()))

vote = [numbers - 1]
vote = list(map(int, input().split()))

if pickup(vote, choice) == 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()))



def check(A,M):
    flag = 0
    sumOfA = 0
    for i in A:
        sumOfA+=A
    condition = sumOfA/(4*M)
    if(M==1 and max(A)>condition):
        return "Yes"
    for i in A:
        if(i <= condition):
            continue
        else:
            flag+=1
            if(flag==M):
                return "Yes"
    return "No"

print(check(A,M) else "No")





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



def check(A,M):
    flag = 0
    condition = sum(A)/(4*M)
    if(M==1 and max(A)>condition):
        return "Yes"
    for i in A:
        if(i < condition):
            continue
        elif(i >= condition):
            flag+=1
            if(flag==M):
                return "Yes"
    return "No"

print(check(A,M))





Verdicts: Runtime Error

Accepted