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')
        exit()
print('No')

Submission status: Wrong Answer

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

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

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

print(flag)

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 > int(sum_p):
        count += count + 1
if M <= count:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
import numpy as np
tmp = list(map(int, input().split()))
num = list(map(int, input().split()))

count = 0
b = sum(num)/(4*tmp[1])
for i in num:
    if i>b:
        count+=1
        
if tmp[1]<=count:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:

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

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

count = 0
for i in range(len(second_input)):
    if second_input[i]>=criteria:
        count = count+1
        continue
    else:
        if count >= first_input[1]+1:
            print("Yes")
        else:
            print("No")
        break

Submission status: Wrong Answer

Solution code:
N,M = map(int,input().split())
a = list(map(int,input().split()))
a.sort(reverse=True)
s = 0
for i in range(N):
    s += a[i]
border = s/4*M
if a[M-1] < border:
    print('No')
else:
    print('Yes')

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
N, M = map(int, input().split())
A = input().split()
A = [int(x) for x in A]
A.sort(reverse=True)
A = [A[x] for x in range(M)]
for i in range(M):
      if A[i]<sum(A)/(4*M):
            print("No")
            exit()
print("Yes")

Submission status: Wrong Answer

Solution code:
a,b = map(int,input().split())
List=[int(i) for i in input().split()]
c = 1//(4*b)
d = 0
for i in range(a):
    if List[i] > c:
        d += 1
if d >= b:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
N,M=list(map(int, input().split()))
A=list(map(int, input().split()))
S=sum(A)
C=S/(4.0*M)
cnt=sum(map(lambda x:x>=C,A))
print(cnt)

Submission status: Wrong Answer

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

flg = True

soutouhyou = int(sum(a) * (1 / (4 * M)))

count = 0

for num in list(range(M)):
    if a[num] >= soutouhyou:
        count += 1

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

Submission status: Wrong Answer

Solution code:
n,m=map(int,input().split())
lista=list(map(int,input().split()))
listb=sorted(lista)
m1=0
for i in lista:
	m1+=i
#print(m1)
min1=(m1/(4*m))
count=0
for i in listb:
	if(i>=min1):
		count+=1
#print(count)
if(count>=m):
	print("YES")
else:
	print("NO")

Submission status: Wrong Answer

Solution code:

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

Submission status: Wrong Answer

Solution code:
cnt, pick_cnt = map(int, raw_input().split())
targets = map(int, raw_input().split())

limit = sum(targets) / (4 * pick_cnt)

n = 0
for target in targets:
    if target >= limit:
        n += 1
    if n >= pick_cnt:
        print 'Yes'
        break
else:
    print 'No'

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

A_sum =sum(A)

ans = 0
for i in range(N):
    if A[i] > int(A_sum/(4*M)):
        ans += 1
if ans >= M:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
N,M=map(int,input().split())
List=list(map(int,input().split()))
Lists=list()
for i in List:
    if i/sum(List)>1/4*M:
        Lists.append(i)
        continue
print("Yes" if len(Lists)>=M else "No")

Submission status: Wrong Answer

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

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

a = sum(x>float(sum(List)/(4*m)) for x in List)
print("Yes" if a >= m else "No")

Submission status: Wrong Answer

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

#総投票数を取得
total = 0 
for i in range(n):
    total += a[i]

deadline = total / (4*m)

#M個選べるのか判定
cnt = 0
for i in range(n):
    if a[i] > deadline:
        cnt += 1

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

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[:m] > (total / (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()))

t = 0
check=False
if(1<=m<=n<100 and n==len(a)):
  check=True
  for i in range(len(a)):
    if(1<=a[i]<=1000):
      t += a[i]
    else:
      check=False
   
  if(check):
    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:
n,m=map(int,input().split())
a=list(map(int,input().split()))
sum=0
for i in range(len(a)):
    sum=sum+a[i]
    
x= (sum)//(4*m)
#print(x)
l=[]
for j in range(len(a)):
    if(a[j]>=x):
        l.append(a[j])
#print(l)        
if(len(l)>=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)
k = total/(4*M)
A_new = sorted(A,reverse=True)
count = 0
for i in range(N):
  if A_new[i] > k:
    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()))
cnt = 0
ans = 0

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

x = cnt // (4*M)

for i in range(N):
  if x <= A[i]:
    ans += 1

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

Submission status: Wrong Answer

Solution code:
# B - Popular Vote
N,M=list(map(int, input().split()))
A=list(map(int, input().split()))

s0 = sum(A)

B = sorted(A,reverse=True)
s = 0
for i in range(M):
    s = s + B[i]

if s0 < 4*M*s:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
N,M = map(int,input().split())
A = list(map(int,input().split()))
K = 0
L = 0
for i in range(N):
  K = K + int(A[i])
j = 0
while L < M and j < N:
  if int(A[j]) >= (K/4*M):
    L = L + 1
  j = j + 1
if L < M:
  print('No')
elif L == M:
  print('Yes')

Submission status: Wrong Answer

Solution code:
N, M = map(int, input().split())
A = list(map(int, input().split()))
if 1 <= M <= N <= 1000 and (1 <= Ai <= 1000 for Ai in 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")

Submission status: Wrong Answer

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



temp=4*m
temp=suml/temp

flag=False

for i in range(n):
    if m==0:
        flag=True
        break
    else:
        if l[i]>temp:
##            print(l[i],temp)
            m-=1

if flag:
    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 A:
    if i>sum(A)//(4*M):
        cnt+=1
        
if cnt>=M:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
n,m = map(int, input().split())
l = list(map(int, input().split()))
limit = sum(l)//4*m
l.sort(reverse=True)
if l[m-1] < limit:
    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.sort(reverse = True)
l_sum = sum(l)
cnt = 0
 
for i in range(N):
    if l[i] > (1/(4*M))*l_sum:
        cnt += 1
    else:
        break
 
if cnt >= M:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
a,b = map(int,input().split())
List=[int(i) for i in input().split()]
c = sum(List)//4
d = 0
for i in range(a):
    if List[i] > c:
        d += 1
if d >= b:
    print("Yes")
else:
    print("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())
list=[int(i) for i in input().split()]

vote = 0

for v in list :
    vote = vote + v

judge = vote // 4 // M

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

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

Submission status: Wrong Answer

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

sumOfA = sum(A)

condition = sumOfA//(4*M)

if(M>N):
    print("No")

flag = 0
for i in A:
    if(i > condition):
        flag += 1 
    else:
        continue
    if(flag>=M):
        print("Yes")
        break
if(flag < M):
    print("No")

Submission status: Wrong Answer

Solution code:
i1 = input()
i2 = input()

# i1 = "4 1"
# i2 = "5 4 2 1"
list1 = [int(s) for s in i1.split()]
list2 = [int(s) for s in i2.split()]

n = list1[0]
m = list1[1]


total = sum(list2)

# 選べる
count = 0

for a in range(m):
    if (list2[a]/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()))

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

Submission status: Wrong Answer

Solution code:
url = "https://atcoder.jp/contests/abc161/tasks/abc161_b"

def main():
    n, m = list(map(int, input().split()))
    n_li = list(map(int, input().split()))
    n_li = sorted(n_li, reverse=True)
    all = sum(n_li)
    for i in range(1, m + 1):
        if all // (4 * m) >= n_li[i - 1]:
            print('No')
            exit()
    print('Yes')


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
N, M = map(int, input().split())
A = list(map(int, input().split()))  # [1, 2, 3, 4] になる

sum = sum(A)
def check(M,A,N):
    for a in range(M):
        num = A.pop(A.index(max(A)))
        if num > (sum/(4*M)):
            continue
        else:
            return 'No'
    return 'Yes'

print(check(M,A,N))

Submission status: Wrong Answer

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

val = sum(A)
for i in range(N):
    M_val = val - A[i]
    if M_val < val/(4*M):
        print("No")
        break
    else:
        continue
    break
else:
    print("Yes")

Submission status: Wrong Answer

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

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

sum_A = sum(A) 

pop = int(sum_A / (4 * M))

count_pop = len([i for i in A if i >= pop])

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

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
flag=False
for i in range(len(arr)):
    if(arr[i]>=frac):
        ans+=1
    if(ans>=m):
        print("Yes")
        flag=True
        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)
 
count=0
for x in a:
  	if(x>=limit):
      			count+=1
if(count<=m):
  	print('No')
else:
  	print('Yes')

Submission status: Wrong Answer

Solution code:
import math
import sys

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

a = input().split()
l_si_i = [int(b) for b in a]
#print(l_si_i)

#print(max(l_si_i))
#print(sum(l_si_i))

#border = math.floor(sum(l_si_i) / (4 * m))
border = sum(l_si_i) / (4 * m)
#print(border)

check = 0
for i in range(n):
  c = l_si_i[i]
  if c > border:
    check += 1
    
  if check >= m:
    print("Yes")
    sys.exit()
    
print("No")

Submission status: Wrong Answer

Solution code:
n,m = map(int,input().split())
lis = input().split()
lis = [int(i) for i in lis]
s = sum(lis)
ans = 0


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


if ans >= 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)
l=sorted(l)
for i in range(m):
    if l[i]*4*m<lm:
        print("No")
        exit()
print("Yes")

Submission status: Wrong Answer

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

sum_a = sum(a)

for i in range(m):
    if a[i] >= int(sum_a/(4*m)):
        continue
    else:
        print('No')
        exit()

print('Yes')

Submission status: Wrong Answer

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

#print(n,m,l,total)

y = 0
for i in range(n):
    if total //(4*m) == total /(4*m):
        l[i] >= total //(4*m)
        y += 1
    else:
        l[i] > total //(4*m)
        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()))
total = sum(A)
k = total/(4*M)
A_new = sorted(A,reverse=True)

for i in range(N):
  if A_new[i] <= k:
    if i+1 > M:
      print("Yes")
      break
    else:
      print("No")
      break
  else:
    if i+1 == N:
      print("Yes")

Submission status: Wrong Answer

Solution code:
n, m = map(int, input().split())
A = sorted(list(map(int, input().split())), reverse=True)
cnt = 0
for a in A:
    if 4*m*a > sum(A):
        cnt += 1
if cnt < m:
    print('No')
else:
    print('Yes')

Submission status: Wrong Answer

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

if a[M-1] < sum(a)/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()))
S=sum(a)
a.sort()
print(S/4*M)
print(a)
if a[N-M] >= S/4*M:
  print('Yes')
else:
  print('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*4*m > t:
    s+=1

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

Submission status: Wrong Answer

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

flg = True

soutouhyou = int(sum(a) * (1 / (4 * M)))

for num in list(range(M)):
    if a[num] < soutouhyou:
        flg = False
        break
    if num + 1 == N:
        break

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N, M = [int(e) for e in input().split()]
A = sorted([int(e) for e in input().split()])
A.reverse()


base =float(sum(A)) / 4.0*M
cond = all([float(e) >= base for e in A[:M]])
ans = 'Yes' if cond  else 'No'
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def main():
  
  n,m = map(int, input().split())
  A = sorted([int(x) for x in input().split()],reverse=True)
  
  sum = 0
  for a in A:
    sum += a
   
  if(A[m-1]>a/(4*m)):
    print("Yes")
  else:
    print("No")
  return 0
 
if __name__ == "__main__":
  main()

Submission status: Wrong Answer

Solution code:
tmp = list(map(int, input().split()))
num = list(map(int, input().split()))

count = 0
b = sum(num)//(4*tmp[1])
for i in num:
    if i>b:
        count+=1
        
if tmp[1]<=count:
    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()
S = sum(A)
         
if 1/(4*M) <= A[N-M]/S :
	print("YES")
else:
	print("NO")

Submission status: Wrong Answer

Solution code:
N,M=map(int,input().split())
A=[int(b) for b in input().split()]
cnt=0
ans=sum(A)//(4*M)
#print(ans)

for i in range(N):
  if A[i] >=ans:
    cnt+=1
#print(cnt)

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

Submission status: Wrong Answer

Solution code:

n,m = map(int,input().split())
lis = input().split()
lis = [int(i) for i in lis]
s = sum(lis)
ans = 0


for i in range(n):
    if lis[i] > s*(1/(4*m)):
        ans += 1
        print(0)


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

Submission status: Wrong Answer

Solution code:
import math


n, m = map(int, input().split())
ls = list(map(int, input().split()))
ls.sort(reverse=True)
gk = sum(ls)
hikaku = math.ceil(gk/(4*n)) 

if hikaku <int(ls[m-1]):
  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)
 
count=0
for x in a:
  	if(x>=limit):
      			count+=1
if(count<m):
  	print('No')
else:
  	print('Yes')

Submission status: Wrong Answer

Solution code:
m = input()
a = list(input())
x = int(0)

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

list.sort(a, reverse = True)

for i in range(int(n)+ 1, len(a), -1):
    print(a[i])
    x += int(a[i])

for i in range(int(m)):
    if int(a[m]) < 4 * int(m):
        print('No')
        exit()

print('Yes')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N, M, *A = map(int, open(0).read().split())
vote = sum(A) / (4*M)
num = list(filter(lambda x: x > vote, A))
num = len(num)
if num >= M:
	print("Yes")
else:
	print("No")

Submission status: Wrong Answer

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

a = sorted(A, reverse=True)

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

t = 0
check=False
if(1<=m<=n<100):
  check=True
  for i in range(len(a)):
    if(1<=a[i]<=1000):
      t += a[i]
    else:
      check=False
   
  if(check):
    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:
n, m = map(int, input().split())
a = list(map(int, input().split()))
a.sort(reverse=True)

sum_a = sum(a)

for i in range(m):
    if a[i] > int(sum_a/(4*m)):
        continue
    else:
        print('No')
        exit()

print('Yes')

Submission status: Wrong Answer

Solution code:
def num():
    n,m=map(int,input().split())
    a=list(map(int,input().split()))
    # a=sorted(a,reverse=True)
    for i in range(m):
        if a[i]<sum(a)/4*m:
            print(sum(a)/4*m)
            return "No"
    return "Yes"
print(num())

Submission status: Wrong Answer

Solution code:
n,m= map(int,input().split())
L=list(map(int,input().split()))
print(L)
S=sorted(L,reverse=True)
a=sum(L)
print(S)

if S[m-1] < a/(4*m):
    print("No")
else:
    print("Yes")

Submission status: Wrong Answer

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

N = a[0]
M = a[1]

count = 0
b_sum = sum(b)

for i in range(0,N-1):
    if b[i] >= (b_sum/(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()))

S = sum(A)

f = S / (4 * M)

A.sort(reverse=True)

flag = 0

for i in range(M):
  if A[i] > f:
    pass
  else:
    flag = 1
    break

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

Submission status: Wrong Answer

Solution code:
N, M = map(int, input().split())
A = sorted(list(map(int, input().split())))
ans = sum(x < sum(A) // 4 // M for x in A)
if N-ans >= M:
    print('Yes')
elif N-ans<M:
    print('No')

Submission status: Wrong Answer

Solution code:
from bisect import bisect

n, m = input().split()
l = sorted(list(map(int, input().split())))
sum_touhyou = sum(l)
line_touhyou = sum_touhyou * (1 / (int(m) * 4))
index = bisect(l, line_touhyou)
if len(l[index:]) >= int(m):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

length = len(A)

for idx in range(len(A)):
    if A[idx] < sum(A)/(4*M):
        length -= 1
        
ans = 'Yes' if length>=2 else 'No'
print(ans)

Submission status: Wrong Answer

Solution code:
n, m = map(int, input().split())
nums = list(map(int, input().split(" ")))
if (nums[m-1]/sum(nums) >= 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()))
choicable = list(map(lambda x:True if x>sum(a)/(4*m) else False,a))
print('Yes' if sum(choicable) >= m else '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 * (1 // (4 * M))):
        count += 1

if  M > 0 and 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()))

sumOfA = sum(A)

condition = sumOfA//(4*M)


flag = 0
for i in A:
    if(i > condition):
        flag += 1 
    else:
        continue
    if(flag>=M):
        print("Yes")
        break
if(flag < M):
    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*m)]

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

Submission status: Wrong Answer

Solution code:
N, M = map(int, input().split())
lists, count, error = [int(x) for x in input().split()], 0, 0
for x in lists:
    if x < ((1 / (4 * M)) * sum(lists)):
        count += 1
print('Yes' if count >= M else '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 = sum / (4 * M)

i = 0
while i != M:
    if A[i] <= vote:
        print("No")
        break
    i += 1
    if i == M:
        print("Yes")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

a.sort(reverse=True)
vote = sum(a)
for i in range(m):
    if a[i] < vote // (4 * m):
        print('No')
        exit()
print('Yes')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N,M = (int(x) for x in input().split())
A_list = [int(x) for x in input().split()]
A_sum = sum(A_list)
Bool_list = []
for A in A_list:
    if A >= A_sum/(N*M):
        Bool_list.append("True")
        
if (len(Bool_list)) >= 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(reverse=True)
if a[m-1]<=sum(a)//(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()))

list.sort(a, reverse=True)

ans = "No"

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

Submission status: Wrong Answer

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

sumOfA = sum(A)

condition = sumOfA//(4*M)


flag = 0
for i in A:
    if(i > condition):
        flag += 1 
    else:
        continue
    if(flag==M):
        print("Yes")
        break
if(flag < M):
    print("No")

Submission status: Wrong Answer

Solution code:
N,M=list(map(int, input().split()))
A=list(map(int, input().split()))
S=sum(A)
C=S/(4.0*M)
cnt=sum(map(lambda x:x>=C,A))

Submission status: Wrong Answer

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

ans = 0
for i in range(N):
    if A[i] > int(A_sum/14*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()))
ans = 0
total = 0

for i in range(len(A)):
    total += A[i]

A = sorted(A, reverse=True)

for i in range(M):
    if(A[i] >= total/4*M):
        ans = 1
    else:
        ans = 0
if(ans == 1):
    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 math


n, m = map(int, input().split())
ls = list(map(int, input().split()))
ls.sort(reverse=True)
gk = sum(ls)
hikaku = math.ceil(gk/(4*n)) 

if hikaku <=int(ls[m-1]):
  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*m)]

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

Submission status: Wrong Answer

Solution code:
in_ = input()
n, m = map(int, in_.split())
in_ = input()
a = map(int, in_.split())
a = sorted(a, reverse=True)
mm = int(sum(a) / (4. * m) + 0.5)
if a[m-1] >= mm:
    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)

list.sort(a,reverse=True)
judge = 1

for i in range(m):
    if a[i]<= a_sum*1/(m*4):
        judge = 0
        break

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