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:
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
# from fractions import gcd
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from functools import reduce
from bisect import bisect_left, insort_left
from heapq import heapify, heappush, heappop

INPUT = lambda: sys.stdin.readline().rstrip()
INT = lambda: int(INPUT())
MAP = lambda: map(int, INPUT().split())
S_MAP = lambda: map(str, INPUT().split())
LIST = lambda: list(map(int, INPUT().split()))
S_LIST = lambda: list(map(str, INPUT().split()))
ZIP = lambda: zip(*(MAP() for _ in range(n)))

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


def main():
    N, M = MAP()
    A = LIST()

    W = sum(A)
    A = sorted(A, reverse=True)
    print(A)

    for i, a in enumerate(A):
        if a < W / (4*M):
            print("No")
            sys.exit()
        print(i)
        if i == M:
            print("Yes")
            sys.exit()


if __name__ == '__main__':
    main()

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()
print(A[N-M],tmp)
if A[N-M] <tmp:
    print("No")
else:
    print("Yes")

Submission status: Wrong Answer

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


a = input().split()
for i in range(n):
	a[i] = int(a[i])


sumvote = sum(a)

line = sumvote/(4*m)

c = 0

for i in range(n):
	if a[i]>line:
		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()))

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

Submission status: Wrong Answer

Solution code:

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

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

total = sum(A)
ta = total * (1/(4*M))
even = [i for i in A if i > ta]

if len(even) > 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)
r=s/(4*m)
cnt=0
for i in l:
    
    if i>r:
        cnt=cnt+1

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

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

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

cnt = 0
for i in a_list:
    if cnt == m:
        print('Yes')
        exit()

    if i >= border:
        cnt += 1

print('No')

Submission status: Wrong Answer

Solution code:
import numpy as np
S = input().split(" ")
N = int(S[0])
M = int(S[1])

ARR = np.array([int(s) for s in input().split(" ")])


criterion = np.sum(ARR) / (4 * M)

res = ARR > criterion

result = np.sum(res)

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

Submission status: Wrong Answer

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

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

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


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

    return


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

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

cnt = 0
for num in a:
    if num >= all / (4*m):
        cnt += 1
    if cnt >= m:
        print("Yes")
        break
    print(cnt)
else:
    print("No")

Submission status: Wrong Answer

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

list.sort(A,reverse=True)

sumnum = sum(A)

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

Submission status: Wrong Answer

Solution code:
import numpy as np

def main():
    N,M = map(int,input().split())
    A = np.array(list(map(int,input().split())))
    ans = 'No'

    if sum( A> int(sum(A)/4/M) ) >= M: ans = 'Yes'
    
    print(ans)
    return

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
n,m=map(int,input().split())
s=list(map(int,input().split()))
total_vote=0
for i in range(n):
    total_vote +=s[i]

count = 0
while count != m:
    if total_vote * (1/(4*m)) > s[count]:
        print("No")
        exit()
    else:
        count+=1
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())
aaa = list(map(int, input().split()))
border = sum(aaa) // (4 * m)
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 = map(int, input().split())
A = list(map(int, input().split()))
total = sum(A)
count = 0
for i in A:
	if i > total / (4 * m):
		count += 1
if count >= m:
	print('Yes')
else:
	print('No')

Submission status: Wrong Answer

Solution code:
n, m = map(int, input().strip().split())
A = map(int, input().strip().split())
t = (1 / (4 * m)) * sum(A)
s = sum([(v >= t) for v in A])
print('Yes') if s >= m else print('No')

Submission status: Wrong Answer

Solution code:
import sys

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

total=sum(A)


sou=1/(M*4)
s=0
for a in A:
    tmp=a/total
    if(tmp > sou):
        s+=1
        if(s == M):
            print("Yes")
            sys.exit()

print('No')

Submission status: Wrong Answer

Solution code:
def main():
  n, m = map(int, input().split())
  data = list(map(int, input().split()))

  sum_v = sum(data)

  count = 0
  for d in data:
    if sum_v / ( 4 * m ) < d:
      count += 1
    else:
      pass
  
  if count >= m:
    print("Yes")
  else:
    print("No")

if __name__ == "__main__":
  main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

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

count = 0

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

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

Submission status: Wrong Answer

Solution code:

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

count = 0

for i in range(N-1):
	if A[i]<(0.25/M*sum(A)):
		break
	else:
		count +=1
	if count == M:
		break

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

Submission status: Wrong Answer

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

sums = sum(lists)/4/m
lens = len(lists)
for i in range(m):
    if lists[lens-1-i] < sums:
        print("No")
        break

print("Yes")

Submission status: Wrong Answer

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

count = 0

for tg in l:
	if tg >= 1 / (4 * m):
		count += 1


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

Submission status: Wrong Answer

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

total = sum(A)
border = total // (4*m)
count = 0

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

ans = "Yes"
if count < m:
    ans = "No"

print(ans)

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:
from collections import defaultdict
import math
N, M = map(int, input().split(' '))
A = list(map(int, input().split(' ')))
kijun = sum(A)/M/4

a = list(filter(lambda x: x > kijun, A))
if len(a) >= 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()]
A.sort(reverse=True)
print(A)
if A[M - 1] * 4 * M >=  sum(A) :
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

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:
a,b = [int(x) for x in input().split()]
l = list(map(int,input().split()))
total = sum(l)
l= sorted(l)[::-1];
if(l[b-1]*4*b>total):
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
n,m=map(int,input().split())
v=list(map(int,input().split()))
v2=sorted(v, reverse=True)
vsum=sum(v)
cri=vsum/(4*m)

if v2[m-1]>cri:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

a_sum = sum(A)
ans = 0
for i in range(n):
    if float(A[i]) < a_sum/(4*m):
        ans += 1


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

Submission status: Wrong Answer

Solution code:
N , M = (map(int , input().split()))
A = list(map(int , input().split()))
s = sum(A)
tou = int((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:
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 = list(map(int, input().split()))
a_i = list(map(int, input().split()))

v_sum = sum(a_i)
n = len([a for a in a_i if a >= (1/(4*M))])
if n >= 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.floor(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())
l = sorted(list(map(int,input().split())))[::-1]
s = float(sum(l)/4*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 = sorted(list(map(int,input().split())),reverse=True)
def main():
    s = sum(a)
    thresh = s/4/m
    if a[m-1]>thresh:
        print('Yes')
    else:
        print('No')

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

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

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

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#M番目が1/4M以下ならだめ

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

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

if A[M-1] < total/(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"
sum_M = sum(A)
an = 0
for i in range(M):
    if A[i] < sum_M*1/4/M:
        an += 1
        
if an<M:
    ans = "No"

print(ans)

Submission status: Wrong Answer

Solution code:
x = list(map(int,input().split(" ")))
n = x[0]
m = x[1]
a = list(map(int,input().split(" ")))
a.sort(reverse=True)
# print(a)
all_a = sum(a)
# print(all_a)
l = 4 * m

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

for i in range(n):
    if A[i] > sum(A)/(4*m):
        x += 1
        
print("YNeos"[m > x::2])

Submission status: Wrong Answer

Solution code:
#B
import numpy as np
n,m=map(int,input().split())
a=(np.fromstring(input(),int,sep=' '))
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 = list(map(int, input().split()))

A_sum = sum(A)
test = 1 / 4 * M
ans = 0
for i in A:
    if i >= A_sum *test:
        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()))

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

Submission status: Wrong Answer

Solution code:
from sys import stdin


def main():
    input = lambda: stdin.readline()[:-1]
    N, M = map(int, input().split())
    A = list(map(int, input().split()))

    num = sum(A) // (4 * M)
    A.sort(reverse=1)
    if A[M-1] >= num:
        print('Yes')
    else:
        print('No')


main()

Submission status: Wrong Answer

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

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

cnt = 0
for i in a_list:
    if cnt == m:
        print('Yes')
        exit()

    if i >= border:
        cnt += 1

print('No')

Submission status: Wrong Answer

Solution code:
n,m = map(int,input().split())
A = input().split()
for i in range(n):
    A[i] = int(A[i])
count = 0
sum = sum(A)
for i in range(n):
    if A[i] < sum/(4*m):
        pass
    else:
        count += 1
print(count,sum)
if count >= m:
    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))//(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:
from decimal import *

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

Submission status: Wrong Answer

Solution code:
def main():
    n, m = [int(i) for i in input().split()]
    a = [int(i) for i in input().split()]
    th = 1 / float(4*m)
    target = a[m-1] / sum(a)
    if target >= th:
        print('Yes')
    else:
        print('No')
        

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

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

if len(B) >= 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()]
a.sort()
k = sum(a)
k = k*(1/(4*m))
count = 0
for i in range(n):
    if a[i] > k:
        count += 1
    else:
        pass
if count >= m:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

bd = sum(a_lst) / (4 * m)
cnt = 0

for a in a_lst:
    if bd < a:
        cnt += 1

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

Submission status: Wrong Answer

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

if len([ s for s in scores if s >= at_least]) >= 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] > sum(a)/4/m:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

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

def solve(N, M, A):
    
    d = int(sum(A) * 1/(4*M))
    
    ct = 0
    for i in A:
        if i < d:
            ct += 1
    
    if ct > M:
        return "Yes"
    else:
        return "No"

print(solve(N, M, A))

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

Submission status: Wrong Answer

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

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

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


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

    main(n, m, a)

Submission status: Wrong Answer

Solution code:
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/(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()))
a.sort()
a.reverse()
s=sum(a)
if (a[m-1] >= int(s/(4*m))):
    print("Yes")
else:
    print("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] < val//(4*m):
    f = 0
    break
if f:
  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:
if __name__ == "__main__":
    n, m = map(int, input().split())
    a = list(map(int, input().split()))

    a.sort(reverse=True)
    total = sum(a)

    for i in range(m):
        if a[i] < total // (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()))
ans = 'Yes'
A.sort(reverse=True)
print(A)
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())
A=list(map(int,input().split()))
A.sort
B=len(A)
c=0
for i in range(B):
 c+=A[i]
if A[B-M]>=c/4:
 print("Yes")
else:
 print("No")

Submission status: Wrong Answer

Solution code:
from sys import stdin
from sys import setrecursionlimit
from math import ceil
from collections import Counter, deque, defaultdict
setrecursionlimit(1000000)

# INF = float('inf')
INF = int(1e10)

def input():
    return stdin.readline()[:-1]

def main():
    from builtins import int, map
    N, M = map(int, input().split())
    A = list(map(int, input().split()))
    Asum = sum(A)
    A = [4 * M * a for a in A]

    count = 0
    for a in A:
        if a > Asum:
            count += 1
    
    if count >= 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()))
arr = list(map(int, input().split()))

border = int(sum(arr) / (4*M))

count = 0
for arr_i in arr:
    if(arr_i >= border):
        count+=1

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

Submission status: Wrong Answer

Solution code:
def resolve():
    '''
    code here
    '''
    N, M = [int(item) for item in input().split()]
    A = [int(item) for item in input().split()]
    
    cnt = 0
    A_sum = sum(A)
    for a in A:
        if 1 / (4 * M) * A_sum < a:
            cnt += 1

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

if __name__ == "__main__":
    resolve()

Submission status: Wrong Answer

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

h = 0
s = sum(la)
for i in range(n):
  if la[i] > s/(4*m):
    h += 1

if h >= 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)
for i in range(n):
    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()))
cnt = 0
num = 1 / (4*m)
bunbo = sum(a)
for i in range(n):
    if a[i]/bunbo > num:
        cnt += 1
        
if cnt >= m:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

total = sum(a)
threshold = total / 4 / m

num_over = 0
done = False
for i in a:
    if i >= threshold:
        num_over = num_over + 1
    if num_over == m:
        print('Yes')
        done = True

if not done:
    print('No')

Submission status: Wrong Answer

Solution code:
n,m = input().split(' ')
l = [int(x) for x in input().split(' ')]
l.sort()
if sum(l) >= l[-int(m)]*4*int(m):
  print("No")
else:
  print("Yes")

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:
def count_section_by_zero(data):
  count = 0
  flg = False
  start = 0
  for i, d in enumerate(data):
    if flg is False and d != 0:
      count += 1
      flg = True
      
    if d == 0:
      flg = False
  return count

def input_list():
  return list(map(int, input().split()))

def input_list_str():
  return list(map(str, input().split()))

def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

def gcd(*numbers):
    return reduce(fractions.gcd, numbers)

def gcd_list(numbers):
    return reduce(fractions.gcd, numbers)

def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

# 2で割り切れる回数
def divide_two(arg):
  c = 0
  while True:
    if c >= 2:
      break
    if arg % 2 != 0:
      break
    arg //= 2
    c += 1
  return c

# 素因数分解
def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

def main():
  n,m = input_list()
  a = input_list()
  div = 1/(4*m)
  sum_a = sum(a)
  border = int(sum_a * div)
  popular = []
  for v in a:
    if v < border:
      continue
    popular.append(v)
    
  if len(popular) >= m:
    print('Yes')
  else:
    print('No')
    
  
import math
import fractions
import collections
import itertools
from functools import reduce
main()

Submission status: Wrong Answer

Solution code:
N, M = [int(i) for i in input().split()]
A = [int(i) for i in input().split()]
total_votes = sum(A)
threshold = total_votes / (4 * M)
uppers = [int(i > threshold) for i in A]
if sum(uppers) > 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 = sorted(list(map(int, input().split())), reverse=True)

th = sum(A) / 4 * M
flag = True
for i in range(M):
    if A[i] < th:
        flag = False
        break

if flag:
    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:
# coding: utf-8
# Your code here!

input_line = input()
Line = input_line.split()
Line = [int(s) for s in Line]

input_line = input()
Line2 = input_line.split()
Line2 = [int(s) for s in Line2]

tokuhyou = sum(Line2) / 4 / Line[1]

Line2.sort(reverse=True)

print(Line2[Line[1]-1],tokuhyou)


if Line2[Line[1]-1] >= tokuhyou:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
n, m = map(int, input().split())
a = list(map(int, input().split()))
total = sum(a)
c = 0
for i in a:
  if i < (total//(4*m)):
    continue
  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()))

t = 0
for i in range(n):
  t += a[i]
  
b = t/(4*m)

c = 0
for j in range(n):
  if a[j] >= b:
    c += 1

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

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)
count = 0
for x in A:
    if x>=kijun:
        count += 1
print('Yes' if M<=count else 'No')