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: Runtime Error

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

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

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

Submission status: Runtime Error

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

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

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

Submission status: Runtime Error

Solution code:
n,m=map(int,input().split())
l1=list(map(int,input().split()))
l2=sorted(l1,reverse=True) #[5, 4, 2, 1]

a=l2[m]+1
l2_sum=sum(l2) #12

if a>=l2_sum/(4*m):
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import numpy as np

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

vote_arr = np.array(vote_lists)
total_vote = vote_arr.sum()
is_popular = total_vote / (4 * m)

answer_lists = []

for i in vote_lists:
  if i >= is_popular:
    answer_lists.append(i)

if len(answer_lists) >= m:
  print('Yes')
else:
  Print('No')

Submission status: Runtime Error

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

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

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

Submission status: Runtime Error

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

sum_a = sum(a)
a = a.sort()
cnt = 0
for i in a:
    if i >= 1 / (4*sum_a):
        cnt += 1
if cnt >= M:
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

Solution code:
n = [int(i) for i in input().split()]
a = [int(i) for i in input().split()]
count = 0
for i in a:
	if(i * 4 * n[1] >= n[0]):
    	count += 1
if(count >= n[1]):
	print('Yes')
else:
	print('No')

Submission status: Runtime Error

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

Submission status: Runtime Error

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

mmin = sum(A) * (4*M)
A.sort()

if A[m-1] < mmin:
  print('No')
else:
  print('Yes')

Submission status: Runtime Error

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

def vote(a,m):
  a.sort(reverse=True)
  if a[m-1] >= sum(a)/(4*m):
      return True
    else:
      return False
    
ans = "Yes" if vote(A,M) else "No"
print(ans)

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

if select == 1:
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

Solution code:
import numpy as np
import math
import collections
import fractions
import itertools

def mput(): return map(int, input().split())
def lput(): return list(map(int, input().split()))
def iput(): return int(input())

def solve():
    n, m = mput()
    a = lput()
    line = sum(A) / (4 * m)
    bit = 0
    for i in a:
        if i >= line:
            bit += 1
    if bit >= m:
        print("Yes")
    else:
        print("No")
    return 0

if __name__ == "__main__":
    solve()

Submission status: Runtime Error

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

all_sum = sum(a)
standard = all_sum/(4*M)
ans = 0

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

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

Submission status: Runtime Error

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

all_sum = sum(a)
standard = all_sum//(4*M)
ans = 0

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

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

Submission status: Runtime Error

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

all_sum = sum(a)
standard = all_sum//(4*M)
ans = 0

for i in a:
  if a[i] >= standard:
    ans += 1

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n,m = set(map(int, input().split()))
a = set(map(int,input().split()))
d = sum(a)/(4.0*m)
count = 0
for x in a:
    if x >= d:
        count += 1
if m <= count:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
n,m = set(map(int, input().split()))
a = set(map(int,input().split()))
d = sum(a)/(4.0*m)
count = 0
for x in a:
    if float(x) >= d:
        count += 1
if m <= count:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

count = 0
al = sum(s)

for i in range(N):
  if not(a[i] < s / (4 * M)):
    count += 1
    
if count == M:
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

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

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

b = [b for b in a if b >= 1/4/m]

if len(b)>= m:
	print(‘Yes’)
else:
	print(‘No’)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

A.sort(reverse=True)
S = sum(A)
i = 0

while A[i] >= S/(M*4) and i < N:
    i += 1

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

Submission status: Runtime Error

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

A.sort(reverse=True)
S = sum(A)
i = 0
while A[i] > S//(M*4) and i < N:
    i += 1

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

Submission status: Runtime Error

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

total = 0
for i in range(N):
    if i >= (sum(list) / (4 * M)):
        total = total + 1

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

Submission status: Runtime Error

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

total = 0
for i in range(N):
    if i >= sum(list) / (4 * M):
        total = total + 1

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

Submission status: Runtime Error

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

X = int(sum(Li) / 4 / M)
Li.sort(reverse=True)


if Li[M - 1] and Li[M - 1] != Li[M] >= X:
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

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

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

p = []

for i in a:
  #print(i, sum)
  if i > (sum // ( M * 4 )):
    p.append(i)

if len(p) >= M:
  print('Yes')
else:
  Print("No")

Submission status: Runtime Error

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

X = int(sum(Li) / 4 / M)
Li.sort(reverse=True)

if Li[M - 1] and Li[M - 1] != Li[M] >= X:
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

Solution code:
N, M = map(int, input().split())
A = deque(sorted(list(map(int, input().split()))))
for a in A:
  if N / (4 * M) > a:
    A.pop()
  else:
    break
print("Yes" if len(A) >= M else "No")

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import math
n,m=map(int,input().split())
a=list(map(int,input().split()))
s=sum(a)
t=math.floor(s/4/m)
a.sort()
for i in a:
  if i<t:
    u=i

  else:
    break
cnt=0
for i in a:
  if i>u:
    cnt+=1

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

Submission status: Runtime Error

Solution code:
N,M = map(int, input().split())
A = 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: Runtime Error

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

lim = 1/(4*m)
A = A/sum(A)
ans = 0
for a in A:
  if a>=lim:
    ans += 1
    
if ans >= m:
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

Solution code:
a = input().split()

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

b = input().split()

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

s = sum(x)
lim =int(s / (m*4) + 1

c = 0

for i in range(0,n):
    if(x[i] > lim):
      c = c + 1
    else:
      continue

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

P=0 #選べる個数
for a in A:
    if a>=s/(4*M):
        P+=1
    else:
        break
        
if P==M:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
#! env/bin/local python3
# -*- coding:utf-8 -*-

is_first = False
while True:
    try:
        if is_first:
            n, m  = (int(i) for i in input().split())
            is_first = False
        else:
            arr = (int(i) for i in input().split())
    except EOFError:
        break

total_vote = sum(arr)
sorted_arr = sorted(arr)

list_up_arr = sorted_arr[-1: -m]

flag = False
for l in list_up_arr:
    if l >= 1 / (4 * m):
        flag = True

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

Submission status: Runtime Error

Solution code:
def readInts():
  return list(map(int, input(), split()))

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

Submission status: Runtime Error

Solution code:
def readInts():
  return list(map(int, input(), split()))

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

if int(list[m+1]) >= sum(list) / 4:
  print('Yes')
else:
  print('No')

Submission status: Runtime Error

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

if list[m+1] >= sum(list) / 4:
  print('Yes')
else:
  print('No')

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N,M=map(int,input().split())
a=[map(int,input().split()) for i in range(N)]
a=sorted(a, reversed =True)
if sum(a)/(4*M)<=a[M-1]:
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N,M=map(int,input().split())
a=[int(input()) for i in range(N)]
a=sorted(a) reversed=True
if sum(a)/(4*M)<=a[M-1]:
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

Solution code:
#!/usr/bin/env python3
import bisect
import cmath
import heapq
import itertools
import math
import operator
import os
import random
import re
import string
#import numpy as np
from collections import Counter, defaultdict, deque
from copy import deepcopy
from decimal import Decimal
from functools import lru_cache, reduce
from math import gcd
from operator import add, itemgetter, mul, xor
def cmb(n,r,mod):
  bunshi=1
  bunbo=1
  for i in range(r):
    bunbo = bunbo*(i+1)%mod
    bunshi = bunshi*(n-i)%mod
  return (bunshi*pow(bunbo,mod-2,mod))%mod
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**8)
mod = 10**9+7
def I(): return int(input())
def LI(): return list(map(int,input().split()))
def MI(): return map(int,input().split())

n,m = MI()
a = LI()
a.sort()
a.reverse()
ki = sum(a)/(4*m)
if a[m-1] < ki:
    print("No")
else:
    print("Yes")

Submission status: Runtime Error

Solution code:

m, n = input().split()
a = input().split()
sum_a = sum(a) / (4 * m)

yes_num = 0
no_num = 0

ok = m
ng = n - m

for i in a:
    if i < sum_a:
        no_num += 1
    else:
        yes_num += 1
    if no_num > ng:
        break
    if yes_num >= ok:

        exit(0)

print("No")

Submission status: Runtime Error

Solution code:
#include<bits/stdc++.h>
using namespace std;
main()
{int n,m,c=0;
float a,s=0;
cin>>n>>m;
	vector<int> v(n);
	for(int i=0;i<n;i++)
	{
		cin>>v[i];
		s=s+v[i];
	}
	a=s/(4*m);
	for(auto x:v)
	{
		if(x>=a)
	{
		c=c+1;
	}
}
	if(c>=m)
	{
		cout<<"Yes"<<endl;
	}
	else
	{
		cout<<"No"<<endl;
	}

}

Submission status: Runtime Error

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

totalVote = sum(A)
border = totalVote / (4 * M)
A.sort(reverse = True)

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

Submission status: Runtime Error

Solution code:
12 3
4 56 78 901 2 345 67 890 123 45 6 789

Submission status: Runtime Error

Solution code:
import sys
N, M = map(int, sys.stdin.readline().split())
A = sorted(list(map(int, sys.stdin.readline().split())), reverse=True)
S = sum(A)
if A[M] < S / (4 * M):
    print("No")
else:
    print("Yes")

Submission status: Runtime Error

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

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

qtd_votos = sum(votos)

minimo = qtd_votos/(4*M)

votos.sort(reverse = True)

if votos[M-1] >= minimo:
    print("Yes")
else:
    print("No")
トすることで判定できます。

Submission status: Runtime Error

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

cnt = 0
for x in A:
  if 4 * m * x >= all:
    cnt++;
  
if cnt >= m:
  print("Yes")
else :
  print("No")

Submission status: Runtime Error

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

cnt = 0
for x in A:
  if 4 * m * A[i] >= all:
    cnt++;
  
if cnt >= m:
  print("Yes")
else :
  print("No")

Submission status: Runtime Error

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


for i in range(0,len(vote)):
    if sum / 4 / M <= vote[i]:
        cnt++


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

Submission status: Runtime Error

Solution code:
N = int(input())
M = int(input())

for i in range(N):
  A  = input()//票数入力
  k = 1 ./ 4 * M
  if A < k:
    print('No')
  elif A >=k:
    print('Yes')

Submission status: Runtime Error

Solution code:
x,y = map(int,input().split())
li = list(map(int,input().split()))	
cnt = 0
for i in range(len(li)):
    if li[i] >= sum(li) / (4*y)):
        cnt += 1
else:
    pass

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

Submission status: Runtime Error

Solution code:
n,m = input().strip().split()
n,m = [int(n),int(m)]
list1 = sorted(map(int,input().split()))
total = 0
for i in range(n):
    total += list1[i]
if list1[n-m+1] >= total/(4*m):
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N,M = map(int,input().split())
A = list(map(int,input().split()))
k = 0
for i in range(N-1):
    if A[i]/sum(A) > 1/(4*M):
        k = k+1

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

Submission status: Runtime Error

Solution code:
N, M=map(int,input().split())
alist = list(map(int,input().split()))
alist.sort(reverse = True)
su = 0
correct = True
for i in alist:
    su += i
for i in range[M-1]:
    if alist[i] < 1/(4*M) :
        print("No")
        correct = False
if correct:
    print("Yes")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

s = sum(a)

if a[M-1] >= s/4M:
  print("Yes")
else:
  print("No")
  
return

Submission status: Runtime Error

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

s = sum(a)

if a[M-1] / s >= 1/4M:
  print("Yes")
else:
  print("No")
  
return

Submission status: Runtime Error

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

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

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

Submission status: Runtime Error

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

vote.sort(reverse=True)
popular = vote[0:m-1]
sum = sum(vote)

yes = True

for win in popular:
    if win < sum / (4*m):
        print('No')
        yes = False
        stop

if yes:
    print('Yes')

Submission status: Runtime Error

Solution code:
n, m = map(int, input().split())
a = [int(x) for x in input().split()]
s = sum(a)
l = a // (4 * m)

a = sorted(a, reverse = True)
f = 0
for i in a:
  i < l:
    f = i
    break
if(f < m):
  print('No')
else:
  print('Yes')

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

l=sorted(l,reverse=True)

l_sum=sum(l)
ans="Yes"

for i in range(m):
  if l[m]<(l_sum/4/m):
    ans="No"
    break
    
print(ans)

Submission status: Runtime Error

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

l=sorted(l,reverse=True)

l_sum=sum(l)
ans="Yes"

for i in range(m):
  if l[m]<(l_sum*1/4/m):
    ans="No"
    break
    
print(ans)

Submission status: Runtime Error

Solution code:
N,M = map(int,input().split())
A_i = list(map(int,input().solit()))
sum_A_i = sum(A_i)
X = 0

for i in A_i:
  if i > sum_A_i/(4*M):
    x += 1
    
  if x >=M:
    print("Yes")
  else:
    print("No")

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

votes = sum(vote)
ans = [i for i in L if i * 4 * M >= votes]

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

Submission status: Runtime Error

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

for i in range(N):
	list = map(int,input().split())
    
list.sort(reverse=True)
list_sum = sum(list)
tokuhyousu = list_sum / 4
result = 'Yes'
for i in range(N):
	for j in list:
    	if j < tokuhyousu:
        	result = 'No'
            break

print(result)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
#!/usr/bin/env python
import sys
from collections import Counter
from itertools import permutations, combinations
#from fractions import gcd
from math import gcd
from math import ceil, floor
import bisect
sys.setrecursionlimit(10 ** 6)
inf = float("inf")

def input():
    return sys.stdin.readline()[:-1]

def main():
    n, m = map(int, input().split())
    A = tuple(map(int, input().split()))
    ans = 0
    total = sum(A)
    for a in A:
        if a >= total/(4*m):
            ans += 1
    print("Yes") if ans >= m else print("No")

if __name__ == '__main__':
    main()

Submission status: Runtime Error

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

all_vote = sum(A)

cnt = 0

for a in A:
        if a * 4 * m >= all_vote
        cnt += 1
if cnt >= m:
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

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

all_vote = sum(A)

cnt = 0

for a in A:
        if a * 4 * m >= all_vote    #小数になる可能性をなくした
        cnt += 1
if cnt >= m:
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

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

all_vote = sum(A)

cnt = 0

for a in A:
    #if a >= all_vote / (4*m):
    if a * 4 * m >= all_vote    #小数になる可能性をなくした
        cnt += 1
if cnt >= m:
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

Solution code:
N=int(input())
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: Runtime Error

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

Submission status: Runtime Error

Solution code:
N,M = map(int,input().split())
a = input().split()
for i in a:
  if int(i) >= sum(map(int,a))* 1/(4*M):
    ans+=1

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

Submission status: Runtime Error

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

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n, m = map(int, input().split())
rank = list(map(int, input().split()))
rank.sort(reverse=True)
cnt = 0

for r in rank:
  if r >= (sum(rank)//(4*m)):
    cnt += 1
    if cnt = m:
      break

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
category_number, popular_product_number = input().split()
product_list = input().split()
votes_number = sorted(product_list)[-popular_product_number]
border = sum(product_list)/4/popular_product_number
if votes_number < border:
  print('No')
else:
  print('Yes')

Submission status: Runtime Error

Solution code:
N=[int(x) for x in input().split()]
A=[int(y) for y in input().split()]
y=sorted(A, reverse=True)
z = sum(y)
if z/8< y[N[1]]:
  print('Yes')
else:
  print('No')

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N, M = map(int, input().split())
A = sorted(list(map(int, input().split())))[::-1]
A_sum = sum(A)

count = 0;
criteria = A_sum/(4*M)

print("No") if (A[M] <= criteria) else print("Yes")

Submission status: Runtime Error

Solution code:
#商品数を取り込む
line_num = input()
line = line_num.split(" ")
  
    #全得票数を計算する
line2 = input().split(" ")
sum_vote = 0
for i in line2:
   # print(i)
    sum_vote += int(i)
  
#規定得票数を算出する。
numa = sum_vote/int(line[1])
num= numa/4

list =[]
for i in line2:
    if int(i) =>num:
        list.append(i)
    else:
        pass

if len(list)>int(line[1]):
    print("Yes")
else:
    print("No")