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 = [int(n) for n in input().split()]
A = sorted([int(n) for n in input().split()], reverse=True)
print('Yes' if len([m for m in A if m >= sum(A)/(4*M)]) >= M else 'No')

Submission status: Accepted

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]"):
    summation = sum(A)

    result = 0
    for n in range(N):
        if A[n] >= summation * (1 / (4 * M)):
            result += 1
    if result >= 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: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

count = 0
for i in range (N):
    if A[i] >= sum(A)/(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 = sorted(A,reverse=True)
k = sum(A)/(4*m)
for a in A[:m]:
    if a<k:
        print('No')
        exit()
print('Yes')

Submission status: Accepted

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]
for i in range(n):
    if a[i] >= sum / (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 = sorted(a, reverse=True)

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

Submission status: Accepted

Solution code:
N, M = [int(i) for i in input().split(" ")]
A = [int(i) for i in input().split(" ")]

A_sum = sum(A)
flag = 0
A_sorted = sorted(A, reverse=True)
for i in range(M):
    if A_sorted[i]<(A_sum * (1/(4*M))):
        flag = 1
        break
if flag == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
# Code for B - Popular Vote
# Use input() to fetch data from STDIN
[n, m] = map(int, input().split())
a = list(map(int, input().split()))

total = sum(a)

if len(list(filter(lambda x: x >= (total / (4 * m)), a))) >= m:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
N,M = map(int, input().split())
A = [int(n) for n in input().split()]

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

for a in A:
    if a >= t:
        c += 1
    else:
        continue

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()
asum = 0
for i in A: asum += i
if A[N-M]*4*M < asum:
    print("No")
else:
    print("Yes")

Submission status: Accepted

Solution code:
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("No")
else:
    print("Yes")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n, m, *a_n = map(int, open(0).read().split())

a = sorted(a_n, reverse = True)

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

Submission status: Accepted

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

Submission status: Accepted

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

    A.sort()
    A.reverse()
    for i in range(m):
        if A[i] < sum(A)*1/(4*m):
            print('No')
            return
    print('Yes')


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N,M = map(int,input().split())
As = list(map(int, input().split()))
sum_As  = sum(As)
solve = sum_As / (4*M)
c = 0
for x in range(N):
  if As[x] >= solve:
    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)
A.sort(reverse=True)
for i in range(m):
  if A[i]>=S/(4*m):
    pass
  else:
    print("No");exit()
print("Yes")

Submission status: Accepted

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

A = sorted(A)
limit = sum(A)/(4*M)

ans = 0
for a in A[-1::-1]:
    if a < limit:
        break
    else :
        ans += 1

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

Submission status: Accepted

Solution code:
k = list(map(int, input().split()))
a = list(map(int, input().split()))
kei = sum(a)
a = sorted(a,reverse=True)
re = True
for i in range(k[1]):
  if a[i] < kei / (4*k[1]):
    re = False

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

Submission status: Accepted

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

Submission status: Accepted

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 = [float(i) >= (total / (4.0 * m)) for i in a]
    result = len([r for r in selected if r])

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

Submission status: Accepted

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

A.sort(reverse=True)
cnt = 0
for a in A:
    #print(a)
    if a >= A_sum/(4*M):
        cnt += 1
    else:
        ans = "No"

    if cnt == M:
        ans = "Yes"
        break

print(ans)

Submission status: Accepted

Solution code:
N,M=map(int,input().split())
list = [int(i) for i in input().split()]
SUM = sum(list)
n = sum(x>=SUM/(4*M) for x in list)

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

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(len(A)):
    if A [i] < sum1/(4*M):
        A2[i] = 0
    else:
        A2[i] = 1

if sum(A2) < M:
    print("No")
else:
    print("Yes")

Submission status: Accepted

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

A = sorted(A)[::-1]
total = sum(A)
vote_need = total / (4 * M)

# print(A, total, vote_need)

c = 0
for a in A:
    if a >= vote_need:
        c += 1
    else:
        break
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()))

if sorted(a)[-m] >= 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()))

Asum = sum(A)
hyou = Asum * (1/(4*M))
count = 0
for i in A:
    if i >= hyou:
     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()))
total = sum(a)

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import bisect
N, M = map(int, input().split())
arr = sorted(map(int, input().split()))
sum_num = sum(arr)
th = sum(arr) / (4 * M)
idx = bisect.bisect_left(arr, th)
if N - idx >= M:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
k = list(map(int, input().split()))
a = list(map(int, input().split()))
n=k[0]
m=k[1]
d=0
e=0
for i in range (n):
    d+=a[i]

for j in range (n):
    if a[j]>=d/(4*m):
        e+=1

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

Submission status: Accepted

Solution code:
def calc(N, M, A):
    S = sum(A)
    n = len([x for x in A if x < S / 4 / M])
    if M <= N - n:
        return 'Yes'
    else:
        return 'No'



(N, M) = tuple([int(s) for s in input().split()])
A = [int(s) for s in input().split()]
print(calc(N, M, A))

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
# N = int(input())
N,M = map(int,input().split())
A_list = sorted(list(map(int,input().split())),reverse=True)
#print(A_list)
A_sum = sum(A_list)
is_selected = 1 / (4 * M) * A_sum
#print(is_selected)
for i in range(M):
    if A_list[i] >= is_selected:
        continue
    else:
        print('No')
        exit(0)
print('Yes')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# import math
n,m=map(int, raw_input().split())
arr=map(int, raw_input().split())
s=sum(arr)
arr.sort()
k=m
for i in xrange(n-1,-1,-1):
    if arr[i]>=s/(4.0*m) and k>0:
        k-=1
 
if k>0:
    print 'No'
else:
    print 'Yes'

Submission status: Accepted

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

sum_a = sum(a)
sort_a = sorted(a, reverse = True)
mmm = sort_a[m-1]
base = sum(a)/ (4 * m)

if mmm < base:
    print("No")
else:
    print("Yes")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n,m=map(float,input().split())
a=list(map(float,input().split()))
s=sum(a)
cnt=0
for item in a:
    if(item>=s/4/m):
        cnt+=1
print("Yes" if cnt>=m else "No")

Submission status: Accepted

Solution code:
N, M = [int(n) for n in input().split(' ')]
A = [int(n) for n in input().split(' ')]


A.sort(reverse=True)
total = sum(A)
j = 0
for i in range(N):
    if A[i]<(total/(4*M)):
        break
    else:
        j += 1
if j>=M:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

th = sum(la) / (4 * m)

ans = sum(list(map(lambda x: x >= th if 1 else 0, la)))

if ans >= 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
for i in a:
    if i * 4 * m >= sum(a):
        count += 1
    else:
        pass

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

Submission status: Accepted

Solution code:
import sys
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
read = sys.stdin.buffer.read
sys.setrecursionlimit(10 ** 7)

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

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

Submission status: Accepted

Solution code:
def popular_vote(n, m ,al):
    al.sort(reverse=True)
    sum = 0
    for a in al:
        sum += a
    # print(sum)
    if al[m-1] >= sum/(4.0*m):
        print('Yes')
    else:
        print('No')

n, m = [int(i) for i in input().split()]
al = [int(i) for i in input().split()]

popular_vote(n, m, al)

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10 ** 6)  # 再帰関数の再帰の深さを設定
to_index = lambda x: int(x) - 1  # 入力した数字に1を引いたものを返す
print_list_in_2D = lambda x: print(*x, sep="\n")  # リストの要素を改行を挟んで表示する関数

# 入力を整数に変換して受け取る
def input_int(): return int(input())

def map_int_input(): return map(int, input())

MII = map_int_input

def MII_split(): return map(int, input().split())

def MII_to_index(): return map(to_index, input())

def MII_split_to_index(): return map(to_index, input().split())

# 入力全てを整数に変換したものの配列を受け取る
def list_int_inputs(): return list(map(int, input()))

LII = list_int_inputs

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

# 2次元リスト化
def LII_2D(rows_number): return [LII() for _ in range(rows_number)]

def LII_split_2D(rows_number): return [LII_split() for _ in range(rows_number)]

import math
N, M = MII_split()
A_list = LII_split()
A_list.sort(reverse=True)
min_vote = math.ceil(sum(A_list) * 0.25 / M)

print('Yes' if len([x for x in A_list if x >= min_vote]) >= M else 'No')

Submission status: Accepted

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

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

Submission status: Accepted

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

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


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

Submission status: Accepted

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

a_list.sort(reverse=True)
sum_ = sum(a_list)
min_ = np.ceil(sum_/ (4*m))

count = 0
for i in range(n):
    if a_list[i] < min_:
        break
    count += 1

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

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)/(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()))

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

A_sort = sorted(A, reverse=True)

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

Submission status: Accepted

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

sum_vote = sum(a)
limit = sum_vote * (1 / (4 * m))

select = 0
for num in range(0, n):
  if a[num] >= limit:
    select += 1
    if select == m:
      print('Yes')
      exit()
print('No')

Submission status: Accepted

Solution code:
import itertools
import math
import fractions

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

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

Submission status: Accepted

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

sumA = sum(A)
ans_list = [0]*N
for i in range(N):
    if (A[i]/sumA)>=(1/(4*M)):
        ans_list[i] = 1
if ans_list.count(1) >= M:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

all=sum(A)

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

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

Submission status: Accepted

Solution code:
N, M = [int(s) for s in input().split()]
A = [int(s) for s in input().split()]
all_A = sum(A)
B = [True if Ai >= all_A/4/M else False for Ai in A]
if B.count(True) >= M:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
N, M, *A = map(int, open(0).read().split())

total = sum(A)
can_select_num = 0

for a in A:
    if a >= total/(4*M):
        can_select_num += 1

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

Submission status: Accepted

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

ts = sum(Al)/(4*M)
ans = 0
for A in Al:
    if(A>=ts):
        ans += 1

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
[N,M] = [int(s) for s in input().rstrip().split(' ')]
L = [int(s) for s in input().rstrip().split(' ')]
S = sum(L)
L.sort(reverse=True)
if L[M-1] * M *4 >= S:
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

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

L.sort(reverse=True)

# M 番目の数
M_num = L[M-1]

# 前得票数
A = sum(L)

if M_num < A/(4*M):
    print('No')
else:
    print('Yes')

Submission status: Accepted

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

total = sum(A)

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
readline = sys.stdin.buffer.readline
def even(n): return 1 if n%2==0 else 0

n,m = map(int,readline().split())
lst1 = list(map(int,readline().split()))
lst1.sort(reverse=True)

ans = 0
need = sum(lst1)/(4*m) #以上

for i in lst1:
    if i >= need:
        ans += 1


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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n, m = map(int, input().split())
nums = list(map(int, input().split()))
sm = sum(nums)
ssm = sum(4*m*x >= sm for x in nums)
print('Yes' if ssm >= m else 'No')

Submission status: Accepted

Solution code:
n, m = [int(i) for i in input().split(" ")]
a = [int(i) for i in input().split(" ")]
con = sum(a) / (4 * m)
r = [i for i in a if i >= con]

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N,M=[int(x) for x in input().split()]
A=[int(x) for x in input().split()]
su=sum(A)
count=N
for i in A:
    if 4*M*i<su:
        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()))

summ = sum(a)
minn = summ/(4*m)
count = 0
for i in range(0,n):
  if a[i] >= minn:
    count = 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)
K = 0
for i in range(N):
  K += a[i]
if(a[M-1]>=K/(4*M)):
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

Submission status: Accepted

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

a.sort(reverse=True)
if a[m-1] >= 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(reverse=True)
all_ = sum(a)
for i in a[:m]:
    if (i < (all_/4/m)):
        print('No')
        exit()
print('Yes')

Submission status: Accepted

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

t = sum(a)
s = 0
b = [a[i] >= t/(4*m) for i in range(n)]
if sum(b) >= m:
    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)
a=sorted(A, reverse=True)
ans="Yes"
for i in range(m):
  if a[i]<s/(4*m):
    ans="No"
print(ans)

Submission status: Accepted

Solution code:
def main():
    N, M = map(int, input().split(' '))
    A_list = list(map(int, input().split(' ')))
    A_sum = sum(A_list) / (4 * M)
    cnt = 0
    for a in A_list:
        if a >= A_sum:
            cnt += 1
            if A_sum <= cnt:
                break
    if cnt >= M:
        print('Yes')
    else:
        print('No')


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import collections
import itertools as it
import math
import numpy as np

#  = input()
#  = int(input())
N, M = map(int, input().split())
A = list(map(int, input().split()))
#  = [int(input()) for i in range(N)]
#
# c = collections.Counter()

c = 0
for a in A:
    # print((1/(4*M)) * sum(A))
    if (1/(4*M)) * sum(A) <= a:
        c += 1


# print(c, M)
print('Yes' if c >= M else 'No')

Submission status: Accepted

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

list.sort(A, 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())
an = [int(x) for x in input().split()]
s = sum(an)
an.sort(reverse=True)

if an[M-1] < s / (4*M):
    print("No")
else:
    print("Yes")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n,m=map(int,input().split())
a=list(map(int,input().split()))
ans=0
suma=sum(a)
k=suma/(4*m)
for i in a:
    if i>=k:
        ans+=1

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

Submission status: Accepted

Solution code:
nm = list(map(int, input().split()))
n = nm[0]
m = nm[1]
an = list(map(int, input().split()))


count = 0
for a in an:
  if a >= sum(an) / (4.0 * m):
    count += 1

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

Submission status: Accepted

Solution code:
# coding:utf-8

import sys
import math
import time
#import numpy as np
import collections
from collections import deque
from collections import Counter
import queue
import copy
import bisect
import heapq

#sys.setrecursionlimit(10**7)
#N, Q = map(int, input().split())
#G = [list(input()) for i in range(H)]
#INF = V * 10001
#A = [int(i) for i in input().split()]
#AB = [list(map(int, input().split())) for _ in range(K)]

N, M = map(int, input().split())
A = [int(i) for i in input().split()]
ans = 0

A.sort(reverse = True)

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

Submission status: Accepted

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


if __name__ == "__main__":
    resolve()

Submission status: Accepted

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

s = sum(A)
t = s / 4 / M
A = sorted(A, reverse=True)

flag = True
for i in range(M):
    if A[i] < t:
        flag = False
        break

print('Yes' if flag else 'No')

Submission status: Accepted

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

Submission status: Accepted

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

cnt = 0
for i in a:
    if i >= (sum(a)/(4*m)):
        cnt += 1
        #print(cnt)
if cnt >= 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)
count = 0
for a in A:
	if a < (total / (4*M)):
		continue
	count += 1
if count >= M:
	print("Yes")
else:
	print("No")

Submission status: Accepted

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

a.sort(reverse=True)

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

Submission status: Accepted

Solution code:
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:
# coding: utf-8
# Your code here!
import sys

sys.setrecursionlimit(10**9)

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

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

def check():
    for i in range(M):
        if A[i]*4*M < total:
            return 'No'
    return 'Yes'

print(check())

Submission status: Accepted

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

A_list = sorted(A_list, reverse=True)

sum_A = sum(A_list)

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

Submission status: Accepted

Solution code:
#
import sys
import math
import numpy as np
import itertools


# いくつか入力
n,m = (int(i) for i in input().split())

# 空白区切りの数列をリストに代入
a = [int(i) for i in input().split()] 

a=sorted(a,reverse=True)
total=0
for i in range(n):
    total += a[i]
for i in range(m):
    if a[i]<(total/4/m):
        print("No")
        exit()
print("Yes")

Submission status: Accepted

Solution code:
n, m = map(int, input().split())
a_list = list(map(int, input().split()))
total_m = sum(a_list)
r_list = []
for a in a_list:
	if a < total_m/(4*m):
		continue
	r_list.append(a)
r = 'No' if len(r_list) < m else 'Yes'
print(r)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N,m = [int(x) for x in input().split()]
a = [int(x) for x in input().split()]
wa = 0
for i in range(N):
  wa += a[i]
count = 0
x = wa /(m*4)
for i in range(N):
  if a[i] >= x:
    count += 1
if count >= m:
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

Submission status: Accepted

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

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

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

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

Submission status: Accepted

Solution code:
import numpy as np
N, M = map(int, input().split())
AA = np.array(list(map(int, input().split())))


S = sum(AA >= (sum(AA)/(4*M)))
if S >= M:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
n,m = (int(x) for x in input().split())
alist = [int(i) for i in input().split()]
ans = 0
arfa = sum(alist)/(4*m)

for i in range(n):
    if alist[i]>=arfa:
        ans += 1

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

Submission status: Accepted

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

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

c = 0
for i in A:
    if i >= p:
        c += 1

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