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:
N, M = [int(x) for x in input().strip().split(" ")]
A = [int(x) for x in input().strip().split(" ")]

border = sum(A) // (4 * M)
bordered = [a for a in A if a > border]
print("Yes" if len(bordered) >= M else "No")

Submission status: Wrong Answer

Solution code:
nm = input('')
n = int(nm.split(' ')[0])
m = int(nm.split(' ')[1])
alist = input('').split(' ')

s = 0
t = 0
for a in alist:
  t += int(a)

for a in alist:
  a2 = int(a)
  if a2 > t/(m*4):
    s+=1

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n,m = map(int,input().split())
num_list = list(map(int,input().split()))
cnt = 0
for i in num_list:
    if i >= int(sum(num_list) * (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())
A = list(map(int, input().split()))

sum = sum(A)

count = 0

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n,m = map(int,input().split())
l = sorted(list(map(int,input().split())))[::-1]
s = float(sum(l)/m)
t = "Yes"
for i in range(m):
  if l[i]>=s:
     t = "No"
print(t)

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)
OK=S/(4*M)
ans=0
for i in range(M):
  if A[i]>OK:
    ans+=1
if ans==M:
  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 < total * (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=list(map(int,input().split()))

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

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

Submission status: Wrong Answer

Solution code:
import sys
stdin = sys.stdin

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

n,m=nm()
a=nl()
j=0
count=sum(a)/(4*m)
for i in a:
    if i>count:
        j+=1
if j<m:
    print("No")
else:
    print("Yes")

Submission status: Wrong Answer

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

if tmp[1]<=len(num[num>(num.sum()/(4*tmp[1]))]):
    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()]
s = sum(a)
c=0

for i in range(n):

   if a[i]*4*m >= s:
       c+=1

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

Submission status: Wrong Answer

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

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


def solve(N: int, M: int, A: "List[int]"):
    sum = 0
    count = 0
    for i in A:
        sum += i
    #print(sum)

    for a in A:
        if a >= sum // (4 * M):
            count += 1
    #print(count)
    if count >= M:
        print(YES)
    else:
        print(NO)
    return


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
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())
a=list(map(int,input().split()))
x=sum(a)//m
c=0
for i in a:
  if i>x:
    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()))

a = sorted(a)
a = a[::-1]

p = 1/(4*m)
s=  sum(a)
p = p*s

if( a[m-1] >= p ):
    print("YES")
else:
    print("NO")

Submission status: Wrong Answer

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

ans = 'No'
for i in range(len(a)):
  if a[i] >= sum(a)//(4*m):
    ans = 'Yes'
    break
  
print(ans)

Submission status: Wrong Answer

Solution code:
n,m=map(int,input().split())
a=list(map(int,input().split()))
ans=0
for i in a:
    if i>=sum(a)//(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=[int(ss) for ss in input().split()]
a=sorted(a,reverse=True)
r="Yes"
for ii in range(m):
  if a[ii]<1/(4*m):
    r="No"
    break
print(r)

Submission status: Wrong Answer

Solution code:
N,M = map(int, input().split())
A = list(map(int, input().split()))
A_sum = sum(A)
tmp = A_sum/4/M
A.sort()
if A[M-1] <tmp:
    print("No")
else:
    print("Yes")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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



if A[-M] < (1/4*M):
  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()]

import numpy as np
thrs = sum(A) / (4 * M)
if sum(np.array(A) > thrs) >= M:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

cnt=0
for i in range(n):
    if l[i] > sum(l)*(1/(4*m)):
        cnt += 1
    else:
        continue

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

Submission status: Wrong Answer

Solution code:
import math
n,m = list(map(int,input().split()))
a = list(map(int,input().split()))
t = sum(a)
c = 0
f = 0
for i in range(n):
	if a[i] >= math.ceil(t/(4*m)):
		c += 1
	if c==m:
		f = 1
		print("YES")
		break
if f==0:
	print("NO")

Submission status: Wrong Answer

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

total = sum(A)
border = total/(4*M)
X=[1 for i in range(N) if A[i]>border]

ans = 'Yes' if len(X)>=M else 'No'

print(ans)

Submission status: Wrong Answer

Solution code:
N, M = map(int, input().split())
a = list(map(int, input().split()))
kijun = sum(a)/(4*M)
ans = 0
for i in a:
    if i > kijun:
        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()))

t=sum(a)

cnt=0
d=int(t/(4*m))

for i in range(n):

  if d<=a[i]:
    cnt+=1

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

Submission status: Wrong Answer

Solution code:
import numpy as np
from sys import stdin


def get_result(data):
    N, M = data[0]
    A = np.array(data[1])
    total = sum(A)
    pop_goods = A[A > total/(4*M)]
    if len(pop_goods) >= M:
        return 'Yes'
    return 'No'


if __name__ == '__main__':
    raw_data = [val.rstrip() for val in stdin.readlines()]
    data = [list(map(int, val.split(' '))) for val in raw_data]
    result = get_result(data)
    print(result)

Submission status: Wrong Answer

Solution code:
import sys
N, M = map(int, sys.stdin.readline().split())
li = list(map(int, sys.stdin.readline().split()))
li.sort(reverse=False)
if li[M-1] < sum(li)/(4*M):
  print('No')
else:
  print('Yes')

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:
N,M = map(int,input().split())
A = sorted(map(int,input().split()),reverse = True)
goukei = sum(A)
judge = goukei/4/M
if A[M-1]>judge:
    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)
    print(ary)
    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:
# -*- coding: utf-8 -*-
N, M = list(map(int, input().split()))
A = list(map(int, input().split()))
A = sorted(A, reverse=True)
if (A[M - 1] > sum(A) / (4 * M)):
    print('yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
n, m = (int(i) for i in input().split())
A = [int(i) for i in input().split()]
_sum = sum(A)
th = _sum / (4*m)
cnt = 0

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

Submission status: Wrong Answer

Solution code:
import math
def main(n,m,a):
    hyou = 0
    for i in range(len(a)):
        hyou += a[i]
    sikii = math.floor(hyou/(4*m))
    count = 0
    for i in range(len(a)):
        if a[i] > sikii:
            count += 1
    return "Yes" if count >= m else "No"

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

Submission status: Wrong Answer

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

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

new_list = sorted(a)

if new_list[b-1] < b*4:
    	print("Yes")
else:
    	print("No")

Submission status: Wrong Answer

Solution code:
# 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)+1)//(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 = map(int, input().split())
a = list(map(int, input().split()))
a.sort(reverse=True)
s = sum(a)

limit = s // (4*m)
for i in range(m):
    if a[i] < limit:
        print("No")
        exit()

print("Yes")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

ans = 'Yes' if A[M-1] >= (sum(A) / 4.0*M ) else 'No'
print(ans)

Submission status: Wrong Answer

Solution code:
N,M=list(map(int,input().split()))
A=list(map(int,input().split()))
limit=sum(A)/(4*M)
A.sort()
c=0
for a in A:
  if a > limit:
    c+=1
    if c==M:
      break
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()))
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:
n,m = map(int, input().split())
a = list(map(int, input().split()))

sa = sorted(a)
sum=0
for i in range(n):
    sum += a[i]

t = sum / (4*m)
if sa[n-1-m] < t:
    print("No")
else:
    print("Yes")

Submission status: Wrong Answer

Solution code:
for _ in range(1):
	# n = int(input())
	n,m = map(int,input().split())
	arr = list(map(int,input().split()))
	# s = input()
	arr.sort(reverse=True)
	if arr[m-1] >= sum(arr)/(4*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 = 0
a_all = sum(a)

for x in a:
    if x >= a_all // (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()))

vote = sum(A)
ans = sum(x > vote//(4*M) for x in A)

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

result = True
sum = 0
a.sort(reverse=True)

for i in range(n):
    sum += a[i]

threshould = sum / 4 / m
print(threshould)

for i in range(m):

    if a[i] < threshould:
        result = False
if result:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
n,m = map(int,input().split())
l = sorted(list(map(int,input().split())))[::-1]
s = (sum(l)/m)
t = "Yes"
for i in range(m):
  if l[i]>=s:
     t = "No"
print(t)

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

Submission status: Wrong Answer

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

l=list(map(int,input().split()))
s=sum(l)
ans=0
t=s*1/(4*m)
for i in l:
    if i>t:
        ans+=1
if ans>=m:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
"""
NTC here
"""
import sys
inp = sys.stdin.readline
def input(): return inp().strip()
# flush= sys.stdout.flush
# import threading
# sys.setrecursionlimit(10**6)
# threading.stack_size(2**26)
 
def iin(): return int(input())
 
 
def lin(): return list(map(int, input().split()))
 
 
# range = xrange
# input = raw_input
 
def main():
    T = 1
    while T:
        T-=1
        n, m = lin()
        a = lin()
        sm = sum(a)
        a.sort(reverse=True)
        lst = sm//(4*m)
        for i in range(m):
            if a[i]<lst:
                print('No')
                break
        else:
            print('Yes')

 
 
 
 
 
main()
 
# threading.Thread(target=main).start()

Submission status: Wrong Answer

Solution code:
n, m = tuple(map(lambda x: int(x), input().split(" ")))
a = tuple(map(lambda x: int(x), input().split(" ")))
d = sum(a) / (4 * m)
c = 0
for v in a:
    if v > d:
        c += 1
print("No" if c < m else "Yes")

Submission status: Wrong Answer

Solution code:
#


def main():
    n, m = map(int, input().split(" "))
    a = [int(s) for s in input().split(" ")]
    total = sum(a)
    lim = total // (4 * m)
    a = sorted(a, reverse=True)
    count = 0
    for i in a:
        if i > lim:
            count += 1
        else:
            break
    if count >= m:
        print("Yes")
    else:
        print("No")


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

p = [ai for ai in a if ai > sum(a)/(4 * m)]

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

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

cnt = 0
for i in A:
  if (i > int(su / 4 / 2)):
    cnt += 1
if (cnt >= 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)
S = sum(A)

if A[M-1]>S/(4*M):
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
ni = lambda: int(input())
nm = lambda: map(int, input().split())
nl = lambda: list(map(int, input().split()))

n, m = nm()

aa = nl()

mx = sum(aa)/(4*m)

a = sorted(aa)[::-1]


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

Submission status: Wrong Answer

Solution code:
n,m = map(int,input().split())
a = [int(e) for e in input().split()]
cnt = 1
s = 0
for i in a:
  s+=i
for i in a:
  if i*4*m >= s:
    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()))
L=max(A)
flag=0
for i in range(N):
    if A[i]>=L/(4*M):
        flag+=1

if flag>=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)
if A[M - 1] < bd:
    print('No')
else:
    print('Yes')

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
import sys
import numpy as np

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


def solve(N: int, M: int, A: "List[int]"):
    A = np.array(A)
    n_sum = np.sum(A)/4/M
    if (A > n_sum).sum() >= M:
        print(YES)
    else:
        print(NO)

    return


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
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 = list(map(int, input().split()))
a = list(map(int, input().split()))

aa = sorted(a, reverse=True)

suma = sum(aa)
threshold = suma / (4 * m)

if aa[m-1] > threshold:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

ans = 'No'
for i in range(len(a)):
  if a[i] >= sum(a)//(4*m):
    ans = 'Yes'
  
print(ans)

Submission status: Wrong Answer

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

c=0

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

if c>=M:
  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[n-m] < 1/(4*m):
  print('No')
else:
  print('Yes')

Submission status: Wrong Answer

Solution code:
if __name__ == '__main__':
    n, m = tuple([int(i) for i in input().split()])
    a = [int(i) for i in input().split()]
    total = float(sum(a))

    selected = [i >= (total // (4 * m)) for i in a]
    result = len([r for r in selected if r])

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

Submission status: Wrong Answer

Solution code:
n,m = [int(x) for x in input().split(' ')]
arr = [int(x) for x in input().split(' ')]
t = sum(arr)//(4*m)
cnt = 0
for i in arr:
    if i>t:
        cnt=cnt+1
if(cnt>=m):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
import sys
import re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N, M = MAP()
A = LIST()

count = 0
for i in range(N):
    if A[i] >= sum(A) * (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()))
s = sum(a)
b = []
for i in range(n):
    if a[i]*4*m < s:
        b.append(a[i])
if len(b) < m:
    print("No")
else:
    print("Yes")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import bisect,collections,copy,itertools,math,numpy,string
def I(): return int(input())
def S(): return input()
def LI(): return list(map(int,input().split()))
def LS(): return list(input().split())
##################################################
N,M = LI()
A = LI()
kijun = sum(A)//(4*M)
print(kijun)
count = 0
for x in A:
    if x>=kijun:
        count += 1
print('Yes' if M<=count else 'No')

Submission status: Wrong Answer

Solution code:
n,m = map(int, input().split())
lis = list(map(int, input().split()))
total = sum(lis)
count = 0
for e in lis:
    if e>=(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 = sorted(map(int, input().split()), reverse=True)

var = sum(A) // (4*M) 
if A[M-1] >= var:
        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)
x = sum(A)
min_ = x / (4*M)
flag = 0

for i, a in enumerate(A):
  if i == M:
    flag = 1
    break
  if a < min_:
    break
if flag == 1:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

filtera = [i for i in a if i >= 1/(4*m)]

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

Submission status: Wrong Answer

Solution code:
def main():
    _, M = [int(x) for x in input().split()]
    A = [int(x) for x in input().split()]
    border = M * 4
    count = 0
    for a in A:
        if a >= border:
            count += 1
            if count >= M:
                print("Yes")
                return
    print("No")

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math

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

threshold = math.ceil(sum(sequence) // (4*m))

sequence.sort(reverse = True)
index = 0

while m > 0:
	if sequence[index] >= threshold:
		m -= 1
		index += 1
	else:
		break

if m == 0:
	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:
# Code for B - Popular Vote
# Use input() to fetch data from STDIN
from math import floor

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

total = sum(a)

if len(list(filter(lambda x: x >= floor(total / (4 * m)), a))) >= 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)
A_selected = [a for a in A if a >= (S/4/M)]
ret = len(A_selected) > M
if ret:
    ret_str = 'Yes'
else:
    ret_str = 'No'
print(ret_str)

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)
limit = s // 8
for i in range(m):
    if a[i] < limit:
        print("No")
        exit()

print("Yes")

Submission status: Wrong Answer

Solution code:
n,m=map(int,input().split())
A=list(map(int,input().split()))
cnt=0
s=sum(A)
for i in range(n):
    if A[i]>=s*(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())
a = list(map(int, input().split()))

t = sum(a) // (4*m)
ans = 0
for i in a:
  if t < i:
    ans += 1
if m <= ans:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N, M = map(int, input().split())
nums = list(map(int, input().split()))
total = sum(nums)
ans = 0
for num in nums:
    if num > total * (1 / (4 * M)):
        ans += 1
print("Yes") if ans >= M else print("No")

Submission status: Wrong Answer

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

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

if len(pop) > 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())
a = list(map(int, input().split()))
a = np.array(a)
s = a.sum()
level = 1 / (4 * M)
# print(a)
# print(level)
cnt = (a > level*s).sum()

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)
c = 0
for i in a:
	if i > (1/(4*m))*s:
		c += 1
if c >= m:
	print ("Yes")
else:
	print ("No")

Submission status: Wrong Answer

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

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

cutter = int(all / (4 * NM[1]))

candidate = []
for i in range(len(score)):
    if (cutter < score[i]):
        candidate.append(score[i])

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

Submission status: Wrong Answer

Solution code:
n,m=[int(e) for e in input().split()]
a=[int(e) for e in input().split()]
count = 0
sum = 0
for i in range(n):
    sum += a[i]
print(sum)
for i in range(n):
    if a[i] >= sum / (4*m):
        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()]
A = [int(i) for i in input().split()]
sumA = sum(A)
pop_cnt = 0
for a in A:
    if a > (sumA/(4*M)):
        pop_cnt += 1
if pop_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()))
ashi=sum(a)/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:
import bisect as bs

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

count = 0

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n, m = map(int, input().split())
a = sorted(list(map(int, input().split())), reverse=True)
border = sum(a) / (4 * m)
cnt = 0
for i in a:
    if cnt >= m:
        print("Yes")
        exit()
    if i >= border:
        cnt += 1
print("No")