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: Accepted

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

total = sum(v)
ans = 0

for i in v:
    if i >= total/(4*m):
        ans += 1
if ans >= m:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

for a in A:
    if a<(sum(A)/(4*M)):
        continue
    else:
        ans+=1

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

Submission status: Accepted

Solution code:
[_, m] = [int(s) for s in input().split()]
a = [int(s) for s in input().split()]
x = sum(a) / (4 * m)
print("Yes" if sum([i >= x for i in a]) >= m else "No")

Submission status: Accepted

Solution code:
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = []
d = sum(b)
e = d / (4*a[1])

for i in b:
    if i >= e:
        c.append(i)

if len(c) < a[1]:
    print("No")
else:
    print("Yes")

Submission status: Accepted

Solution code:
from sys import stdin

n,m=map(int,input().split())
hyo=list(map(int,input().split()))
sum=0
for i in hyo:
    sum+=i
giri=sum/(4*m)
ok=0
for i in hyo:
    if i>=giri:
        ok+=1
if ok>=m:
    print("Yes\n")
else:
    print("No\n")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n, m = map(int, input().split())
*point, = map(int, input().split())
count = 0
border = sum(point) / (4*m)
FLG = False

for num in point:
    if num >= border:
        count += 1

    if count >= m:
        FLG = True
        break

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

Submission status: Accepted

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


ans = 0
sumL = sum(L)
for i in range(n):
    if L[i] >= sumL/(4*m):
        ans += 1
      
        
if ans >= m:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

l.sort(reverse = True)

def check(l):
    l1 = [l[i] for i in range(0, m) if l[i] >= sum(l)/(m*4)]
    return len(l1) == m

if check(l):
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

sum = 0
for i in a:
    sum += i

cnt = 0
for i in a:
    if 4 * i * m >= sum:
        cnt += 1

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N,M = map(int,input().split())
m = 0
v = input().split()
for i in range(N): v[i] = int(v[i])
  
v.sort(reverse=True)
v_min = sum(v)/4/M

while len(v):
  if v.pop(0) >= v_min:
    m += 1
  else:
    break

if M <= m:
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

count = 0
sumA = sum(A)
board = sumA / (4*NM[1])


# print(sumA)
# print(board)

for i in range(len(A)):
    if float(A[i]) >= board:
        count += 1
    else:
        continue


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

Submission status: Accepted

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

cnt = 0
for a in A:
	if a>=S/(4*M):
		cnt += 1

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

Submission status: Accepted

Solution code:
n, m = list(map(int, input().split()))
a = list(map(int, input().split()))
x = m
for item in a:
  if item >= ((1/(4*m))*sum(a)):
    x -= 1
if x <= 0:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
def main():
  n, m = (int(x) for x in input().split())
  a_list = list(map(int, input().split()))
  sum_num = 0
  sum_num = sum(a_list)
  count = 0
  for i in a_list:
    if(i >= sum_num/(4 * m)):
      count += 1

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

if __name__ == '__main__':
  main()

Submission status: Accepted

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

ansCnt = 0
for i in A:
    if i >= sumVal:
        ansCnt += 1

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

Submission status: Accepted

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

Submission status: Accepted

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

cnt=0
for i in range(m):
    if a[i] < a_sum / (4*m):
        cnt += 1
if cnt > 0:
    print('No')
else:
    print('Yes')

Submission status: Accepted

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


if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N, M = map(int, input().split())
item = list(map(int, input().split()))
item = sorted(item, reverse= True)
if item[M-1] < sum(item)/(4*M):
    print("No")

else:
    print("Yes")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N, M = map(int, input().split())
box = list(map(int, input().split()))
S=sum(box)
elected = [x for x in box if x >= S/M/4]
if len(elected) >= M:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
l = input()
m = input()
z = l.split(" ")
M = int(z[1])
F = m.split(" ")
X = []
for item in F:
  votes = int(item)
  X.append(votes)

X.sort(reverse=True)
S = sum(X)
C = (S/(4*M))
if X[M-1]<C:
  print("No")
else:
  print("Yes")

Submission status: Accepted

Solution code:
l = input()
m = input()
z = l.split(" ")
M = int(z[1])
F = m.split(" ")
X = []
amount=0
for item in F:
  votes = int(item)
  amount = amount + votes
  X.append(votes)
X.sort(reverse=True)
C = amount/(4*M)
if X[M-1]<C:
  print("No")
else:
  print("Yes")

Submission status: Accepted

Solution code:
from sys import stdin
import math
# 1行だけ読むやつ

data = stdin.readline().rstrip().split()
N, M = int(data[0]), int(data[1])

str_data = stdin.readline().rstrip().split()
int_data = [int(i) for i in str_data]

int_data = sorted(int_data, reverse=True)
sum_data = sum(int_data)
thr = sum_data / (4 * M)

flag = True
for i in range(M):
    if int_data[i] < thr:
        flag = False

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

Submission status: Accepted

Solution code:
l = input()
m = input()
z = l.split(' ')
M = int(z[1])
N = int(z[0])
F = m.split(' ')
X = []
 
for item in F:
  votes = int(item)
  X.append(votes)

S = sum(X)
C = (S/(4*M))
X.sort(reverse=True)
if X[M-1]<C:
  print("No")
else:
  print("Yes")

Submission status: Accepted

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

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

Submission status: Accepted

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

counter = 0

for i in an:
  if i >= sum(an)/(4*m):
    counter += 1
    
if counter >= m:
  print('Yes')
else:
  print('No')

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys
import math
from bisect import bisect_left
from bisect import bisect_right
import collections
import copy
import heapq
from collections import defaultdict
from heapq import heappop, heappush
import itertools
input = sys.stdin.readline
from collections import defaultdict
from heapq import heappop, heappush

from decimal import *

##### リストの 二分木検索 #####
# bisect_left(lists, 3)
# bisect_right(lists, 3)

##### プライオリティキュー #####
# heapq.heapify(a) #リストaのheap化
# heapq.heappush(a,x) #heap化されたリストaに要素xを追加
# heapq.heappop(a) #heap化されたリストaから最小値を削除＆その最小値を出力

# heapq.heappush(a, -x) #最大値を取り出す時は、pushする時にマイナスにして入れよう
# heapq.heappop(a) * (-1) #取り出す時は、-1を掛けて取り出すこと

##### タプルリストのソート #####
# sorted(ans) #(a, b) -> 1st : aの昇順, 2nd : bの昇順
# sorted(SP, key=lambda x:(x[0],-x[1])) #(a, b) -> 1st : aの昇順, 2nd : bの降順
# sorted(SP, key=lambda x:(-x[0],x[1])) #(a, b) -> 1st : aの降順, 2nd : bの昇順
# sorted(SP, key=lambda x:(-x[0],-x[1])) #(a, b) -> 1st : aの降順, 2nd : bの降順

# sorted(SP, key=lambda x:(x[1])) #(a, b) -> 1st : bの昇順
# sorted(SP, key=lambda x:(-x[1])) #(a, b) -> 1st : bの降順

##### 累乗 #####
# pow(x, y, z) -> x**y % z

def inputInt(): return int(input())
def inputMap(): return map(int, input().split())
def inputList(): return list(map(int, input().split()))

inf = float('inf')
mod = 1000000007

#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-

def main():
	N,M = inputMap()
	A = inputList()

	toto = 0
	for i in A:
		toto += i

	ans = 0
	toto = toto * (1/(4*M))
	for i in A:
		if i < toto:
			pass
		else:
			ans += 1

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

#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
# nCr mod m
# rがn/2に近いと非常に重くなる
def combination(n, r, mod=10**9+7):
    r = min(r, n-r)
    res = 1
    for i in range(r):
        res = res * (n - i) * modinv(i+1, mod) % mod
    return res

# mを法とするaの乗法的逆元
def modinv(a, mod=10**9+7):
    return pow(a, mod-2, mod)

def egcd(a, b):
    if a == 0:
        return b, 0, 1
    else:
        g, y, x = egcd(b % a, a)
        return g, x - (b // a) * y, y

# nHr mod m
# 問題によって、combination()を切り替えること
def H(n, r, mod=10**9+7):
	# comb = Combination(n+r-1, mod)
	# return comb(n+r-1, r)
    return combination(n+r-1, r, mod)

class Combination:
    """
    O(n)の前計算を1回行うことで，O(1)でnCr mod mを求められる
    n_max = 10**6のとき前処理は約950ms (PyPyなら約340ms, 10**7で約1800ms)
    使用例：
    comb = Combination(1000000)
    print(comb(5, 3))  # 10
    """
    def __init__(self, n_max, mod=10**9+7):
        self.mod = mod
        self.modinv = self.make_modinv_list(n_max)
        self.fac, self.facinv = self.make_factorial_list(n_max)

    def __call__(self, n, r):
        return self.fac[n] * self.facinv[r] % self.mod * self.facinv[n-r] % self.mod

    def make_factorial_list(self, n):
        # 階乗のリストと階乗のmod逆元のリストを返す O(n)
        # self.make_modinv_list()が先に実行されている必要がある
        fac = [1]
        facinv = [1]
        for i in range(1, n+1):
            fac.append(fac[i-1] * i % self.mod)
            facinv.append(facinv[i-1] * self.modinv[i] % self.mod)
        return fac, facinv

    def make_modinv_list(self, n):
        # 0からnまでのmod逆元のリストを返す O(n)
        modinv = [0] * (n+1)
        modinv[1] = 1
        for i in range(2, n+1):
            modinv[i] = self.mod - self.mod//i * modinv[self.mod%i] % self.mod
        return modinv

if __name__ == "__main__":
	main()

Submission status: Accepted

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

Submission status: Accepted

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

result = 'No' if A[M-1] < sum(A) / (4 * M) else 'Yes'
print(result)

Submission status: Accepted

Solution code:
N,M=map(int,input().split())
A=[int(e) for e in input().split()]
A.sort(reverse=True)
S=sum(A)
count=0
for i in range(N):
    if A[i]>=S/(4*M):
        count+=1
if count>=M:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import numpy as np

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

a = np.array(input().split(), dtype='int')

sum_a = np.sum(a)

b = np.sort(a)[::-1]

if b[m-1] >= sum_a / 4 / m:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N, M = map(int, input().split())
A = list(map(int, input().split()))
A.sort(reverse=True)
S = sum(A)
cnt = 0
for i in range(M):
    if (A[i] < S/(4*M)):
        cnt += 1
if (cnt>=1):
    print("No")
else:
    print("Yes")

Submission status: Accepted

Solution code:
def main():
    n, m = map(int,input().split())
    a = list(map(int,input().split()))
    count = 0
    all = sum(a)
    for a_i in a:
        if 4 * m * a_i >= all:
            count += 1
    if count >= m:
        print("Yes")
    else:
        print("No")


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
n, m= input().split()
n, m= int(n), int(m)
eq=0
soma=0
cont=0
lista=[]
for x in input().split():
	x= int(x)
	lista.append(x)
	soma+=x

eq= soma/(4*m)
for x in range(n):
	if lista[x] >= eq:
		cont+=1

if cont < m:
	print('No')
else:
	print('Yes')

Submission status: Accepted

Solution code:
def solve():
    n,m = map(int,input().split())
    a = tuple(map(int,input().split()))
    s = sum(a)
    level = (s+4*m-1)//(4*m)
    cnt = 0
    for i in a:
        if i>=level:
            cnt+=1
    if cnt>=m:
        print('Yes')
    else:
        print('No')
if __name__=='__main__':
    solve()

Submission status: Accepted

Solution code:
a=input().split(" ")
n=int(a[0])
m=int(a[1])
b=input().split(" ")
num=[]
total=0
for i in range(n):
    num.append(int(b[i]))
    total+=int(b[i])
num=sorted(num,reverse=True)

if num[m-1]>=total/(m*4):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
# coding: utf-8
DATA = """
12 3
4 56 78 901 2 345 67 890 123 45 6 789
""".split("\n")

def get_debug_line():
	for i in DATA:
		yield i

if 1:
	get_line = input
else:
	get_line = get_debug_line().__next__
	get_line()

N, M = [int(i) for i in get_line().strip().split(" ")]
A = [int(i) for i in get_line().strip().split(" ")]
total = sum(A) / (4 * M)

count = 0
for v in A:
	if v >= total:
		count += 1

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

Submission status: Accepted

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

Submission status: Accepted

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

import numpy as np
N, M = map(int, input().split())
A = list(map(int, input().split()))

A = np.array(A)

num = np.sum(A >= np.sum(A)/(4*M))

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N, M = map(int, input().split())
A = [int(n) for n in input().split()]
A.sort(reverse=True)
total = 0
for x in A:
    total += x
if A[M - 1] / total >= 1 / 4 / M:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
N,M=map(int,input().split())
C=input().split()
A=[int(a) for a in C]
whole=sum(A)
B=[a for a in A if a>=whole/4/M]
if len(B)>=M:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

border = sum(a)/(4*m)
c = 0

for ai in a:
    if ai >= border:
        c += 1

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline

def linput():
    return [int(x) for x in input().split()]

n, m = linput()
a = linput()

cnt = 0

for i in a:
    if sum(a) <= 4*m*i:
        cnt += 1

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

Submission status: Accepted

Solution code:
n,m=map(int,input().split())
L=sorted(list(map(int,input().split())),reverse=True)
print('Yes' if all([L[i]*m*4>=sum(L) for i in range(m)]) else 'No')

Submission status: Accepted

Solution code:
import sys 
N, M = map(int, input().split())
A = list(map(int, input().split()))  
A = sorted(A,reverse=True)
for i in range(M):
    if A[i] < sum(A)*1/(4*M):
        #print(A[i],sum(A)*1/(4*M))
        print('No')
        sys.exit()
print('Yes')
#print(sum(A)*1/(4*M))

Submission status: Accepted

Solution code:
n,m = map(int, input().split(' ')) 
lis= [int(x) for x in input().split(' ')]
limit=sum(lis)/(4*m)
result = list(filter(lambda x: x >=limit, lis) )
if(len(result)>=m):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
n, m= map(int, input().split())
List = [int(i) for i in input().split()]
num = 0
i = 0
L_sum = sum(List)
while i < len(List):
    if List[i] >= (1/(4*m))*L_sum:
        num += 1
    i += 1
if num >= m:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

total = sum(A)
A = sorted(A, reverse=True)

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

Submission status: Accepted

Solution code:
# coding: utf-8
N, M = map(int, input().split())
votes = list(map(int, input().split()))
total = sum(votes)
limit = total / (4 * M)
votes.sort(reverse=True)
count = 0
for i in votes:
    if i >= limit:
        count += 1
    else:
        break

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

Submission status: Accepted

Solution code:
# coding: utf-8
N, M = map(int, input().split())
votes = list(map(int, input().split()))
total = sum(votes)
limit = total / (4 * M)
count = 0
for i in votes:
    if i >= limit:
        count += 1

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b = map(int,input().split())
c = list(map(int,input().split()))
sum = 0
for i in c:
  sum = sum + i
vote = (1/(4*b))*sum
count = 0
for j in c:
  if j>=vote:
    count = count + 1

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

Submission status: Accepted

Solution code:
n,m=map(int,input().split())
ax = list(map(int,input().split()))
allnum = sum(ax)
ax=[a for a in ax if a >= allnum/(4*m)]

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

Submission status: Accepted

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

count = 0
S = sum(A)

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

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

else:
    print("No")

Submission status: Accepted

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

asum = sum(a)
cnt = 0
for it in a:
    if not (it < asum/(4*m)): cnt += 1

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

Submission status: Accepted

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

B = sorted(list(A),reverse = True)
#print(B)
S = int(sum(B))
if B[M-1]>= S/(4*M):
    print('Yes')
else :
    print('No')

Submission status: Accepted

Solution code:
n, m = map(int, input().split())
A = [int(x) for x in input().split()]
A_in = []
for a in A:
    if a >= sum(A)/(4*m):
        A_in.append(a)
if len(A_in) >= m:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n,m=map(int,input().split())
a=list(map(int,input().split()))
a.sort()
print(['Yes','No'][a[n-m]<sum(a)/4/m])

Submission status: Accepted

Solution code:
n, m = list(map(int, input().rstrip().split()))
al = list(map(int, input().rstrip().split()))
al.sort(reverse=True)
total = sum(al)
least = total * (1 / (4 * m))
result = 'Yes'
for i in range(m):
    if al[i] < least:
        result = 'No'
        break

print(result)

Submission status: Accepted

Solution code:
num = []
vote = []
num = list(map(int,input().split()))
vote = list(map(int,input().split()))
N = num[0]
M = num[1]
j = sum(vote)/(4*M)
#print(j)

cnt = 0
for i in vote:
    if  i>=j:
        cnt += 1
    else:
        pass
#print(cnt)
if M<=cnt:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
import math
import sys
N,M=map(int,input().split())
A=list(map(int,input().split()))
S=sum(A)
cnt=0
for i in range(N):
    #print(A[i], 1 / 4 / M * S)
    if A[i] >= 1/4/M*S:
        #print(A[i],1/4/M*S)
        cnt+=1
if cnt>=M:
    print("Yes")
else:
    print("No")
#print(cnt)

Submission status: Accepted

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

a.sort()
a.reverse()

suma = sum(a)

for i in range(m):
    if a[i] < suma / (4 * m):
        print('No')
        break
else:
    print('Yes')

Submission status: Accepted

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
print("Yes" if ans >= M else "No")

Submission status: Accepted

Solution code:
n, m = map(int, input().split())
a_list = list(map(int, input().split()))
a_list.sort(reverse=True)
sum = 0
for i in a_list:
    sum+=i
index = 0
while index<m:
    if a_list[index]<(sum/(4*m)):
        print("No")
        exit()
    index+=1
print("Yes")

Submission status: Accepted

Solution code:
import sys
 
nm=input().split()
a=input().split()
n=int(nm[0])
m=int(nm[1])
lista=[]
for i in a:
  lista.append(int(i))
count=0
suma=sum(lista)
thre=suma/4/m
for i in lista:
  if i >= thre:
    count+=1
  if count >= m:
    print('Yes')
    sys.exit()
print('No')

Submission status: Accepted

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

count=0
nsum=sum(fam)

for x in fam:
    if x>=nsum/(4.*m):
        count+=1

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

Submission status: Accepted

Solution code:
#B

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

a.sort(reverse = True)

if a[m-1] >= sum(a)/(4*m):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
def main():
    n, m  = [int(x) for x in input().split(" ")]

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

    sum = 0

    for i in arr:
        sum += i

    arr.sort()

    if (arr[n-m] < sum/(4*m)):
        print("No")
    else:
        print("Yes")

main()

Submission status: Accepted

Solution code:
N,M = map(int,input().split())
Data = list(map(int,input().split()))
Sum = sum(Data)
cnt = 0
for d in Data:
    if d * 4 * M >= Sum:
        cnt += 1
if cnt >= M:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
from __future__ import print_function

import sys

import re
import array
import copy
import functools
import operator

import math
import string
import fractions
from fractions import Fraction
from fractions import gcd
# fractions.gcd() を用いること
# math.log2()はatcoderでは対応していない．留意せよ．

import collections
import itertools
import bisect

import random
import time

import heapq
from heapq import heappush
from heapq import heappop
from heapq import heappushpop
from heapq import heapify
from heapq import heapreplace
from queue import PriorityQueue as pq
from queue import Queue

from itertools import accumulate

from collections import deque
from collections import Counter

from operator import mul
from functools import reduce

input = sys.stdin.readline


def eprint(*args, **kwargs):
    print(*args, file=sys.stderr, **kwargs)
    return


def lcm(n, m):
    return int(n * m / gcd(n, m))


def coprimize(p, q):
    common = fractions.gcd(p, q)
    return (p // common, q // common)


def combinations_count(n, r):
    r = min(r, n - r)
    numer = reduce(mul, range(n, n - r, -1), 1)
    denom = reduce(mul, range(1, r + 1), 1)
    return numer // denom


def find_gcd(list_l):
    x = reduce(gcd, list_l)
    return x


def main():
    n,m = map(int,input().strip().split())
    a = list(map(int, input().strip().split()))
    a.sort(reverse=True)
    eprint('a ',end=':\n')
    eprint(a)
    eprint('sum(a)/(4*m) ',end=':\n')
    eprint(sum(a)/(4*m))
    if a[m-1] >= sum(a)/(4*m) :
        print("Yes")
    else:
        print("No")


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

total_votes=sum(a)
over_votes=0

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

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

Submission status: Accepted

Solution code:
def main():
    N, M = map(int, input().split(' '))
    An = list(map(int, input().split(' ')))
    thres = sum(An) / (4 * M)
    
    count = 0
    for a in An:
        if not thres > a:
            count += 1
            
    if count >= M:
        print('Yes')
    else:
        print('No')
    
    
    
    
main()

Submission status: Accepted

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

Submission status: Accepted

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

total_votes = sum(A)
is_over_thresh = [ai >= total_votes/(4*M) for ai in A]

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

Submission status: Accepted

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

A.sort(reverse=True)

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-


def run():
    n, m = map(int, input().split())
    a = list(map(int, input().split()))[:n]
    b = sum(a) / (4 * m)

    if len(list(filter(lambda x: x >= b, a))) >= m:
        print('Yes')
    else:
        print('No')


if __name__ == '__main__':
    run()

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

B_n=sorted(A_n,reverse=True)

if B_n[M-1] >= sum(B_n)/(4*M) :
    print('Yes')
else:
    print('No')