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:
import numpy as np

# 入力
N,M = map(int,input().split())
A = np.array([int(x) for x in input().split()])
S = sum(A)/(4*M)

if np.count_nonzero(A>=S) >= 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 x in a:
    Sum += x
cnt = sum([1 if i * 4 * m >= Sum else 0 for i in a])
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()))
sum = 0
for x in a:
    sum += x
cnt = 0
for x in a:
    if(x * 4 * m >= sum):
        cnt += 1
        
if cnt >= m:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
import sys


def solve():
    readline = sys.stdin.buffer.readline
    mod = 10 ** 9 + 7
    n, m = list(map(int, readline().split()))
    a = list(map(int, readline().split()))
    sa = sum(a)
    cnt = 0
    for v in a:
        if v >= sa / (4 * m):
            cnt += 1
    print("Yes" if cnt >= m else "No")


if __name__ == '__main__':
    solve()

Submission status: Accepted

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

i2 = input().split()
a = [int(i2) for i2 in i2]
m2 = sum(a) / (4 * m)
c = sum([1 if i3 >= m2 else 0 for i3 in a])
print("Yes" if c >= m else "No", end='')

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
x = input().split()
y = input().split()



a = [int(i) for i in x]
b = [int(i) for i in y]

M = a[1]
s = sum(b)
c = 0
f = False

for i in b:
    if i >= ((1/(4*M)*s)):
        c += 1
    if c == M:
        print("Yes")
        f = True
        break

if not f:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
nm = input()
N = int(nm[:nm.index(" ")])
M = int(nm[nm.index(" ")+1:])
A = list(map(int,input().split()))
A.sort()
restriction = 1/(4*M)*sum(A)
string = "Yes"
for i in range(N-1,N-M-1,-1):
	if A[i]<restriction:
		string = "No"
		break;
print(string)

Submission status: Accepted

Solution code:
def main():
  n,m = [int(x) for x in input().split()]
  a = [int(x) for x in input().split()]
  total = sum(a)
  
  can_be_selected = list(filter(lambda x: x >= total/4/m, a))
  if len(can_be_selected) >= m:
    print("Yes")
  else:
    print("No")

main()

Submission status: Accepted

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

Submission status: Accepted

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

buf = input().split()
votes = [int(v) for v in buf]

numVotes = sum(votes)

ct = 0
for v in votes:
  if v >= numVotes/4.0/m:
    ct += 1
  if ct >= m:
    break
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()))
S = sum(A)
c = 0
for i in A:
  if i >= S / (4*M):
    c += 1
if c >= M:
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

s = sum(A) / 4 / M
c = sum(1 for a in A if a >= s)

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

Submission status: Accepted

Solution code:
n, m = input().split()
b = input().split()
sum = 0
for x in b:
    sum += int(x)
yy=0
for y in b:
    if int(y) >= sum/(4*int(m)):
        yy+=1
if yy < int(m):
    print("No")
else:
    print("Yes")

Submission status: Accepted

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

res = 0
for i in range(N):
    if arr[i] < (1/(4*M)*sum(arr)):
        res = res
    else:
        res += 1

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

s = sum(al)
t = s/(4.0*m)
res = 0
for a in al:
    if a>=t:
        res += 1

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

Submission status: Accepted

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

totalvotes = sum(As)
As.sort()
found = 0
for i in range(len(As)):
    if As[i] >= 1/(4*M)*(totalvotes):
        found += 1

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

Submission status: Accepted

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

l.sort()
if l[-M] >= sum(l)/4/M:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
n,m=map(int,input().split())
li=list(map(int,input().split()))
li.sort()
li.reverse()
N=sum(li)
M=m*4
x=int(li[m-1])
if x < N/M:
    print('No')
else:
    print('Yes')

Submission status: Accepted

Solution code:
nm = input().split(' ')
a = input().split(' ')
total = 0
count = 0

for n in a:
    total += int(n)

for n in a:
    if int(n) >= total / (4 * int(nm[1])):
        count += 1

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

Submission status: Accepted

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

k = 0

for i in votes:
    if i >= 1/(4*m) * sum(votes):
        k += 1

if k >= 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(reverse=True)
    total = sum(A)
    threshold = -(-total // (4*M))
    if A[M-1] >= threshold:
        print("Yes")
    else:
        print("No")


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

if sorted(A,reverse=True)[M-1]<sum(A)/4/M:
    print("No")
else:
    print("Yes")

Submission status: Accepted

Solution code:
N, M = map(int, input().split())
lst = [int(x) for x in input().split()]
total = sum(lst)
ret = 0
for x in lst:
    if x >= total / (4 * M):
        ret += 1

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

Submission status: Accepted

Solution code:
N, M = map(int, input().split())
A = list(map(int, input().split()))
soutouhyou = sum(A)
B = 1 / (4 * M)
C = soutouhyou * B
count = 0
for a in A:
  if a >= C:
    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()))

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

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

Submission status: Accepted

Solution code:
n, m = [int(i) for i in 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 = input().split()
N = int(N)
M = int(M)
count = 0
import numpy as np
a = np.array(input().split()).astype(int)
count = len(a[a>=a.sum()*(1/(4*M))])
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()))
B=[]
for i in A:
    if i>=sum(A)/(4*M):
        B.append(i)
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()))
Change=True
round=1
while Change:
    Change=False
    for i in range(N-1):
        if A[i+1]>A[i]:
            temp=A[i+1]
            A[i+1]=A[i]
            A[i]=temp
            Change=True
    round+=1
popular=A[0:M]
SUM=sum(A)
count=True
for j in range(M):
    if SUM*(1/(4*M))>popular[j]:
        count=False
if(count):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
#入力受け取り
N, M=map(int, input().split())
A=list(map(int, input().split()))

#Aを昇順でソート
A.sort()

#総投票数Sを求めておく
#A[-M]が得票数M番目の商品の得票数
S=sum(A)

if A[-M]>=S/(4*M): #A[-M]がS/(4*M)以上であれば人気商品を最低M個選べる('Yes')
    print('Yes')
else: #S/(4*M)未満であれば選べる人気商品はM個未満となる('No')
    print('No')

Submission status: Accepted

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

Submission status: Accepted

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

sum = 0

for i in Ai:
	sum += i

S = sorted(Ai,reverse=True)

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

Submission status: Accepted

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

ans=0
x=sum(l)
for i in l:
    if i*4*m>=x:
        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 = sorted(a, reverse=True)
all = sum(a)

if a[m-1] >= all / (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()]
sum = 0
for item in A:
  sum += item

for i in range(0, M):
  max = 0
  for item in A:
    if max < item:
      max = item
  if max >= sum/(4*M):
    A.remove(max)

if len(A) == N-M:
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

ct = 0
for i in v:
    if i>=t:
        ct += 1
        
if ct >= m:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
numbers = input()
numberVotes, numberItems = numbers.split(" ")

votes = input()
votes = votes.split(" ")
totalVotes = sum([int(x) for x in votes])
thrashold = (totalVotes/(4 * int(numberItems)))
filtered = list(filter(lambda item: int(item) >= thrashold, votes))
x = "No"
if len(filtered) >= int(numberItems):
  x = "Yes"
print(x)

Submission status: Accepted

Solution code:
import math
# お気楽ロジックが思い浮かばないので真っ当に解く
N, M = (int(x) for x in input().split(' '))
A = [int(x) for x in input().split(' ')]
# 基準となる閾値を求める
limen = math.ceil(sum(A) / ( M * 4))
# 閾値越えの値を全探索
ans = 0
for row in A:
  if row >= limen:
    ans += 1
# 回答
print( 'Yes' if ans >= M else 'No' )

Submission status: Accepted

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

count = 0
sum_A = sum(A)
for i in range(N):
  if A[i] >= sum_A*(1/(4*M)) :
    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()))
all_count = sum(A)
count = 0
for i in A:
    if i >= (all_count / (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())
A = input().split()
A = [int(i) for i in A]

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

for i in A:
  if i>=limit: flag += 1
    
if flag>=M: print('Yes')
else: print('No')

Submission status: Accepted

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

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

count = 0

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

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

Submission status: Accepted

Solution code:
def solve(N,M, array):
    sum_ = sum(array)
    array.sort()

    for i in range(N-1, N-M-1, -1):
        if array[i] < (1/(4*M))*sum_:
            return "No"

    return "Yes"


if __name__=="__main__":
    N, M = map(int, input().split())
    arr = list(map(int, input().split()))

    print(solve(N, M, arr))

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# Popular Vote
# https://atcoder.jp/contests/abc161/tasks/abc161_b

from sys import stdin, stdout

n, m = map(int, stdin.readline().split())
a = sorted(list(map(int, stdin.readline().split())), reverse=True)
items = 0
for item in a:
    if items >= m or item < sum(a) / (4 * m):
        break
    items += 1
if items >= m:
    stdout.write("Yes\n")
else:
    stdout.write("No\n")

Submission status: Accepted

Solution code:
N,M = (int(i) for i in input().split())
A = [int(i) for i in input().split()]
judge = sum(A)/(4 * M)
result = N
for i in range(N):
    if A[i] < judge:
        result -= 1
    if result < M:
        break
if result >= 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)

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

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

Submission status: Accepted

Solution code:
check=True
a,b=map(int,input().split())
l=list(map(int,input().split()))
l.sort()
l.reverse()
point=sum(l)/(4*b)
for i in range(b):
    if l[i]<point:
        check=False
        break
if check:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

x = max(a)
s = 0
for i in a:
    s += i
y = [l for l in a if l >=s/4/m]
if len(y) >=m:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

lis2=sorted(lis2,reverse=True)
sum1=sum(lis2)
count=0
for i in range(0,m):
  if(lis2[i]>=((1/(4*m))*sum1)):
    count=0
  else:
    count=1
    break
if(count==1):
  print("No")
else:
  print("Yes")

Submission status: Accepted

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

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

sum_votes = sum(A)

base_line = sum_votes / (4*M)

count = 0

for i in range(N):
    if A[i] >= base_line:
        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()))
count=0
min_ = (1/(4*M))*sum(A)

for each in A:
	if each >= min_:
		count+=1
if (count<M):
 	print("No")
else:
	print("Yes")

Submission status: Accepted

Solution code:
import math
import string
import collections
from collections import Counter
from collections import deque


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


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


def has_duplicates2(seq):
    seen = []
    for item in seq:
        if not(item in seen):
            seen.append(item)
    return len(seq) != len(seen)


def divisor(n):
    divisor = []
    for i in range(1, n+1):
        if n % i == 0:
            divisor.append(i)
    return divisor


# coordinates
dx = [-1, -1, -1, 0, 0, 1, 1, 1]
dy = [-1, 0, 1, -1, 1, -1, 0, 1]

nm = readints()
a = readints()
sum = 0
for i in range(nm[0]):
    sum += a[i]
touhyou = sum*(1/(4*nm[1]))
cnt = 0
for i in range(nm[0]):
    if a[i] >= touhyou:
        cnt += 1
if cnt >= nm[1]:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
n, m = map(int, input().split())
products = [int(s) for s in input().split()]
products.sort(reverse=True)

border = sum(products) / 4 / m

cnt = 0
ans = 'No'
for i in products:
    if border <= i:
        cnt += 1
        if cnt == m:
            ans = 'Yes'
            break

print(ans)

Submission status: Accepted

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

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:
n,m = map(int,input().split())
ary1 = list(map(int,input().split()))
sikii = sum(ary1)/(4.0*m)
kosuu = len([x for x in ary1 if float(x)>=sikii])
if kosuu >= m :
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

popular=[i for i in A if i>=sum(A)/(4*M)]

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

Submission status: Accepted

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

Submission status: Accepted

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

votes = input().split()
votes = [int(i) for i in votes]
votes.sort(reverse=True)

total = sum(votes)

valid = True
for i in range(m):
    if votes[i] < total/(4*m):
        valid = False
        break

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

Submission status: Accepted

Solution code:
x,y= list(map(int, input().split()))
i = list(map(int, input().split()))
i.sort(reverse=True)
k=sum(i)
flag=0
for j in range(x):
    if i[j]*4*y>=k:
        flag+=1
if flag<y:
    print("No")
else:
    print("Yes")

Submission status: Accepted

Solution code:
x,y= list(map(int, input().split()))
i = list(map(int, input().split()))
i.sort(reverse=True)
k=sum(i)
flag=0
if i[y-1]>=k/(4*y):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
n, m = [int(i) for i in input().split()]
data = sorted([int(i) for i in input().split()], reverse = True)
if data[m - 1] >= sum((data)) / (4 * 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)
count=0
for i in a:
    if i>=border:
        count+=1
if count>=m:
    print("Yes")
else : 
    print("No")

Submission status: Accepted

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

t = 0
s = sum(x for x in list_a)

for i in list_a:
    if i/s >= 1/(4*m):
        t += 1

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

Submission status: Accepted

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

item.sort(reverse=True)

s = sum(item)
res = 0
for i in range(n):
  if item[i] >= s / (4*m):
    res += 1
    if res >= m:
      print('Yes')
      break
  else:
    print('No')
    break

Submission status: Accepted

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

Submission status: Accepted

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

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

lim=sum(A)/(4*M)
cnt=0
for a in A:
  if a>=lim:
    cnt+=1
print(("No","Yes")[cnt>=M])

Submission status: Accepted

Solution code:
n, m = map(int, input().split())
a = list(map(float, input().split()))
A = sum(a) / (4 * m)
N = sum(x >= A for x in a)
print('Yes' if N >= m else '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)
if A[M-1] >=total/(4*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)
if a[m-1] >= sum(a)/(4*m):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
# from math import factorial,sqrt
# from itertools import permutations as permus
# from fractions import gcd
# from collections import deque,Counter
# from decimal import Decimal, getcontext
# # getcontext().prec = 1000
# # eps = Decimal(10) ** (-100)

import numpy as np
# from scipy.sparse.csgraph import shortest_path, dijkstra, floyd_warshall, bellman_ford, johnson
# from scipy.sparse import csr_matrix

# strlist = "abcdefghijklmnopqrstuvwxyz"
n,m = map(int,input().split())
# 配列入力の受け取り
# arrA = list(map(int,input().split()))
arrA = np.array(input().split(),dtype=np.int64)

arrA.sort()
arrA = arrA[::-1]
total = arrA.sum()

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

print(ans)
# print("{:.10f}".format(ans))
# print(*ans)   # unpackして出力。間にスペースが入る
# for row in board:
#     print(*row,sep="")    #unpackして間にスペース入れずに出力する

Submission status: Accepted

Solution code:
n, m = [int(x) for x in input().split()]
l = [int(x) for x in input().split()]
k = []
for i in l:
  if(i >= sum(l)/(4*m)):
    k.append(i)
if(len(k) < m):
  print("No")
else:
  print("Yes")

Submission status: Accepted

Solution code:
N,M=[int(x) for x in input().rstrip().split()]
A=[int(x) for x in input().rstrip().split()]
sum_A=sum(A)
cnt=0
for i in range(len(A)):
    if 4*M*A[i]<sum_A:
        continue
    else:
        cnt+=1
if M<=cnt:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n,m=map(int, input().split())
a=list(map(float, input().split()))
A=sum(a)/(4*m)
N=sum(x>=A for x in a)
if N>=m:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

A_total = sum(A)
B = sorted(A, reverse=True)
#print(B)
if B[M-1] < A_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()))
all = sum(A)
if all % (4 * M) != 0:
    cut = all // (4 * M)
else:
    cut = all // (4 * M) - 1
count = 0
for i in A:
    if i > cut:
        count += 1
if count >= 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(reverse=True)

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

    thr = all_num / (4*M)

    for i in range(M):
        if A[i] < thr:
            print("No")
            exit()
    
    print("Yes")

main()

Submission status: Accepted

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

sum = 0

for item in an:
  sum += item

num = 0

for item in an:
  if item >= sum / (4 * m):
    num += 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()))
g=0
count=0
for i in a:
    g+=i
b = float(1/(4*m))
for i in a:
    t = float(i/g)
    if t>=b:
        count+=1
    if count==m:
        print("Yes")
        exit()
if count < m:
    print("No")

Submission status: Accepted

Solution code:
n_and_m = list(map(int, input().split()))
n = n_and_m[0]
m = n_and_m[1]
items = list(map(int, input().split()))
REQUIRED = ( 1 / (4*m) ) * sum(items)
flag = 0

for item in items:
    if item >= REQUIRED:
        flag += 1

        

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

Submission status: Accepted

Solution code:
s=input()
nn=s.split()
n=int(nn[0])
m=int(nn[1])
s=input()
aa=s.split()
a=[]
tot=0
for i in range(0,len(aa)):
	a.append(int(aa[i]))
	tot+=a[i]
num=0
for i in a:
	if i>=tot/(4*m) :
		num+=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()))

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

Submission status: Accepted

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

Submission status: Accepted

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

vote = []
all = 0

for j in range(N):
    all += A[j]

for i in range(N):
    if A[i] >= all / (4 * M):
        vote.append(A[i])

if len(vote) >= M:
    print("Yes")

else:
    print("No")

Submission status: Accepted

Solution code:
N, M = map(int, input().split())
A = list(map(int, input().split()))
 
vote = []
all = 0
 
for j in range(N):
    all += A[j]
 
for i in range(N):
    if A[i] >= all / (4 * M):
        vote.append(A[i])
 
if len(vote) >= M:
    print("Yes")
 
else:
    print("No")

Submission status: Accepted

Solution code:
s=input()
p=input()
l1=s.split()
l2=p.split()
N=int(l1[0])
M=int(l1[1])
A=[int(l2[n]) for n in range(0,N)]
count=0
for i in range(0,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.sort(reverse=True)
if A[M - 1] * 4 * M < sum(A):
    print("No")
else:
    print("Yes")

Submission status: Accepted

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

a.sort(reverse=True)

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

Submission status: Accepted

Solution code:
def solve(n, m, a):
    return "No" if sorted(a)[-m] < sum(a) / (4*m) else "Yes"

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

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:
#!/usr/bin/env python3
import sys
input = sys.stdin.readline

n, m = map(int, input().split())
a = [int(item) for item in input().split()]

total = sum(a)
choosable = 0
for item in a:
    if item >= total / (4 * m):
        choosable += 1
    
if choosable >= m:
    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()))
c = ceil(sum(a) / (4 * m))
d = 0
for e in a:
    if e >= c:
        d += 1
        if d == m:
            print('Yes')
            exit(0)
print('No')

Submission status: Accepted

Solution code:
n ,m = map(int, raw_input().split())
A = sorted(list(map(int, raw_input().split())), reverse = True)
divider = sum(A) / (4.0 * m) 

stack = 0

for a in A:
    if a >= divider:
        stack += 1

if stack >= m:
    print 'Yes'
else:
    print 'No'

Submission status: Accepted

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

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

#Check availavle N
if count >= M:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
import numpy as np
N, M = list(map(int,input().split()))
A = np.zeros(N)
A = list(map(int,input().split()))
ans = 'Yes'
A = np.sort(A)[::-1]
su = np.sum(A)
if A[M-1] < su / (4*M):
    ans = 'No'
print(ans)

Submission status: Accepted

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

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

for i in range(N):
	if A[i] >= 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, = 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:
l = list(map(int, input().split()))
a = list(map(int, input().split()))
fla=True
n=sum(a)
a.sort(reverse=True)
if a[l[1]-1]>=n/(4*l[1]):
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
n,m=map(int,input().split())
arr=[int(x) for x in input().split()]
total = sum(arr)
ans=0
for item in arr:
	if item >= total/(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()))
counter = 0
border = sum(A)/(M*4)

for i in range(N):
  if A[i] >= border:
    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()))
S = sum(A)

A.sort(reverse=True)

if A[M-1] >= S/(4*M) :
	print("Yes")

else :
	print("No")