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())
listA = list(map(int,input().split()))
sumA = sum(listA)
tfList = []
listA.sort(reverse=True)
for i in range(m):
    if listA[i] >= sumA / (4*m):
        tfList.append('t')
    else:
        tfList.append('f')

if 'f' in tfList:
    print('No')
else:
    print('Yes')

Submission status: Accepted

Solution code:
n, m = map(int, input().split())
a = list(map(int, input().split()))
s=0
can=0
for b in a:
    s+=b 

for c in a:
    if c >= s / (4*m):
        can+=1

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

Submission status: Accepted

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

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

Submission status: Accepted

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

k = sum(l)/(4*m)

count = 0
for a in l:
    if a >= k:
        count += 1

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

Submission status: Accepted

Solution code:
inputs = input().split(' ')
inputs2 = input().split(' ')
inp1=[int(a) for a in inputs]
inp2=[int(a) for a in inputs2]

# inp1 = [12,3]
# inp2 = [4,56,78,901,2,345,67,890,123,45,6,789]


sums = sum(inp2)
rest = 1/(4*inp1[1])

inp2.sort()
inp2.reverse()

result = []

for i in range(inp1[1]):

	if inp2[i] > sums*rest or inp2[i] == sums*rest:
		result.append(int(inp2[i]))



if len(result)>inp1[1] - 1:
	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)

b = 0
for i in a:
    b += i
c = b * (1 / (4 * m))

for j in range(m):
    if a[j] < c:
        print('No')
        exit()

print('Yes')

Submission status: Accepted

Solution code:
x,y = map(int,input().split())
li = list(map(int,input().split()))
S = 0
for i in range(len(li)):
    S += li[i]
li.sort(reverse=True)
if li[y-1] >= S / (4*y):
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

top_vote_ls = []
selectable = (1/(4*m))*sum(vote_ls)

for i in range(0, m):  
  max = 0
  for j in range(len(vote_ls)):      
    if vote_ls[j] > max: 
      max = vote_ls[j]; 
  vote_ls.remove(max); 
  if max >= selectable:
    top_vote_ls.append(max) 

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

Submission status: Accepted

Solution code:
N, M = map(int, input().split())
A = list(map(int, input().split()))
sorted_A = sorted(A, reverse=True)
guard = sum(A) / (M * 4)
count = 0
for i in range(M):
    if sorted_A[i] >= guard:
        count += 1

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

A_sorted = sorted(A, reverse=True)

A_sum = sum(A)

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys, random, itertools, math
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt
def LI(): return list(map(int, input().split()))
def LF(): return list(map(float, input().split()))
def LI_(): return list(map(lambda x: int(x)-1, input().split()))
def II(): return int(input())
def IF(): return float(input())
def S(): return input().rstrip()
def LS(): return S().split()
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = 1e10

#solve
def solve():
    n, m = LI()
    a = LI()
    suma = sum(a)
    m4 = suma / 4 / m
    ans = 0
    for i in a:
        if i >= m4:
            ans += 1
    print("Yes" if ans >= m else "No")
    return


#main
if __name__ == '__main__':
    solve()

Submission status: Accepted

Solution code:
nums1=[int(e) for e in input().split()]
nums2=[int(t) for t in input().split()]
all_vote = 0
sums = nums1[0]
for num in nums2:
  all_vote += num
for k in nums2:
  if (k/(all_vote) < 1/(4*nums1[1])):
    sums-=1
if(nums1[1]<=sums):
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
import math
n,m = list(map(int,input().split()))
a = list(map(int,input().split()))
t = sum(a)
c = 0
f = 0
for i in range(n):
	if a[i] >= math.ceil(t/(4*m)):
		c += 1

if c>=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.sort()
A.reverse()
border=sum(A)/(4*M)
for a in A[:M]:
    if a<border:
        print("No")
        break
else:
    print("Yes")

Submission status: Accepted

Solution code:
def main():
  
  n,m = map(int, input().split())
  A = sorted([int(x) for x in input().split()],reverse=True)
  
  asum = 0
  for a in A:
    asum += a
   
  if(A[m-1]>=asum/(4*m)):
    print("Yes")
  else:
    print("No")
  return 0
 
if __name__ == "__main__":
  main()

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]"):
    sum = 0
    count = 0
    for i in A:
        sum += i


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

    if count >= 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()))
a.sort(reverse=True)
s=0
b=True
for i in a:
  s+=i

  
for i in range(0,m):
  if a[i]>=s/4/m:
    b=True
  else:
    b=False
    
if b:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
import sys

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

sou = sum(a)
list.sort(a, reverse=True)

for i in range(m):
    if a[i] < sou/(4*m):
        print('No')
        sys.exit()
print('Yes')

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
[n, m] = list(map(int, input().split()))
votes = list(map(int, input().split()))
sumOfVotes = 0
largest = [0 for i in range(m)]

for v in votes:
  sumOfVotes += v
  if (largest[0] < v):
    largest[0] = v
    largest.sort()

if largest[0] * 4 * m < sumOfVotes:
  print("No")
else:
  print("Yes")

Submission status: Accepted

Solution code:
n,m = map(int, input().split())
a = list(map(int, input().split()))
flag = False
allVote = sum(a)
a.sort(reverse=True)
counter = 0

for i in range(n):
  if allVote/4 <= a[i]*m:
    counter +=1 
  else:
    break


if counter >= m:
  flag = True

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

Submission status: Accepted

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

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

judge = 1/(4*M)
count = 0


for i in range(M):
  if A[i] < judge*All:
    count += 1
    break

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
nm = input().split(" ")
alot = input().split(" ")

n = int(nm[0])
m = int(nm[1])

sum = 0
for i in range(n):
    sum = sum + int(alot[i])

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

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

Submission status: Accepted

Solution code:
N , M = input().split()
array = input().split()
flag = 0

N = int(N)
M = int(M)

iarray = []

for i in array:
    iarray.append(int(i))

total = sum(iarray)

for i in iarray:
    if i >= total/(4*M):
        flag += 1
if flag >= M:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

sum_A = sum(A)
SA = sorted(A,reverse=True)
cnt  = 0
f = 0
ck = 1/(4 * M)
for i in range(0,N):
    if SA[i]/sum_A < ck:
        break
    else:
        cnt +=1
        if cnt == M:
            f = 1
            break
if f == 1:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
import sys
readline = sys.stdin.readline
n,m = map(int,readline().rstrip().split())
s = readline().rstrip().split()
total = 0
for i in s:
  total+=int(i)
cnt =0
for i in s:
  if int(i) >= total/(4*m):
    cnt+=1
if cnt >= m:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
n, m = input().split()
l = sorted(list(map(int, input().split())))
sum_touhyou = sum(l)
line_touhyou = sum_touhyou * (1 / (int(m) * 4))

r = [i for i in l if i >= line_touhyou]

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

Submission status: Accepted

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

all = list(map(int, input().split()))
all.sort(reverse=True)
flg = []
for i in range(m):
  if all[i] < (sum(all)*1/(4*m)):
      flg.append(False)
  else:
      flg.append(True)

if False in flg:
  print("No")
else:
  print("Yes")

Submission status: Accepted

Solution code:
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))

if __name__ == "__main__":
    N, M = map(int, input().split())
    A = sorted(LI(), reverse=True)
    sum = sum(A)
    if A[M-1] < sum/(4*M):
        print("No")
    else:
        print("Yes")

Submission status: Accepted

Solution code:
tmp = list(map(int, input().split()))
num = list(map(int, input().split()))

count = 0
b = sum(num)/(4*tmp[1])
for i in num:
    if i>=b:
        count+=1
        
if tmp[1]<=count:
    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)
OKcount=NOcount=0
for i in range (0,M):
    if A[i]>=sum(A)/(4*M):
        OKcount+=1
    else:
        NOcount+=1
if OKcount>0 and NOcount==0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:

first_input = list(map(lambda x:int(x), input().split(" ")))
second_input = list(map(lambda x:int(x), input().split(" ")))

second_input.sort(reverse=True)
criteria = sum(second_input)/float(4*first_input[1])

count = 0
for i in range(len(second_input)):
    if second_input[i]>=criteria:
        count = count+1
    else:
        break

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

Submission status: Accepted

Solution code:
n,m = map(int,input().split())
a = list(map(int, input().split()))
pop = list(filter(lambda e: e>=(1/(4*m))*sum(a),a))
print("Yes" if len(pop) >= m else "No")

Submission status: Accepted

Solution code:
N, M = map(int, input().split())
A = list(map(int,input().split()))
count = 0
total = 0
for i in range(N):
  total += A[i]
for j in range(N):
  if A[j] >= total / ( 4 * M ):
    count += 1
  else:
    pass
if count >= 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()]

popular = list(filter(lambda x: x >= (1/(4*m))*sum(a), a))

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

Submission status: Accepted

Solution code:
import sys

def main():

	S = 0
	N,M = map(int, input().split())
	Lists = list(map(int, input().split()))
	
	count = 0
	
	for List in Lists:
		S += List
	
	
	for List in Lists:
		if List >= S/4/M:
			count += 1
	
	if count >= M:
		print("Yes")
	else:
		print("No")
	
if __name__ == "__main__":
    main()

Submission status: Accepted

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

length = len(A)

for idx in range(len(A)):
    if A[idx] < sum(A)/(4*M):
        length -= 1

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

Submission status: Accepted

Solution code:
from decimal import Decimal

cnt, m = map(int, raw_input().split())
targets = map(int, raw_input().split())

limit = Decimal(str(sum(targets))) / Decimal(str(4 * m))

n = 0
for target in targets:
    if target >= limit:
        n += 1

print 'Yes' if n >= m else 'No'

Submission status: Accepted

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

#vote内の合計
sum = 0
for i in range(len(vote)):
    sum  = sum + vote[i]

#基準
j = sum/(4*M)

#基準を満たす品物の合計
num = 0
for i in range(len(vote)):
    if vote[i] >= j:
        num = num + 1
    else: continue

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

Submission status: Accepted

Solution code:
s = input().split()
i = s[0]
m = int(s[1])
count = 0
sun = 0
el = input().split()
for p in el:
    sun += int(p)
for k in el:
    if int(k) >= sun / (4 * m):
        count += 1
if count >= 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()]
A.sort(reverse=True)
votes = sum(A)
for i in range(M):
    if A[i]<votes/(4*M):
        print("No")
        break
else:
    print("Yes")

Submission status: Accepted

Solution code:
import math
import sys

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

a = input().split()
l_si_i = [int(b) for b in a]
#print(l_si_i)

#print(max(l_si_i))
#print(sum(l_si_i))

#border = math.floor(sum(l_si_i) / (4 * m))
border = sum(l_si_i) / (4 * m)
#print(border)

check = 0
for i in range(n):
  if l_si_i[i] >= border:
    check += 1
    
  if check >= m:
    print("Yes")
    sys.exit()
    
print("No")

Submission status: Accepted

Solution code:

def main():
    n,m = map(int,input().split())
    lst = list(map(int,input().split()))
    total = sum(lst)
    counter = 0
    for i in lst:
        if i >= total * (1 / (4 * m)):
            counter += 1

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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

base =float(sum(A)) / 4.0/M
cond = all([float(e) >= base for e in A[:M]])
ans = 'Yes' if cond  else 'No'
print(ans)

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)

for i in range(m):
    if a[i] >= sum_a/(4*m):
        continue
    else:
        print('No')
        exit()

print('Yes')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

#総投票数を取得
total = 0 
for i in range(n):
    total += a[i]

deadline = total / (4*m)

#M個選べるのか判定
cnt = 0
for i in range(n):
    if a[i] >= deadline:
        cnt += 1

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
n,m= list(map(int,input().split()))
A = list(map(int,input().split()))
d = sum(A)
    
A.sort(reverse=True)
for a in range(m):
    if A[a]< d/(4*m):
        d = 0
        break
if d == 0:print("No")
else: print("Yes")

Submission status: Accepted

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

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

a = sum(x>=float(sum(List)/(4*m)) for x in List)
print("Yes" if a >= 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()
if a[N-M] >= 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()))
sa = list(reversed(sorted(a)))

total=0
for i in range(n):
	total = total + sa[i]

score = 0
for i in range(m):
	if sa[i]>=total/(4*m):
		score = score +1
if score>=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 = 0
for i in range(N):
    s += a[i]
border = s/(4*M)
if a[M-1] < border:
    print('No')
else:
    print('Yes')

Submission status: Accepted

Solution code:
N, M = map(int, input().split())
A = sorted(map(int, input().split()))
A = A[::-1]
hyou = sum(A)
# print(A, hyou)
ok = True
if float(A[M-1]) < hyou/(4*M):
    ok = False
# print(A[M-1], hyou/4)
if ok:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from fractions import Fraction as F
n, m = map(int, input().split())
A = list(map(int, input().split()))
S = sum(A)
T = S * F(1, 4 * m)

cnt = 0
for a in A:
    if a >= T:
        cnt += 1

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

Submission status: Accepted

Solution code:
N, M = [int(x) for x in input().split()]
A = [int(x) for x in input().split()]
A = sorted(A, reverse=True)
total = sum(A)

f = True

for i in range(M):
    if total / (4 * M) > A[i]:
        f = False

if f == True:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

ls = list(map(int, input().split()))
ls = sorted(ls,reverse=True)
print("Yes" if ls[m-1]*4*m >=sum(ls) else "No")

Submission status: Accepted

Solution code:
import numpy as np

ll=list(map(int,input().split()))
case=np.array(list(map(int,input().split())))

case[::-1].sort()

total=np.sum(case)
line=total/4/ll[1]

target=case[ll[1]-1]

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

Submission status: Accepted

Solution code:
from operator import add
from functools import reduce

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

threshold = (1 / (4 * m)) * reduce(add, aa)
count = 0
for a in aa:
    if threshold <= a:
        count += 1
if m <= count:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
data = list(map(int, input().split()))
n = data[0]
m = data[1]
li = list(map(int, input().split()))
S = sum(li)
count=0
for i in li:
  if i < S*(1 / 4 / m):
    count+=1

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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


vote = map(int, raw_input().split())
total = sum(vote)
thres = 1/float(4*M)*total
cnt = 0
for v in vote:
    if v >= thres:
        cnt = 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())
 
an = list(map(int, input().split()))
 
an = np.array(sorted(an, reverse=True))
 
total = sum(an)
 
if sum(an[:m] >= (total / (4 * m))) >= 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())))
if len(A[A >= A.sum()/(4*M)])>=M:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

sumValue = sum(points)

candidates = [i for i in points if float(i) >= (sumValue/(4*m))]

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

Submission status: Accepted

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

if A[N-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()))
a.sort(reverse = True)
if a[m-1] >= sum(a)*0.25/m:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

sou = (1 / (4 * m)) * sum(a)
count = 0
for i in a:
    if i >= sou:
        count += 1

if m <= count:
    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)
jud = sm/(4*M)

b = 0
for i in A:
    if i >= jud:
        b = 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()))
a.sort(reverse = True)
#print(a)
status = True

goukei = sum(a)
c = goukei * 1/(4*m)

for _ in range(m):
    if a[0] >= c:
        a.pop(0)
    else:
        status = False

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

    sa = sum(A)
    cnt = 0
    x = sa // (4 * m) - 1 if sa % (4 * m) == 0 else sa // (4 * m)
    for a in A:
        if a > x:
            cnt += 1

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

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
from sys import stdin
from operator import itemgetter
import math
# stdin = open("sample.txt")

N,M = [int(x) for x in stdin.readline().rstrip().split()]

hyo = list(map(int,[int(x) for x in stdin.readline().rstrip().split()]))
sort_hyo = sorted(hyo, reverse=True)
point = sum(hyo)
target = math.ceil(point / (4*M))
for i in range(len(hyo)):
    if sort_hyo[i] >= target:
        sort_hyo[i] = "Yes"
    else:
        sort_hyo[i] = "No"
        
print(sort_hyo[M-1])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N,M=map(int,input().split())#N 種類の数 M 選ぶ品物の数
A=list(map(int,input().split()))#得票数

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

A=[i for i in A if i>=m]

if len(A)>=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)
pop=[]
l=Sum/(4*M)
for i in range(N):
    if(A[i]>=l):
        pop.append(A[i])
        
print("Yes" if len(pop)>=M else "No")

Submission status: Accepted

Solution code:
N,M=map(int,input().split())
a=map(int,input().split())
b=list(a)
b.sort()
c=sum(b)
if (b[-M]*4*M)>=c:
  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)
total_point = sum(A)

selectable = False

if total_point * (1 / (4 * M)) <= A[M-1]:
    selectable = True

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

Submission status: Accepted

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

Submission status: Accepted

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

as_ = sorted(as_, reverse=True)

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

Submission status: Accepted

Solution code:
nm = input().split(" ")
n = int(nm[0])
m = int(nm[1])
inputlist = list()
count = 0
total = 0
if n >= m and m >= 1 and n >= 1 and n <= 100 and m <= 100:
    inputlist = input().split(" ")
    for i in inputlist:
        total = total + int(i)
    con = total / (m *4)
    for i in inputlist:
        i = int(i)
        if i >= con:
            count = count + 1
        else:
            count = count
    if count >= m:
        print("Yes")
    else:
        print("No")
else:
    print()

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('No')
else:
  print('Yes')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# coding: utf-8
# import pprint
# import numpy as np
# import code
import functools

if __debug__:
    def debug(arg):
        pass
else:
    import sys
    def debug(arg):
        debug = lambda *x: None
        print(arg, file=sys.stderr)

n, m = (int(x) for x in input().split())
a = [int(x) for x in input().split()]
# d = dict.fromkeys(range(1, n), 0)
debug([m, n])
debug(a)

c = 0
t = sum(a)
debug(t)
s = t / (4 * m)
debug(s)
for aa in a:
    if aa >= s:
        c += 1
        if c >= m:
            print('Yes')
            exit()

# debug(c)
print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# 初期入力
N,M = (int(x) for x in input().split(" "))
A = list(map(int, input().split()))
A_sorted =sorted(A,reverse=True) #多い順にソート

#
pan_sum = sum(A)
if A_sorted[M-1] < pan_sum/4/M:
    print("No")
else:
    print("Yes")
"""
print(pan_sum)
print(A[M-1])
print(pan_sum/4/M)
"""

Submission status: Accepted

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