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 sys import stdin

input = stdin.readline

n, m = map(int, input().split())
a = [int(x) for x in input().split()]
vote = sum(a) / 4 / m

a.sort()
a.reverse()

print("Yes" if a[m - 1] > vote else "No")

Submission status: Wrong Answer

Solution code:
N, M = map(int, input().split())
A = list(map(int, input().split()))
boder = sum(A) / (4 * M)
counter = 0
for i in A:
    if i > boder:
        counter += 1
if counter > 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_sum = sum(A_list)
cnt = 0
for i in range(N):
  if A_list[i] >= A_sum*(1/4*M):
    cnt += 1
if cnt >= M:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
n,m = map(int,input().split()) #n種類　M個えらぶ
a = list(map(int,input().split()))
sum_list = sum(a)

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

Submission status: Wrong Answer

Solution code:
n,m = map(int,input().split())
a = list(map(int,input().split()))
a = sorted(a,reverse=True)
t = sum(a) // (4 * m)

for i in range(m):
    if a[i] < t:
        print('No')
        exit(0)
print('Yes')

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

Submission status: Wrong Answer

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

thr = sum(a) / (4 * m)

cnt = 0
for val in a:
    if val > thr:
        cnt += 1

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
nm=list(map(int,input().split(' ')))
a=list(map(int,input().split(' ')))
c=0
for i in a:
    if i>=1/(4*nm[1]):
        c+=1
if c>=nm[1]:
    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)
if sorted(A, reverse=True)[M-1] > 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()))

A.sort(reverse=True)
b = sum(A) // (4*m)
if A[m-1] < b:
  print('No')
else:
  print('Yes')

Submission status: Wrong Answer

Solution code:
ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))

n,m = mi()
a = li()

stl = sum(a) / (4*m)
a.sort()
cnt = 0
for i in a[::-1]:
    if i > stl:
        cnt+=1
if cnt >= 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)
if a[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()))
A.sort()
A.reverse()
A_sum = sum(A)
bound = A_sum // (4 * M)

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

Submission status: Wrong Answer

Solution code:
n,m=map(int,input().split())
l=list(map(int,input().split()))
l.sort()
if l[0-m]>=sum(l)//(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(reverse=True)

sum_a = sum(a)

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

print('Yes')

Submission status: Wrong Answer

Solution code:
if __name__ == '__main__':
	N, M = map(int, input().split())
	A = [int(a) for a in input().split()]

	th = sum(A)/4/M

	A.sort(reverse=True)

	print(A)

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

Submission status: Wrong Answer

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

total = sum(arr)

ans =0
for i in arr:
    if (4*m*i)>=total:
        ans+=1

if ans>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()))
A.sort(reverse=True)

t = sum(A) // (4*M)

for i in range(M):
    if A[i] <= t:
        print("No")
        sys.exit()

print("Yes")

Submission status: Wrong Answer

Solution code:
N, M = map(int, input().split())
A = map(int, input().split())
cnt = 0
for a in A:
  if a < M:
    cnt += 1
if M <= cnt:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
n, m = map(int, input().split())
aaa = list(map(int, input().split()))
border = sum(aaa) // 4
selectable = sum(1 for a in aaa if a >= border)
print('Yes' if selectable >= m else 'No')

Submission status: Wrong Answer

Solution code:
n,m = (int(i)for i in input().split())
l = [int(i)for i in input().split()]
l.sort(reverse = True)
lim = sum(l)//(4*m)
cnt=0
for i in range(m):
	if l[i]>=lim:
		cnt+=1
if cnt>=m:print("Yes")
else:print("No")

Submission status: Wrong Answer

Solution code:
def main():
  x, y = map(int, input().split())
  tokuhyou = [int(t) for t in input().split()]
  th = sum(tokuhyou) / (4 * y)
  count = 0
  for i in tokuhyou:
    if i > th:
      count += 1
  if count >= y:
    print('Yes')
  else:
    print('No')
main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N,M=list(map(int,input().split()))
lst=list(map(int,input().split()))
lst.sort()
if lst[M-1]*4*M>sum(lst):
  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)
suma=sum(a)
cnt=0
for i in a:
    #print(i)
    if i>=suma//(4*m):
        cnt+=1
if cnt>=m:print('Yes')
else:print('No')

Submission status: Wrong Answer

Solution code:
from collections import defaultdict, deque
import sys
import heapq
import bisect
import math
import itertools
import string
import queue
import copy
import time
# import numpy as np
from fractions import gcd

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


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


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


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


N, M = inp_list()
A = inp_list()
A.sort(reverse=True)
total = sum(A)

bd = total // (4 * M) + 1
if A[M - 1] < bd:
    print('No')
else:
    print('Yes')

Submission status: Wrong Answer

Solution code:
N, M = map(int, input().split())
A = list(map(int, input().split()))
to = sum(A)
cnt = 0
for a in A:
    if a>=(to * (1/(4*M))):
        cnt += 1

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

Submission status: Wrong Answer

Solution code:
a,b=[int(i) for i in input().split()]
arr=[int(i) for i in input().split()]
tot=sum(arr)
p=(tot/(4*b))
arr.sort()
if arr[-b]>p:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
def main():
    n,m = map(int,input().split())
    lst = map(int,input().split())
    total = sum(lst)
    counter = 0
    for i in lst:
        if i < 1 / (4 * m):
            continue
    else:
        counter += 1

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

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
N, M  = map(int, input().split())
A = [int(a) for a in input().split()]
thr = sum(A) // (4 * M)
cnt = 0
for a in A:
    if a >= thr:
        cnt += 1
if cnt >= 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)
ans = 0
for i in A:
  if 4 * M * i < s:
    ans += 1

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Sat Apr  4 20:49:19 2020

@author: naoki
"""

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

count=0
tres = sum(l)//(4*m)

for x in l:
    if x>=tres:
        count+=1

if count>=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_left(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 = list(map(int, input().split()))
A.sort(reverse=True)

total = sum(A)
limit = total //(4*m)
cannot = 0
for i in range(m):
  if A[i]<limit:
    cannot=1
    break
    
if cannot:
  print('No')
else:
  print('Yes')

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//(4*m)) < a[i]:
        count += 1
if count >= 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()]
border = sum(a) / (4*m)
a.sort(reverse=True)
if a[m-1] > border:
    print("Yes")
else:
    print("No")
#print(border)

Submission status: Wrong Answer

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

import sys

DEBUG = False

def read(t):
    return t(sys.stdin.readline().rstrip())


def read_list(t, sep = " "):
    return [t(s) for s in sys.stdin.readline().rstrip().split(sep)]


def dprint(*args, **kwargs):
    if DEBUG:
        print(*args, **kwargs)
    return


def main():
    n, m = read_list(int)
    as_ = read_list(int)
    all_voting = sum(as_)
    if len(list(filter(lambda v: v >= all_voting / (4 * m), as_))) > m:
        print("Yes")
        return
    print("No")


if __name__ == "__main__":
    main()

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 = list(map(int , input().split()))
s = sum(a)
ans = 0
for ai in a:
    if ai > s/(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()))

SUM_A = sum(A)
ans = 0

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

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

Submission status: Wrong Answer

Solution code:
import sys
stdin = sys.stdin
sys.setrecursionlimit(10 ** 7)

def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
# 入力全てを整数に変換したものの配列を受け取る
def LI(): return list(map(int, sys.stdin.readline().split()))
# 入力全てを整数に変換して1引いたものの配列を受け取る
def LLI(rows_number): return [LI() for _ in range(rows_number)]

n,m = MI()
a = sorted(LI())[::-1]
asum = sum(a)
if a[:m][-1]>asum*(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()))
m = 0
for i in range(N):
    if A[i] > N / (4 * M):
        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()))
count = 0
sm = sum(a)
for i in a:
    if( i >= sm/(4*m)):
        count += 1
if(count >= m):
    print("YES")
else:
    print("NO")

Submission status: Wrong Answer

Solution code:
n,m = map(int,input().split()) #n種類　M個えらぶ
a = list(map(int,input().split()))
sum_list = sum(a)

count = 0
for i in range(n):
    if a[i] > sum_list/(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()))
limit = sum(A) // (4 * M)
if M <= len([1 for a in A if a >= limit]):
    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)
all=sum(a)
if a[m-1]>all/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()))
votes = sum(a)
a.sort(reverse=True)
ans = 'Yes'
for i in range(m):
    if a[i] < votes // (4 * m):
        ans = 'No'
        break
print(ans)

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]>=b:
    print("Yes")
else:
    print("No")
# print(A)

Submission status: Wrong Answer

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

sou = sum(A) / (4 * M)

for i in range(M):
  if A[i] > sou:
    count += 1

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N, M = map(int, input().split())
A = list(map(int, input().split()))
b = sum(A)//(4*M)
c = len(list(filter(lambda x: x>b, A)))
print("Yes" if c >= M else "No")

Submission status: Wrong Answer

Solution code:
from math import ceil
n,m = map(int,input().split())
l = list(map(int,input().split()))
l.sort(reverse=True)
val = sum(l)
f = 1
for i in range(m):
  if l[i] < ceil(val/4*m):
    f = 0
    break
else:
  print('No')
if f:
  print("Yes")

Submission status: Wrong Answer

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

b = sum(a)/(4.0*m)
c = 0
for i in range(n) :
    if a[i]>=b :
        c += 1

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

ans = "Yes"
a_all = sum(a)
a.sort(reverse=True)

for i in range(m):
    if a[i] < a_all // (4*m):
        ans = "No"
        break
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N, M = list(map(int, input().split()))
A = list(map(int, input().split()))
kijun = sum(A)//(4*M)
cnt = 0

for x in A:
    if x >= kijun:
        cnt+=1

if cnt >= 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()]
su=sum(A)
count=0
for i in A:
    if i>=su//(4*M):
        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()]
line=[int(x) for x in input().split()]
cutoff=sum(line)/(4*M)
count=0
for i in line:
    if i>cutoff:
        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)
ad=sum(a)
ad=ad//(4*m)


for i in range(m):
    if a[i]<ad:
        print("No")
        break
else:
    print("Yes")

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!
# coding: utf-8
import sys
sys.setrecursionlimit(10000000)

#const
dxdy=((1,0),(0,1))
# my functions here!
def pin(type=int):
    return map(type,input().rstrip().split())

def resolve():
    N,M=pin()
    A=sorted(list(pin()))
    A.reverse()
    p=sum(A)//(4*M)
    #print(sum(A),A)
    print(["No","Yes"][A[M-1]>=p])
"""         
#printデバッグ消した？
#前の問題の結果見てないのに次の問題に行くの？
"""
"""
お前カッコ閉じ,るの忘れてるだろ
"""
import sys
from io import StringIO
import unittest


class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)

    def test_入力例_1(self):
        input = """4 1
5 4 2 1"""
        output = """Yes"""
        self.assertIO(input, output)

    def test_入力例_2(self):
        input = """3 2
380 19 1"""
        output = """No"""
        self.assertIO(input, output)

    def test_入力例_3(self):
        input = """12 3
4 56 78 901 2 345 67 890 123 45 6 789"""
        output = """Yes"""
        self.assertIO(input, output)


if __name__ == "__main__":
    resolve()

Submission status: Wrong Answer

Solution code:
N, M = list(map(int, input().split()))
A = list(map(int, input().split()))
div = sum(A) / (4 * M)

cnt = 0
for a in A:
    if a > div:
        cnt += 1
if cnt >= 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)
cnt = 0

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

Submission status: Wrong Answer

Solution code:
import sys
def ii(): return int(sys.stdin.readline())
def mi(): return map(int, sys.stdin.readline().split())
def li(): return list(map(int, sys.stdin.readline().split()))
def li2(N): return [list(map(int, sys.stdin.readline().split())) for i in range(N)]
def dp2(ini, i, j): return [[ini]*i for i2 in range(j)]
def dp3(ini, i, j, k): return [[[ini]*i for i2 in range(j)] for i3 in range(k)]
#import bisect #bisect.bisect_left(B, a)
#from collections import defaultdict #d = defaultdict(int) d[key] += value

N, M = mi()
A = sorted(li(), reverse = True)[:M]

all = float(sum(A)) /(4.0*M)

for a in A:
    if a < all:
        print('No')
        exit()
print('Yes')

Submission status: Wrong Answer

Solution code:
N, M = map(int, input().split())
A = sorted(map(int, input().split()))
sum_a = sum(A)
border = sum_a // (4*M)

if A[-M] > border:
    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)

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

Submission status: Wrong Answer

Solution code:
n,m=map(int,input().split())
alist=list(map(int,input().split()))
soutokuhyou = sum(alist) / (4*m)
count = 0

for i in alist:
    if i > soutokuhyou:
        count += 1

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)

c = n

for i in arr:
    if i < votes / (4 * m):
        c -= 1

if c >= 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()))
a.sort()
s = sum(a) / (4*m)
if len([x for x in a if x > 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()))
a.sort(reverse=True)
total = sum(a)
tmp = 1 / (4 * M)
cnt = 0
for i in a:
    if i > total * tmp:
        cnt += 1
    else:
        break
if cnt >= 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
count2=0
flag=False
for i in range(N):
    count+=A[i]
for i in range(N):
    if A[i]>count*1/(4*M) and flag==False:
        count2+=1
    if count2>=M:
        flag=True
        break
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()))
sa = sum(A)
print('Yes' if len([a for a in A if a>=sa/(4*m)])>m else 'No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

cnt = 0
for a in A:
    if a >= lower_limit:
        cnt += 1

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

Submission status: Wrong Answer

Solution code:
hoge = input().split()
N = int(hoge[0])
M = int(hoge[1])
A_list = list(map(int,input().split()))

sugoi = 4 * M
_sum = sum(A_list)
ok = 0
for i in range(len(A_list)):
  if A_list[i] >  _sum / sugoi:
    ok += 1
    
if ok >= M:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(1000000000)
import math
from fractions import gcd
def lcm(a, b): return a * b // gcd(a, b)
from itertools import count, permutations
from functools import lru_cache
from collections import deque, defaultdict
from pprint import pprint
ii = lambda: int(input())
mis = lambda: map(int, input().split())
lmis = lambda: list(mis())
INF = float('inf')
N1097 = 10**9 + 7

def meg(f, ok, ng):
    while abs(ok-ng)>1:
        mid = (ok+ng)//2
        if f(mid):
            ok=mid
        else:
            ng=mid
    return ok

def get_inv(n, modp):
    return pow(n, modp-2, modp)

def factorials_list(n, modp):    # 10**6
    fs = [1]
    for i in range(1, n+1):
        fs.append(fs[-1] * i % modp)
    return fs

def invs_list(n, fs, modp):     # 10**6
    invs = [get_inv(fs[-1], modp)]
    for i in range(n, 1-1, -1):
        invs.append(invs[-1] * i % modp)
    invs.reverse()
    return invs

def comb(n, k, modp):
    num = 1
    for i in range(n, n-k, -1):
        num = num * i % modp
    den = 1
    for i in range(2, k+1):
        den = den * i % modp
    return num * get_inv(den, modp) % modp

def comb_from_list(n, k, modp, fs, invs):   
    return fs[n] * invs[n-k] * invs[k] % modp

#

class UnionFindEx:
    def __init__(self, size):
        #正なら根の番号、負ならグループサイズ
        self.roots = [-1] * size
    def getRootID(self, i):
        r = self.roots[i]
        if r < 0:   #負なら根
            return i
        else:
            r = self.getRootID(r)
            self.roots[i] = r
            return r
    def getGroupSize(self, i):
        return -self.roots[self.getRootID(i)]
    def connect(self, i, j):
        r1, r2 = self.getRootID(i), self.getRootID(j)
        if r1 == r2:
            return False
        if self.getGroupSize(r1) < self.getGroupSize(r2):
            r1, r2 = r2, r1
        self.roots[r1] += self.roots[r2]    #サイズ更新
        self.roots[r2] = r1
        return True

Yes = 'Yes'
No = 'No'

def main():
    N,M=mis()
    A = lmis()
    S = sum(A)
    ok = sum(a>S/(4*M) for a in A)
    if ok >= M:
        print(Yes)
    else:
        print(No)



main()

Submission status: Wrong Answer

Solution code:
import sys
import numpy as np

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
printV = lambda x: print(*x, sep="\n")
printH = lambda x: print(" ".join(map(str,x)))
def IS(): return sys.stdin.readline()[:-1]
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LI1(): return list(map(int1, sys.stdin.readline().split()))
def LII(rows_number): return [II() for _ in range(rows_number)]
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def LLI1(rows_number): return [LI1() for _ in range(rows_number)]

def main():
	n,m = MI()
	a = np.array(LI())
	total = np.sum(a)
	if m <= np.sum(a>(total/(4*m))):
		print("Yes")
	else:
		print("No")

if __name__ == '__main__':
	main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N,M = map(int,input().split())
li = list(map(int,input().split()))
s = sum(li)
temp = s//(4*M)
c=0
for i in li:
	if i>=temp:
		c+=1
if c>=M:
	print("Yes")
else:
	print("No")

Submission status: Wrong Answer

Solution code:
import sys
input = lambda: sys.stdin.readline().rstrip()
yes = lambda boolean: print('Yes') if boolean else print('No')
input_ints = lambda: list(map(int, input().split()))

N, M = input_ints()
A = input_ints()
A.sort(reverse=1)
yes(A[M-1]*4*M>1)

Submission status: Wrong Answer

Solution code:
N, M = map(int, input().split())
A = list(map(int, input().split()))
boder = sum(A) / 4 / M
counter = 0
for i in A:
    if i < boder:
        counter += 1
if counter > 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)
select = 0
for i in range(N):
    if A[i] >= total//(4*M):
        select += 1

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

Submission status: Wrong Answer

Solution code:
n,m=map(int, raw_input().split())
arr=map(int, raw_input().split())
s=sum(arr)
arr.sort()
k=m
for i in xrange(n-1,-1,-1):
    if arr[i]>=s/(4*m) and k>0:
        k-=1

if k>0:
    print 'No'
else:
    print 'Yes'

Submission status: Wrong Answer

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

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

print("Yes" if m >= ok_count else "No")

Submission status: Wrong Answer

Solution code:
#!python3.4.3

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

total = sum(A)

count = 0

for a in A:
  if a > total/(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()))
a.sort(reverse=True)
s = sum(a)/(4*m)
if a[m-1]>s:
    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
al=0
for i in range(n):
    al+=a[i]
p=al/(4*m)
for i in range(n):
    if p<a[i]:
        ans+=1
print("Yes" if m<=ans else "No")

Submission status: Wrong Answer

Solution code:
n,m=map(int,input().split())
a=list(map(int,input().split()))
ashi=1/4*m
ans="No"
a=[i for i in a if i >=ashi]
if len(a)>=m:
    ans="Yes"
print(ans)

Submission status: Wrong Answer

Solution code:
#def main(S, b):
if __name__ == '__main__':
    n, m = map(int, input().split())

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

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