Problem:


Score : 200 points

Problem Statement

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.

Constraints

1 \leq M \leq N \leq 100

1 \leq A_i \leq 1000

A_i are distinct.

All values in input are integers.

Input

Input is given from Standard Input in the following format:

N M
A_1 ... A_N

Output

If M popular items can be selected, print Yes; otherwise, print No.

Sample Input 1

4 1
5 4 2 1

Sample Output 1

Yes

There were 12 votes in total. The most popular item received 5 votes, and we can select it.

Sample Input 2

3 2
380 19 1

Sample Output 2

No

There were 400 votes in total. The second and third most popular items received less than \dfrac{1}{4\times 2} of the total number of votes, so we cannot select them. Thus, we cannot select two popular items.

Sample Input 3

12 3
4 56 78 901 2 345 67 890 123 45 6 789

Sample Output 3

Yes



Sample input:
4 1
5 4 2 1


Sample output:
Yes

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

Solution code:
n,m= map(int,input().split())
l = list(map(int,input().split()))
count=0
c = sum(l)/(4*m)
for i in l:
    if i>c:
        count+=1
if count>=m:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

i=0
s=0

while(i<N):
  s+=list[i]
  i+=1

m=s/(4*M)

list.sort(reverse=True)

r="No"
j=0

while(j<M):
  if(m<list[j]):
    r="Yes"
  else:
    r="No"
  j+=1
print(r)

Submission status: Wrong Answer

Solution code:
# coding: utf-8

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

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

border = sum(a_list) / (4 * m)

a_choiced_list = [a for a in a_list if a > border]

print(len(a_choiced_list))
if len(a_choiced_list) < m:
    print('No')
else:
    print('Yes')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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


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

    cnt = 0

    for a in A:
        if a > sum(A) / (4 * M):
            cnt += 1
    print("Yes"if cnt >= M else "No")


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

k = sum(l)/(4*m)

count = 0
for a in l:
    if a > k:
        count += 1

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

Submission status: Wrong Answer

Solution code:
n,m = map(int,input().split())
tmp = input()
a = tmp.split()
a = list(map(int,a))
a = sorted(a, reverse=True)

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

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

Submission status: Wrong Answer

Solution code:
N,M=map(int,input().split())
A=list(map(int,input().split()))
ALL=sum(A)
ave=ALL/(4*M)
count=0
for i in range(N):
    if(A[i]>=ave):
        count+=1
    else:
        pass
if(count>M):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

all = sum(list(A))
p = int(1/(4*M)*all)
cnt = 0

for i in A:
  if i >= p:
    cnt += 1

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

Submission status: Wrong Answer

Solution code:
n, m = map(int, input().split())
List = list(map(int, input().split()))

if m < (len([i for i in List if i > sum(List)/(4*m) ])):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
import sys
stdin = sys.stdin

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

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

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

Submission status: Wrong Answer

Solution code:
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 > t/(m*4):
    s+=1

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

Submission status: Wrong Answer

Solution code:
n,m=map(int,input().split())
a=list(map(int,input().split()))
sum=0;
count=0;
for i in range(len(a)):
    sum=sum+a[i]
c=(1/(4*m))*sum
for i in range(len(a)):
    if a[i]>c :
        count=count+1
    else:
        count=count+0
if(count>=m):
    print("YES")
else:
    print("NO")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n, m = map(int, input(). split())
lstr_a = input().split(" ")
lint_a = [int(n) for n in lstr_a]
alist = sorted(lint_a, reverse = True)
s = sum(alist)
if alist[m-1]>=s//(4*m):
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

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

num = 0

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

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

Submission status: Wrong Answer

Solution code:
import sys

N,M = map(int, sys.stdin.readline().strip().split())
A = list(map(int, sys.stdin.readline().strip().split()))

votes_M = sorted(A, reverse=True)[M-1]
votes = sum(A)

if votes_M >= (votes // (M * 4)):
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
n,m = map(int,input().split())
line = sorted(list(map(int,input().split())),reverse = True)
sums = sum(line)
if sums % 4 != 0:
  least = sums//(4*m)
else:
  least = sums//(4*m) + 1
box = []
for i in line:
  if i > least:
    box.append(i)
if len(box) >= m:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
n,m=map(int,input().split())
a=list(map(int,input().split()))
t=sum(a)/(4*m)
count=0
for i in a:
    if(i>t):
        count+=1
        if(count>=m):
            print('Yes')
            exit()
        else:
            continue
    else:
        continue
print('No')

Submission status: Wrong Answer

Solution code:
n = list(map(int,input().split()))
vote = list(map(int,input().split()))
a = 4*n[1]*sum(vote)
result = 0
for i in range(n[0]):
  if vote[i]<a:
    result += 1
if result<n[1]:
  print('No')
else:
  print('Yes')

Submission status: Wrong Answer

Solution code:
m,n=map(int,input().split())
a=sorted(list(map(int,input().split())))
s=0
for j in range(n):
  s+=a[j]
for i in range(n):
  if a[n-i-1] < s/(4*m):
    if i!=0:
      a=a[n-i:]
      break
    else:
      a=[]
      break
if len(a) >= m:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
import numpy as np

[N, M] = list(map(int, input().split()))
A = list(map(int, input().split()))
threshold = int(np.sum(A) / (4 * M))
#print(threshold)
Th = [a for a in A if a > threshold]
#print(Th)
if len(Th) <= M:
  ans = 'No'
else:
  ans = 'Yes'
print(ans)

Submission status: Wrong Answer

Solution code:
n,m = map(int,input().split())

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

list.sort(a, reverse=True)

ans = "No"

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

Submission status: Wrong Answer

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

thresh_score = 1/(4*M) * sum(A)

over_count = sum([1 if a > thresh_score else 0 for a in A])
print('Yes' if over_count > M else 'No')

Submission status: Wrong Answer

Solution code:
n,m=input().split()
a = [int(e) for e in input().split()]
a.sort()
a.reverse()

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

Submission status: Wrong Answer

Solution code:
N,M = map(int,input().split())
l = x = [int(i) for i in input().split()]
l_sum = sum(l)
cnt = 0

for i in range(N):
    if l[i] > (1/(4*M))*l_sum:
        cnt += 1

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

Submission status: Wrong Answer

Solution code:
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_right(al,total/(4*m))

if n - idx > m:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
n, m = map(int, input().split())
a = [int(e) for e in input().split()]

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

Submission status: Wrong Answer

Solution code:
#n,m
n,m = (int(x) for x in input().split())

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

a.sort(reverse=True)

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

print(str(a[m-1]),str(sum),str(1 / (4 * m)))

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

Submission status: Wrong Answer

Solution code:
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]

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

Submission status: Wrong Answer

Solution code:
#coding:utf-8
import sys
n, m = map(int, input().split())
a = list(map(int, input().split()))
vote = sum(a)
rank = sorted(a, reverse=True)
border = vote // (4*m)
#print(border, rank)

for i in range(0, m):
    if rank[i] < border:
        print('No')
        sys.exit()

print('Yes')

Submission status: Wrong Answer

Solution code:
NM = input().split()
N = int(NM[0])
M = int(NM[1])

A = []
kosuu = 0

tmp = input().split()
for i in range(N):
  A.append(int(tmp[i]))

tmp = sum(A)//N

for i in A:
  if i >= tmp:
    kosuu += 1

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

Submission status: Wrong Answer

Solution code:
n, m= map(int, (input().split()))
a = list(map(int, input().split()))
count = 0
total = 0
for i in a:
  total += i
for j in a:
  if j / total > 1 / (4 * m):
    count += 1
if count >= m:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
n,m = map(int, input().split())
A = map(int, input().split())
B = []

for i in A:
    if i >= sum(A)/(4*m):
        B.append(i)

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math
n, m = map(int, input().split(" "))
aL = list(map(int, input().split(" ")))

sm = sum(aL)

cnt = 0
for a in aL:
    if math.floor(sm * (1 / (4 * m))) < a:
        cnt += 1

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

Submission status: Wrong Answer

Solution code:
a,b = map(int, input().split())
c = input().split()
m = 0
for i in range(len(c)):
    c[i] = int(c[i])
    m += c[i]
c.sort(reverse=True)
if c[b-1] > m * (1 / (4*b)):
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
n, m = map(int, input().split())
a = input().split()
a = [int(i) for i in a]
may = max(a)

dif = (1 / (4*m)) * may
cont = 0
for i in a:
     cont += (1 if i >= dif else 0)
print ('Yes' if cont >= m else 'No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
(n, m) = [int(s) for s in input().split()]
a = [int(s) for s in input().split()]

t = sum(a)

a = sorted(a)

chosen = a[-m:]

r = 1 / (4 * m) * t

c = ['Yes' if a > r else 'No' for a in chosen]

c = set(c)

ans = 'Yes' if len(c) == 1 else 'No'

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n, m = map(int, input().split())
List = list(map(int, input().split()))

q = int(sum(List) / (4 * m))

count = 0
for i in List:
    if i >= q:
        count += 1

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

Submission status: Wrong Answer

Solution code:
lismn=input().split()
n=int(lismn[0])
m=int(lismn[1])
lisa=[int(x) for x in input().split()]
count=0
for i in lisa:
  if sum(lisa)/4.0/m < i:
    count+=1
if m<=count:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

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

ans = 0

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

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

Submission status: Wrong Answer

Solution code:
n,m=map(int,input().split())
b=0
l=list(map(int,input().split()))
qq=sum(l)
for i in range(n):
    qq+=l[i]
    if (l[i]>=(1/(4*m))*qq):
        b+=1
if (b<m):
    print("No")
else:
    print("Yes")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
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(1/4*m)
for i in a_list:
    if i > kijyun:
        ok_num += 1
    if ok_num == m:
        print('Yes')
        quit()
print('No')

Submission status: Wrong Answer

Solution code:
nm = list(map(int,input().split()))
A = list(map(int,input().split()))

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

if A[nm[1]-1] > s/4/nm[1]:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
N, M = map(int, input().split())
listA = list(map(int, input().split()))
listA.sort()

cnt = 0

yukohyo = int(sum(listA)/(4*M))
for i in listA:
    if i >= yukohyo:
        cnt += 1

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

Submission status: Wrong Answer

Solution code:
from sys import stdin

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

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

Submission status: Wrong Answer

Solution code:
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()

Submission status: Wrong Answer

Solution code:
N, M = map(int, input().split())
shina = list(map(int, input().split()))
shina.sort(reverse=True)
hantei = 0

for i in range(M):
  if shina[i] < 1 / (4 * M):
    hantei += 1

if hantei == 0:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

vote = sum(A)
ans = sum(x >= vote//(4*M) for x in A)
if ans >= M:
    print('Yes')
elif ans < M:
    print('No')

Submission status: Wrong Answer

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

sm = sum(A)
ms = sm / (4*M)
pop = []
for i in range(N):
    if int(ms) < A[i]:
        pop.append(A[i])
    else:
        pass

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
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")

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
N,M = list(map(int,input().split()))
A = list(map(int,input().split()))

sre = (1/(4*M))*sum(A)

cor = []
for a in A:
    if a > sre:
        cor.append(a)


if len(cor) > M or len(cor) == M:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

A_list.sort(reverse=True)
SUM = sum(A_list)

if A_list[M-1] >= (SUM//(4*M)) :
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
n,m= map(int,input().split(' '))
arr= list(map(int,input().split(' ')))

votes= sum(arr)
arr.sort()
if arr[-m]>=(votes+1)//(4*m):
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
n, m = map(int, input().split())
a = sorted(list(map(int, input().split())), reverse=True)
num = int(1/(4*m))
if a[m-1] < num:
  print('No')
else:
  print('Yes')

Submission status: Wrong Answer

Solution code:
n,m=map(int,input().split())
a=list(map(int,input().split()))
b=sum(a)
for i in range(n):
    if a[i]<b/(4*m):
        a[i]=0
c=list(set(a))
if len(c)-1>=m:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
N, M = map(int, input().split())
list_goods = [int(x) for x in input().split()]

list_goods.sort(reverse=True)

flag = "Yes"

for i in range(M):
    if list_goods[i] < sum(list_goods)//(4*M):
        flag = "No"
print(flag)

Submission status: Wrong Answer

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

sum_a = sum(a)
l = []
for i in range(n):
    if a[i] >= sum_a // (4*m):
        l.append(a[i])
if len(l) >= m:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
from fractions import Fraction

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

sum_p = sum(A) * Fraction(1, M * 4)
count = 0
for i in A:
    if i > sum_p:
        count += count + 1
if M <= count:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
NM = list(map(int, input().split()))
score = list(map(int, input().split()))

cutter = 0
all = 0
for i in range(len(score)):
    all += score[i]

candidate = 0
criteria = 4 * NM[1]
for i in range(len(score)):
    if (all < (score[i] * criteria)):
        candidate += 1

if (candidate >= NM[1]):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
N,M = map(int, input().split())
A = [int(N) for N in input().split()]
list.sort(A, reverse=True)

sum = 0
i = 0
while i != N:
     sum += A[i]
     i += 1

vote = 0
i = 0
while i != M:
     vote += A[i]
     i += 1

# print('%d %d' %(vote,sum))
if vote >= sum // 4:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
n,m = map(int,input().split())
a = list(map(int,input().split()))
count = 0

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
(n, m) = [int(s) for s in input().split()]
a = [int(s) for s in input().split()]

t = sum(a)

a = sorted(a)

chosen = a[-m:]

r = 1 / (4 * m) * t

c = ['Yes' if a >= r else 'No' for a in chosen]

c = set(c)

ans = 'Yes' if len(c) == 1 else 'No'

print(ans)

Submission status: Wrong Answer

Solution code:
n, m = map(int, input().split())
a = [int(e) for e in input().split()]

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

Submission status: Wrong Answer

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

cut = int(sum(A)/(4*int(M)))

count = 0

for i in A:
    if i > cut:
        count +=1

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

Submission status: Wrong Answer

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

A.sort()
real = A[M-1] / sum(A)
ideal = 1 / (4 * M)

if real >= ideal:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
n,b= map(int, input().split())
 
a= list(map(int, input().split()))
 
new_list = sorted(a)
 
if new_list[b-1] > b*4:
    	print("Yes")
else:
    	print("No")

Submission status: Wrong Answer

Solution code:
N, M = map(int, input().split()) 
A = sorted(map(int, input().split()), reverse=True)

if sum(A)/(4*M) > A[M-1]:
    print("No")

print("Yes")

Submission status: Wrong Answer

Solution code:
N, M = map(int, input().split())

As = list(map(int,input().split()))
vote_sum = sum(As)
least_vote_num = vote_sum // (4 * M)

if len([A for A in As if A > least_vote_num]) >= M:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import numpy as np

[N, M] = list(map(int, input().split()))
A = list(map(int, input().split()))
threshold = int(np.sum(A) / (4 * M))
#print(threshold)
Th = [a for a in A if a > threshold]
#print(Th)
if len(Th) < M:
  ans = 'No'
else:
  ans = 'Yes'
print(ans)

Submission status: Wrong Answer

Solution code:
n, m = map(int, input().split())
votes = list(map(int, input().split()))
total_votes = sum(votes)
border = total_votes // (4 * m)

count = 0
for a in votes:
    if a < border:
        continue
    count += 1

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def main(n: int, m: int, a: list):
    _sum = sum(a)
    ans = 0

    for i in a:
        if not i <= _sum / (4 * m):
            ans += 1

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

    print("No")


if __name__ == "__main__":
    n, m = map(int, input().split())
    a = list(map(int, input().split()))

    main(n, m, a)

Submission status: Wrong Answer

Solution code:
import bisect as bs

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

count = 0

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

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

Submission status: Wrong Answer

Solution code:
n,m = map(int, input().split())
a = list(map(int, input().split()))
a_sort = sorted(a, reverse=True)
if a_sort[m-1] >= sum(a)// (4*m):
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
n, m = map(int, input().split())
a_lst = []
a_lst = list(map(int, input().split()))
# print()
percent = sum(a_lst) // (4 * m)
cnt = 0
for i in range(n):
    if a_lst[i] > percent:
        cnt += 1
if cnt >= m:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
n, m = map(int,input().split())
A = sorted([i for i in map(int,input().split())])
total = sum(A)
if A[-m] > total/4/m:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
n, m = map(int, input().split())
a = sorted(list(map(int,input().split())))
suma = int(sum(a) / (4 * m))
count = True
#print(a[n - 1])
for i in range(m):
    if a[n - 1 - i] < suma:
        count = False
print("Yes" if count == True else "No")

Submission status: Wrong Answer

Solution code:
n, m = input().strip().split(' ')
n, m = [int(n), int(m)]


array = list(map(int, input().strip().split(' ')))
sum = 0
for i in range(n):
    sum = sum + array[i]

bd = sum // (4*m)

cnt = 0
for i in range(n):
    if array[i] >=  bd:
            cnt = cnt + 1
ans = 'No'
if cnt >= m:
    ans = 'Yes'
print(ans)

Submission status: Wrong Answer

Solution code:
n,m=map(int,input().split())
a=list(map(int,input().split()))
a.sort(reverse=True)
count=0
for i in range(m):
    if a[i]>=1/4*m:
        count+=1
if count==m:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
N,M = list(map(int, input().split()))
A = [int(x) for x in input().split()]

total = sum(A)
count = 0 

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

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

Submission status: Wrong Answer

Solution code:
#python3
from math import ceil
def main():
    n, m = map(int, input().split())
    a = [int(i) for i in input().split()]
    c = 0
    s = sum(a)
    x = (s+1)//(4*m)
    for i in range(n):
        if x <= a[i]:
            c += 1

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

Submission status: Wrong Answer

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

# print(n, m)
# print(a)

a.sort(reverse=True)
# print(a)

last = a[m-1]
# print(last)
total = sum(a)

if (last > (total / (4 * m))):
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

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

all = sum(list(A))
p = 1/(4*M)*all
cnt = 0

for i in A:
  if i > p:
    cnt += 1

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

Submission status: Wrong Answer

Solution code:
N,M = map(int,input().split())
li = list(map(int,input().split()))
x = sum(li) * 1/(4*M)
li.sort(reverse=True)

l = [i for i in li if i > x]
if M >= len(l):
    print("No")
else:
    print("Yes")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n, m = map(int, input().split())
lst = list(map(int, input().split()))
lst.sort(reverse=True)
ans = 0
sm = sum(lst)

for i in range(n):
    a = lst[i]
    if a >= sm * (1 / (4 * m)):
        ans += 1
    else:
        break

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

Submission status: Wrong Answer

Solution code:
n,m = map(int,input().split())

a = [ int(x) for x in input().split()]
limit = sum(a)//(4*m)

b = [ x>=limit for x in a]
if(len(b)<m):
  	print('No')
else:
  	print('Yes')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N, M = [int(i) for i in input().split()]
Ai = [int(i) for i in input().split()]

min_voted_num = 1 / (4 * M) * sum(Ai)
num_selected = sum(A > min_voted_num for A in Ai)
if num_selected >= M:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
f=lambda:map(int,input().split())
_,m=f()
l=sorted(list(f()))
print(['No','Yes'][l[-m]>=sum(l)//(4*m)])

Submission status: Wrong Answer

Solution code:
N,M = map(int, input().split())
A_list = list(map(int, input().split()))
count = 0
a_total = sum(A_list)
for A in A_list:
    if(A > a_total/(4*M)):
        count += 1
print("Yes" if(M <= count) else "No")

Submission status: Wrong Answer

Solution code:
n, m = map(int, input().split())
votes = list(map(int, input().split()))
vote_total = sum(votes)
base_4m = vote_total / (4 * m)
over4m_count = 0

for i in votes:
    if i > base_4m:
        over4m_count += 1

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

Submission status: Wrong Answer

Solution code:
import numpy as np
n, m = map(int, input().split(" "))
arr = list(map(int, input().split(" ")))
arr = np.array(arr)

s = np.sum(arr)
choosable = len(np.where(4*m*arr >= s))
if m > choosable:
    print('No')
else:
    print('Yes')

Submission status: Wrong Answer

Solution code:
n,m = input().split(" ")
n=int(n)
m=int(m)
arr = list(map(int,input().split(" ")))

x = sum(arr)

frac = x//(m*4)

ans=0

for i in range(len(arr)):
    if(arr[i]>=frac):
        ans+=1
    
if(ans>=m):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-

###
# main
if(__name__ == '__main__'):
    # input
    n, m = map(int, input().split(" "))
    a_arr = list(map(int, input().split(" ")))

    sum = 0
    for a in a_arr:
        sum += a
    threshold = sum / (4*m)

    a_arr.sort()

    print(a_arr[n-m])
    if a_arr[n-m] < threshold:
        print("No")
    else:
        print("Yes")

# else:
    # do nothing

Submission status: Wrong Answer

Solution code:
N,M=map(int,input().split())
A=list(map(int,input().split()))
ans='No'
sum=0
b=1/(4*M)
c=0
for i in range(N):
  c+=A[i]
d=c*b
for i in range(N):
  if int(d)<A[i]:
    sum=sum+1
  if sum==M:
    ans='Yes'
print(ans)

Submission status: Wrong Answer

Solution code:
N,M=map(int,input().split())
Z=[int(_) for _ in input().split()]
V=sum(Z)
sorted(Z,reverse=True)
rat=float(1/(4*M))
cnt=0
for i in range(N):
  if float(Z[i]/V)<rat:
    break
  else:
    cnt+=1
if cnt>=M:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
def main():
    N,M = map(int,input().split())
    A = list(map(int,input().split()))
    G = sum(A)
    i = 0
    while i < M:
        if A[i] / G < 1 / 4 * M:
            return "No"
            break
        i += 1
    return "Yes"
print(main())

Submission status: Wrong Answer

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