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:
from collections import defaultdict, deque
import sys
import heapq
import bisect
import itertools
import queue
import copy
import time
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7

def inp(): return int(sys.stdin.readline())

def inpl(): return list(map(int, sys.stdin.readline().split()))

def inpl_str(): return list(sys.stdin.readline().split())

n, m = inpl()
a = inpl()
s = sum(a)
cnt = 0
for i in a:
        if i > s//(4*m):
            cnt += 1
if cnt >= m:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
from bisect import bisect

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

#print(M)
A.sort()
#print(A)

limit = sum(A)/(4*M)
#print(limit)

n = bisect(A, limit)
if N-n > M:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
import numpy as np
N, M = map(int, input().split())
count = 0
nums = [int(x.strip()) for x in input().split(' ')]
num_sum = sum(nums)
tmp = num_sum/(4*M)
for num in nums:
  if num >tmp:
    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())
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")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
NM = list(map(int, input().split()))
N = NM[0]
M = NM[1]
vote = list(map(int, input().split()))
vote.sort()
voteSum = 0
for j in vote:
    voteSum += j
if vote[-M]/voteSum > 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()))
A.sort()
B=A[::-1]
if B[m-1]>=sum(A)//(4*m):
    print("Yes")
else:
    print("No")

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:
n,m = map(int,input().split())
line = sorted(list(map(int,input().split())),reverse = True)
sums = sum(line)
if sums % (4*m) != 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())
tmp = input()
a = tmp.split()
a = list(map(int,a))

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())
points = [i for i in map(int, input().split())]

sumValue = sum(points)

candidates = [i for i in points if i > (sumValue/4)]

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

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(a_sum*m/4)
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:
N,M = map(int,input().split())

A = list(map(int,input().split()))
su = sum(A)
A.sort(reverse=True)

cnt = 0
for i in A:
  if (i > int(su / 4 / M)):
    cnt += 1
if (cnt >= M):
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

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

a = 0
for i in A:
    a += int(i)
A_i = [int(s) for s in A]
A_i.sort()

x = 0
for j in range(M):
    if int(A_i[-1-j]) >= int(a/(4*M)):
        x += 1
    else:
        pass

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

Submission status: Wrong Answer

Solution code:
m,n=map(int,input().split())
l=list(map(int,input().strip().split()))
x=sum(l)
y=m+n
if(y<((1/(4*m))*x)):
    print("No")
else:
    print("Yes")

Submission status: Wrong Answer

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

s = input().split(" ")
sum = 0
for i in range(N):
    sum += int(s[i])

yes = True

for i in range(M):
    if int(s[i]) < sum / 4:
        yes = False
if yes:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

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

if ans > 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()
total = 0
for i in a:
  total += i
ok = 0
for i in range(1, m + 1):
  if a[-i] > total / (4 * m):
    ok += 1

if ok != m:
  print("No")
else:
  print("Yes")

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

Submission status: Wrong Answer

Solution code:
# N種類の商品
# i 商品
# 得票数はA[i]
# 人気商品をM個えらぶ
# 得票数の1/4 * 　M未満はNo それ以外はYes

N, M = map(int, input().split())
listA = list(map(int, input().split()))
i = len(listA)
tokuhyousuu = sum(listA)
ninnkiList = [i for i in listA if i > tokuhyousuu / (4 * M)]
if len(ninnkiList) >= M:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
import sys
import os

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    N, M = il()
    A = il()
    sm = sum(A)
    mi = sm * (0.25 * 1/M)
    cnt = 0

    for a in A:
        if a > mi: cnt += 1

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


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import sys

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

l = [int(x) for x in input().split()]

cnt = 0
for i in l:
    if i < int(sum(l)*1/(4*m)):
        cnt += 1
    if cnt > len(l)-m:
        print("No")
        sys.exit()

print("Yes")

Submission status: Wrong Answer

Solution code:
n,m=map(int,input().split())
a=list(map(int, input().split()))
num=sum(a)
tmp=float(num)/float(4.0*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=(int(x) for x in input().split())
A = list(map(int, input().split()))
count=0
sum=0

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

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

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

Submission status: Wrong Answer

Solution code:
N, M = map(int, input().split(' '))
A = [int(a) for a in input().split(' ')]
S = sum(A)
thre = S / (4 * M)
print(thre)

cnt = 0
for a in A:
    if a >= thre:
        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()))
  A = sorted(A,reverse=True)

  counter = 0

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

  if counter == M:
    print('Yes')
  else:
    print('No')


if __name__ == "__main__":
  main()

Submission status: Wrong Answer

Solution code:
import numpy as np

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

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

an = np.array(sorted(an, reverse=True))

total = sum(an)

if sum((an / total)[:m] > (1 / (4 * m))) >= m:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
n, m = map(int, input().split())
a = list(map(int, input().split()))
total = sum(a)
minimum = 1.0/ (4 * m)
total_percent = list(map(lambda x:x/(sum(a)), a))
choicable = list(map(lambda x:True if x>minimum else False,total_percent))
print('Yes' if sum(choicable) >= m else 'No')

Submission status: Wrong Answer

Solution code:
N, M = map(int, input().split())
l = input().split()
l = [int(i) for i in l]  
l.sort(reverse=True)
val = sum(l)
deadline = val//(4*M)
if l[M-1] >= deadline:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
n, m = map(int,input().split())
l = list(map(int,input().split()))
total = sum(l)
x = total /(4*m) 

#print(n,m,l,total)

y = 0
for i in range(n):
    if l[i] > x:
        y += 1
        
if y >= 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)
total=sum(A)
total=total//(4*M)
if total<=A[M-1]:
    result='Yes'
else:
    result='No'

print(result)

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()
A.reverse()
print(A)
th=sum(A)/M/4
flag=True
for i in range(M):
    if(A[i]<th):
        flag=False

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

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]
    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')

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)

l = al[n-m:]

if l[0] > total/(4*m):
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

total = sum([1 for a in A if a/N>=1/(4*M)])
print('Yes' if total >=M else 'No')

Submission status: Wrong Answer

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

count = 0

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

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

Submission status: Wrong Answer

Solution code:
n,m = map(int,input().split(' '))
aa = list(map(int, input().split(' ')))
A = sorted(aa, reverse=True)
Am = A[:m]
for a in Am:
    if a>(0.25/m)*sum(aa): continue
    else:
         print('No')
         exit(0)
print('Yes')

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-1):
    if a[i]>=1/4*m:
        count+=1
if count==m:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
in1 = input().split()
in1num = [int(x) for x in in1]
a = input().split()
anum = [int(x) for x in a]
sum_a = sum(anum)
anum.sort(reverse=True)

N = in1num[0]
M = in1num[1]

#print(sum_a)
#print((sum_a)/(4*M))
#print(anum[M-1])

if anum[M-1] > (sum_a)/(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()))
sum_a = sum(a)

# print(n)
# print(m)

# print(sum_a)
# print(sum_a // n)

count = 0
for aa in a:
    # print(aa)
    if aa >= sum_a // n:
        count += 1
        
# print(count)
if count >= m:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

max = 0
for ai in a:
  max += int(ai)

ss = max / (4 * m)

rs = 0
for ai in a:
  if int(ai) > ss:
  	rs += 1

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

Submission status: Wrong Answer

Solution code:
#coding:utf-8

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)
count = 0

for i in range(0, n):
    if rank[i] > border:
        count += 1

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

Submission status: Wrong Answer

Solution code:
import sys
import copy
import math
import bisect
import pprint
import bisect
from functools import reduce
from copy import deepcopy
from collections import deque
from decimal import *


def lcm(x, y):
    return (x * y) // math.gcd(x, y)


if __name__ == '__main__':
    b, c = map(int, input().split())

    a = [int(i) for i in input().split()]
    t = sum(a)
    a.sort(reverse=True)
    count = 0
    for i in range(c):
        if a[i] / t >= i / (4 * (i + 1)):
            count += 1
    if count == c:
        print("Yes")
    else:
        print("No")

Submission status: Wrong Answer

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

    v_sum = sum(votes)

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

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

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



if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

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

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

A.sort(reverse = True)

YN = True
for i in range(M):
    if A[i] < A_sum / 4 * M:
        YN = False

if YN == True:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
n,m = map(int, input().split())
a = list(map(int, input().split()))
flag = False
allVote = sum(a)
a.sort()
counter = 0

for i in range(n):
  if allVote/4 > a[i]:
    counter +=1 
  else:
    break

if counter > m:
  flag = True

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

Submission status: Wrong Answer

Solution code:
n,m = map(int,input().split())
a = [int(x) for x in input().split()]
ans = 'Yes'
list.sort(a, reverse=True)
for i in range(m):
  if a[i]/sum(a) <= 1/(4*m):
    ans = 'No'
print(ans)

Submission status: Wrong Answer

Solution code:

def resolve():
    N, M = map(int, input().split())
    A = sorted(map(int, input().split()), reverse=True)
    ok_line = sum(A)//(4*M)
    cnt = 0
    for a in A:
        if ok_line < a:
            cnt += 1
    ans = cnt if M <= cnt else -1
    return print("Yes" if ans >= 0 else "No")

if __name__ == "__main__":
    resolve()

Submission status: Wrong Answer

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

count=0
s=0

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

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

Submission status: Wrong Answer

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

votes = input().split(" ")
votes = [int(vote) for vote in votes]
votes.sort(reverse=True)

check_vote = votes[m-1]

if check_vote >= sum(votes) / n:
    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()
a.reverse()
_sum = sum(a)
ans = "Yes" if a[m - 1] > _sum / (4 * m) else "No"
print(ans)

Submission status: Wrong Answer

Solution code:

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

count = 0

for i in range(N):
    bool_over = a[i] > (1/(4*M))
    if(bool_over):
        count +=1

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

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
import numpy as np
N, M = map(int, input().split())
count = 0
nums = [int(x.strip()) for x in input().split(' ')]
num_sum = sum(nums)
tmp = num_sum/(4*M)
for num in nums:
  if num >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 ()))

votesum = (sum(A))

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

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:
N,M=map(int,input().split())
A=[input().split() for i in range(1)]

all=0
for i in range(N):
    all+=int(A[0][i])
FLAG=int(1/(4*M)*all)
flag=0

for i in range(N):
    if FLAG>int(A[0][i]):
        flag+=1
if flag==0:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:


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

for i in a:
    if i > sum(a) // (4 * m):
        l.append(i)

if len(l) >= m:
    print('Yes')

else:
    print('No')

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:
N, M = map(int, input().split())
li = [int(p) for p in list(input().split())]
total=sum(li)
count=0
for l in li:
    if l > total*0.25/M:
        count+=1
    else:
        pass
if count >= M:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
# coding: utf-8
 
a=list(map(int,input().split()))
#読み込み
N = a[0]
M = a[1]

b=list(map(int,input().split()))
#総得票数
Sum_vote = sum(b)
list.sort(b, reverse=True)
 
if b[M-1] < (Sum_vote / 4 * M):
    print("No")
else :
    print("Yes")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n,m = input().split(" ")
alist = input().split(" ")

n = int(n)
m = int(m)

sum = 0
for i in alist:
    sum += int(i)

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

c = 0

for k in alist:
    if int(k) > l:
        c += 1

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

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

count = 0

get = sum(list_N)/(4*M)

for i in range(N):
    if list_N[i] > get:
        count += 1

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

Submission status: Wrong Answer

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

H = sum(AList)/(4*M)

S =0

for A in AList:
  if A> H:
    S = S + 1

if S >= 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(sum(a)/(4*m))
if a[m-1] < num:
  print('No')
else:
  print('Yes')

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
def getInput():
    return [int(i) for i in input().rstrip().split(' ')]

N, M = getInput()
A = getInput()
_4M = int(sum(A) * (1/(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')

Submission status: Wrong Answer

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

count = 0
allpoint = 0

for i in A:
    allpoint += i

for i in A:
    if i >= allpoint // (4 * M) >= 0:
        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()))

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 = map(int,input().split())
A = list(map(int,input().split()))
m = 0
s = sum(A)
for i in range(N):
  if A[i] < s//(4*M):
    pass
  else:
    m += 1

if m >= 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
for i in a:
    sum+=i
ans=0
for i in a:
    if i*4*m>sum:
        ans+=1
if ans>=m:
    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.0*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())
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 sys
N,M = map(int, input().split())
A = list(map(int, input().split()))
sorted_A = sorted(A, reverse=True) 
all_A = sum(A)

rule = (1/(4*M))

ans = 0

for i in sorted_A:
    if (i/all_A) > rule:
        ans = ans + 1
    if ans >= M:
        print("Yes")
        sys.exit()

print("No")

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]

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3

def main():
    N,M = map(int, input().split())
    votes = [int(s) for s in input().split()]
    votes_sum = sum(votes)
    border_line = votes_sum / (4*M)

    result = 'Yes'
    votes.sort(reverse=True)
    for i in range(M):
        if votes[i] <= border_line:
            result = 'No'
            break

    print(result)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
import sys
#sys.setrecursionlimit(150000)

#def my_index_multi(l, x):
#    return [i for i, _x in enumerate(l) if _x == x]

YES = "Yes"  # type: str
NO = "No"  # type: str


def solve(N: int, M: int, A: "List[int]"):
    A=sorted(A,reverse=True)
    sa=sum(A)
    if N==1:
        print(YES)
    else:
        print(YES if -(-sa//(4*M))<A[M-1] else NO)

    return


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    M = int(next(tokens))  # type: int
    A = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    solve(N, M, A)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
n,m=map(int,input().split())
List=list(map(int,input().split()))
count=0
total=0
for i in List:
    total=total+i

for i in List:
    if i>=total/m/4:
        count=count+1
    else:
        count=count+0

if count>=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)
lim=(votes+1)//(4*m)
m_arr= [i for i in arr if i>= lim]
if len(m_arr)>=m:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
import numpy as np

input_str = input()
N, M = list(map(lambda x: int(x), input_str.split(' ')))

input_str = input()
input_list = np.array(list(map(lambda x: int(x), input_str.split(' '))))

A_sum = np.sum(input_list)

count = np.count_nonzero(input_list > A_sum / (4*M))

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

Submission status: Wrong Answer

Solution code:
N,M = map(int,input().split())
A = list(map(int,input().split()))
S = sum(A)
ans = [i for i in A if i > S / (4*M)] 
if len(ans) >= 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_sum = sum(A)
ans = 0
for i in range(n):
    if float(A[i]) > a_sum/(4*m):
        ans += 1


if ans >= 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] >= t//(4*m):
		c += 1

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

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!
n,m= list(map(int,input().split()))
A = list(map(int,input().split()))
d = sum(A)
    
A.sort(reverse=True)
for a in range(m):
    if A[a]<= d//(4*m):
        d = 0
        break
if d == 0:print("No")
else: print("Yes")

Submission status: Wrong Answer

Solution code:
line1 = input().rstrip().split(" ")
N = int(line1[0])
M = int(line1[1])
allvote = 0
ok = 0

line = input().rstrip().split(" ")
for i in range(N):
    get = int(line[i])
    allvote += get

for j  in range(N):
    get = int(line[j])
    worse = int(1 / (4 * M) * allvote)
    if get < worse:
        pass
    else:
        ok += 1

if ok >= 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()]
ans = 'Yes'
list.sort(a, reverse=True)
#print(a)
for i in range(m):
  #print(a[i]/sum(a),1/(4*m))
  if a[i]/sum(a) <= 1/(4*m):
    ans = 'No'
    break
print(ans)

Submission status: Wrong Answer

Solution code:


n, m = [0] * 2
a = []

def format_input(filename = None):
	global n, m
	global a
	if filename == None:
		n, m = list(map(int, input().split()))
		a = list(map(int, input().split()))

	elif filename == '__random__':
		from random import randint as rng
		n = rng(1, 10**2)
		m = rng(1, n)
		a = [rng(1, 10**3) for i in range(n)]
		print(n, m)
		print(' '.join(list(map(str, a))))

def get_answer():
	sorted_a = sorted(a)
	if sorted_a[-m] > sum(a) // (4 * m):
		answer = 'Yes'
	else:
		answer = 'No'
	return answer

if __name__ == '__main__':
	format_input()

	ans = get_answer()
	print(ans)

Submission status: Wrong Answer

Solution code:
from collections import defaultdict, deque
import sys
import heapq
import bisect
import itertools
import queue
import copy
import time
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7

def inp(): return int(sys.stdin.readline())

def inpl(): return list(map(int, sys.stdin.readline().split()))

def inpl_str(): return list(sys.stdin.readline().split())

n, m = inpl()
a = inpl()
s = sum(a)
for i in a:
        if i < s//(4*m):
            print('No')
            exit()
print('Yes')