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())
A = list(map(int,input().split()))

j = sum(A)/4/M
count = 0

for i in range(N):
    if A[i] >= j:
        count += 1
        
if count >= M:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
import collections

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

A.sort(reverse = True)
cnt = 0
for i in range(M):
    if A[i] >= sum(A) * (1/(4*M)):
        cnt += 1

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

Submission status: Accepted

Solution code:
num_list = [int(i) for i in input().split()]
product_list = [int(i) for i in input().split()]

lim_score = sum(product_list) * (1/(4*num_list[1]))

ok_list = [i for i in product_list if i >= lim_score]

if len(ok_list) >= num_list[1]:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
from sys import stdin
 
input = stdin.readline
 
n, m = map(int, input().split())
a = [int(x) for x in input().split()]
vote = sum(a) / 4 / m
 
a.sort()
a.reverse()
 
print("Yes" if a[m - 1] >= vote else "No")

Submission status: Accepted

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

for i in range(n):

    if a[i]>=t:
        
        k+=1
if k>=m:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

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

all_ = sum(input_lines)

if len([i for i in input_lines if i>=(all_/(4*m))])>=m:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!python3.4.3

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

total = sum(A)

count = 0

for a in A:
  if not a < 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=list(map(int,input().split()))
a=sorted(a,reverse=True)
total=sum(a)
c=0
for i in a:
    if i>=(total/(4*m)):
        c+=1
    if c==m:
        print('Yes')
        exit()

print('No')

Submission status: Accepted

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

if np.sum(A >= A.sum() / 4 / M) >= M:
  print('Yes')
else:
  print('No')

Submission status: Accepted

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

total_vote = sum(a)
border = total_vote / (4*m)
ninki = sum(1 for ai in a if ai >= border)
if m <= ninki:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

A_sum = sum(A)
TH = A_sum/(4*M)

count=0
for i in A:
    if i >= TH:
        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()))
count=0
sum=0
for i in range(n):
  sum+=a[i]
min=sum/(4*m)
for i in range(n):
  if a[i]>=min:
    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()
a.reverse()

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
from sys import stdin, stdout


def read():
    x0 = stdin.readline().rstrip()
    return x0


def __main__():

    n, m = map(int, read().split())
    a = [int(i) for i in read().split()]

    sa = sum(a)
    min_p = sa / (4*m)

    b = 0
    for j in a:
        if j >= min_p:
            b += 1

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

__main__()

Submission status: Accepted

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

def solve():
    N, M = map(int, input().split())
    As = list(map(int, input().split()))

    total = sum(As)

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

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

if __name__ == "__main__":
    solve()

Submission status: Accepted

Solution code:
n, m = [int(a) for a in input().split(" ")]
alist = []
for i in input().split(" "):
    alist.append(int(i))
alist = sorted(alist, reverse=True)

chosen = alist[:m]
least = chosen[-1]
if least < sum(alist)/(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=0
for i in range (N):
  s+=a[i]
a.sort(reverse=True)
if s%(4*M)==0:
  if a[M-1]>=s//(4*M):
    print("Yes")
  else:
    print("No")
else:
  if a[M-1]>=(s//(4*M)+1):
    print("Yes")
  else:
    print("No")

Submission status: Accepted

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

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

if cnt >= M:
    ans = "Yes"
else:
    ans = "No"

print(ans)

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 = map(int, input().split())
A = list(map(int, input().split()))
A_sum = sum(A)
tmp = A_sum/4/M
A.sort()
if A[N-M] <tmp:
    print("No")
else:
    print("Yes")

Submission status: Accepted

Solution code:
import sys
import numpy as np

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

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

if __name__ == '__main__':
	main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
n, m = map(int, input().split())
a = sorted(list(map(int, input().split())), reverse=True)
for i in range(m):
    if a[i] < sum(a) * (1 / (4 * m)):
        print("No")
        exit()
print("Yes")

Submission status: Accepted

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

Submission status: Accepted

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

Solution code:
N, M = map(int, input().split())
a = list(map(int, input().split()))
a.sort(reverse=True)
total = sum(a)
tmp = 1 / (4 * M)
cnt = 0
for i in a:
    if i >= total * tmp:
        cnt += 1
    else:
        break
if cnt >= M:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
from sys import stdin
import math
import fractions

n, m = [int(x) for x in stdin.readline().rstrip().split()]
a = [int(x) for x in stdin.readline().rstrip().split()]

cnt = 0
suma = sum(a)

for aa in a:
    if aa  >= suma / 4 / m:
        cnt += 1

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

Submission status: Accepted

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

total = sum(A)

count = 0
for a in A:
    if a >= total / 4. / M:
        count += 1

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

Submission status: Accepted

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

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

a1 = sorted(a,reverse = True)
max_a = sum(a)

flag = 0
for i in range(m):
    if a1[i] * 4*m  >= max_a:
        pass
    else:
        flag = 1
if flag == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

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

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

alist.sort()

if alist[-m] >= sum(alist)/(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=sorted(a)[::-1]
s=sum(a)
print("Yes" if a[m-1]>=s/4/m else "No")

Submission status: Accepted

Solution code:
import sys
import numpy as np
import itertools
import collections
import math
from collections import deque

sys.setrecursionlimit(10**6)
readline = sys.stdin.readline

h = itertools.combinations_with_replacement
p = itertools.permutations

def main():
    # input
    N, M = map(int, input().split())
    A = list(map(int, readline().split()))

    under = math.ceil(sum(A)/(4*M))
    #print(under)
    count = sum([1 for x in A if x >= under])

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


if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
#!python3

iim = lambda: map(int, input().rstrip().split())

def resolve():
    N, M = iim()
    A = list(iim())

    total = sum(A)
    M1, b = divmod(total, 4*M)
    if b == 0:
        M1 -= 1
    num = 0
    for ai in A:
        if ai > M1:
            num += 1
            if num >= M:
                print("Yes")
                return
    print("No")



if __name__ == "__main__":
    resolve()

Submission status: Accepted

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

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

index = A[M-1]

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

Submission status: Accepted

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

Submission status: Accepted

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

# initialization
a_sum = sum(A_list)
a_limit = a_sum / (4*M)
a_count = 0
is_ok = False

# search
for a in A_list:
    if a>=a_limit:
        a_count += 1

# output
if a_count>=M:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:

import math
import itertools
import statistics
#import numpy as np
import collections

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

#print(total)
p = total/(4*m)
count = 0

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


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

#print(p)
#print(count)

Submission status: Accepted

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

Solution code:
from math import ceil

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

s = ceil(sum(a)/(4*m))
a = sorted(a, reverse = 1)[:m]

for i in a:
    if i < s:
        print("No")
        break
else:
    print("Yes")

Submission status: Accepted

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

Solution code:
# 2020/04/04
# AtCoder Beginner Contest 161 - B

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

# Init
sump = 0
sump_m = 0

# Calc
for i in range(n):
    sump = sump + a[i]

a.sort()
a.reverse()

ans = 'Yes'
for i in range(m):
    if a[i] < sump / (4 * m):
        ans = 'No'

# Output
print(ans)

Submission status: Accepted

Solution code:
n,m=map(int,input().split())
a=list(map(int,input().split()))
ans=[]
s=sum(a)
for i in range(n):
    if a[i]>=s*1/(4*m):
        ans.append(a[i])
if len(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
if cnt>=m:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
import numpy as np
from sys import stdin


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


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

Submission status: Accepted

Solution code:
# B - Popular Vote

N, M = (int(i) for i in input().split())
A = [int(i) for i in input().split()]
A.sort(reverse=True)
V = 0

for a in A:
    V += a

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

boad = sum(a) * 1/(4*m)
a.sort(reverse=True)
count = 0
for i,a_ in enumerate(a):
    if a_ >= boad:
        count += 1
    if count == m:
        break

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
# coding: utf-8
n, m = map(int, input().split())
a = list(map(int, input().split()))
a.sort()
a = a[::-1]

s = sum(a) / (4*m)
if len([x for x in a if x >= s]) >= 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)
count = 0
for i in a:
    if s / (4 * m) <= i:
        count += 1

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

Submission status: Accepted

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

Submission status: Accepted

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

sort_a_list = sorted(a_list)[::-1]

for i, num in enumerate(range(m)):
    if sort_a_list[i] < sum(sort_a_list)/(4*m):
        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, reverse = True)
total = sum(A)

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

Submission status: Accepted

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

list.sort(reverse=True)
all = 0
for j in list:
    all += j

max = all/(M*4)
result = True

for i in range(M):
    if list[i] < max:
        result = False

if result == True:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
(n,m) = tuple(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:
# -*- coding: utf-8 -*-

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

total = sum(a)
thres = total/(4*m)

ct = 0
for i in a:
    if i >= thres:
        ct += 1

if ct >= 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)
p = [el for el in a if el >= (total/(4*m))]
if len(p) >= 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
al=0
for i in range(n):
    al+=a[i]
p=al/(4*m)
for i in range(n):
    if p<=a[i]:
        ans+=1
print("Yes" if m<=ans else "No")

Submission status: Accepted

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

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

for i in range(m):
    if max(a) < (sum/(4*m)):
        print("No")
        sys.exit()
    else:
        a.remove(max(a))
print("Yes")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N , M   = map( int , input().strip().split(" ") ) ;
L  = list ( map( int , input().strip().split(" ") ) ) ;
L.sort() ;
L.reverse() ;
s = sum( L ) ;

b = "Yes" ;
for x in range ( M ) :
	s1 = L[x] * 4 * M 
	if s1 < s :
		b = "No";
		break ;
print ( b ) ;

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import numpy as np
N,M=map(int,input().split())
A=np.array(list(map(int,input().split())))
ninki_array = A>=1/(4*M)*np.sum(A)
ninki_num = np.sum(ninki_array)
if ninki_num>=M:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

    return 'Yes' if c >= M else 'No'

print(solve())

Submission status: Accepted

Solution code:
n, m = [int(i) for i in input().split()]
a = [int(i) for i in input().split()]
s = sum(a)
if len(list(filter(lambda x:x>=s/(4*m), a))) >= 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
g=0
for i in range(n):
    g=g+a[i] 
for i in range(n):
    if a[i]>=g/(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()))
a.sort() 
if a[n-m] < sum(a) / (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)

tmp = sum(a) * (1 / (4 * m))
ans = 0

for i in a:
    if i >= tmp:
        ans += 1

    if i < tmp:
        break

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
input=sys.stdin.readline
#N = int(input())
#S = input()[:-1]
N,M = map(int,input().split())
#S,T = map(str,input().split())
A = list(map(int,input().split()))
#A = [int(input()) for _ in range(N)]
#S = [input() for _ in range(N)]
#A = [list(map(int,input().split())) for _ in range(N)]
A.sort(reverse = True)
s = 0
for i in A:
    s += i
a = A[M-1]
if a >= (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()))
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: Accepted

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

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
c=list(map(int,input().split()))
c.sort()
e=0
j=-1
u=1/(4*b)
for i in range(b):
  if c[j] < sum(c)*u:
    e+=1
  j-=1
if e==0:
  print('Yes')
else:
  print('No')

Submission status: Accepted

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

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

G=S/(4*M)

T=0
for j in range(N):
    if A[j]>=G:
        T+=1

if M<=T:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

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

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

test = 0
for a in A:
    if result <= a:
        test += 1

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

Submission status: Accepted

Solution code:
import sys
from math import sqrt
from collections import Counter, defaultdict

input = sys.stdin.readline


def I():
    return int(input())


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


def LI():
    return list(MI())


def LIN(n: int):
    return [I() for _ in range(n)]


inf = float("inf")
mod = 10 ** 9 + 7


def main():
    n, m = MI()
    a_list = LI()
    c = 0
    votes = sum(a_list)
    for a in a_list:
        if a >= votes / (4 * m):
            c += 1

    if c < m:
        print("No")
    else:
        print("Yes")
    pass


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

votes = sorted(votes, reverse=True)

votes_sum = sum(votes)

flag = True
border_line = votes_sum / (4 * M)
for i in range(M):
    if votes[i] < border_line:
        flag = False
        
if flag :
    print('Yes')
else :
    print('No')

Submission status: Accepted

Solution code:
n,m = map(int, input().split())
As = input().split()
suma = 0
for a in As:
  suma += int(a)
th = suma / (4.0 * m)
c = 0
for a in As:
  if int(a) >= th:
    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()))
b = sum(A)/(4*M)
c = len(list(filter(lambda x: x>=b, A)))
print("Yes" if c >= M else "No")

Submission status: Accepted

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

Solution code:
import sys
N,M = map(int,input().split())
A = list(map(int,input().split()))
ans = []
border = sum(A) * (1 / (4*M))
for i in range(M):
    max_a = max(A)
    
    if max_a == 0 or max_a < border:
        print('No')
        sys.exit()

    for j in range(N):
        if A[j] == max_a:
            A[j] = 0

print('Yes')

Submission status: Accepted

Solution code:
N,M=map(int,input().split())
A=(list(map(int,input().split())))
list.sort(A,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())
L=list(map(int,input().split()))
S=sum(L)
count=0
for i in range(N):
	if L[i]>=S/(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)
if A[M-1] >= sum(A)/(4*M):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
N,M = map(int,input().split())
List = list(map(int,input().split()))
List = sorted(List,reverse = True)
border = sum(List)/4/M
if List[M-1] < border:
  print('No')
  exit()
print('Yes')

Submission status: Accepted

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

S = sum(A)

i = 0
count = 0

while i < N:
    if A[i] >= S / (4*M):
        count += 1
    if count == M:
        print('Yes')
        exit()
    i += 1
print('No')

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
from sys import stdin


def main():
    N, M = [int(x) for x in stdin.readline().rstrip().split()]
    As = [int(x) for x in stdin.readline().rstrip().split()]
    S = sum(As)
    x = [a for a in As if (S / (4 * M)) <= a]
    print('Yes' if M <= len(x) else 'No')


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:

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

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

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

Submission status: Accepted

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


S = sum(l)
ss = S / (4*m)
c = 0
for i in range(n):
    if l[i] >= ss:
        c = 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 = sorted(A, reverse=True)
sumVote = int(sum(A))

flag = 1

for i in range(M):
    if A[i] < (sumVote / (4 * M)):
        flag = -1

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

Submission status: Accepted

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

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

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