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=(input().split())
A=(input().split())
for i in range(int(M)):
    if 1//4>A:
        print("Yes")
    else:
        print("No")

Submission status: Runtime Error

Solution code:
num1 = int(input().split())
num2 = list(map(int, input().split()))

num2.sort(reverse=True)
N=num1[0]
M=num1[1]
A=num2[M-1]

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

Submission status: Runtime Error

Solution code:
def calc():
    summ  = sum(A)
    low = summ * 1 / 4*M
    high = 1000

    newlist = [i for i in A if low <= i < high]

    lot = len(newlist)

    if M < lot:
        print ("No")
    else:
        print ("Yes")

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

calc()

Submission status: Runtime Error

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

//print(A)

cnt = 0
cnt1 = 0

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

for i in range(N):
    if A[i] / cnt > 1 / 4 / M:
        cnt1 = cnt1 + 1

//print(cnt1)

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

Submission status: Runtime Error

Solution code:
num1 = int(input().split())
num2 = list(map(int, input().split()))

num2.sort(reverse=True)
N=int(num1[0])
M=int(num1[1])
A=int(num2[M-1])

if A<N/M/4:
    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()
total = 0
for i in a:
  total += i
ok = 0
for i in range(m):
  if a[i] >= total / (4 * m):
    ok += 1
 
if ok != m:
  print("No")
else:
  print("Yes")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import numpy as np

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

N = tmp[0]
M = tmp[1]

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

i = np.array(i)

i.reverse()

souwa = sum(i)

if i[M] < (souwa * (1/(4*M))):
    print("Yes")
else:
    print("No")
# print(i[0]) #出力：i_1
# print(i[1]) #出力：i_2

Submission status: Runtime Error

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

if M == 0:
    print('No')
if N < M:
    print('No')

A = [int(input()) for i in range(N)]


B = []
for i in range(len(A)):
    if A[i] > sum(A)/4/M:
        B.append(1)
    else:
        B.append(0)

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

Submission status: Runtime Error

Solution code:
A=list(map(int, input().split()))
A.sort()
A.reverse()
K=sum(A)
answer=0
breakflag=0
for i in range(0,N):
  if  A[i]*M*4>=K:
    if i==N-1:
      breakflag=1
    continue
  else:
    answer=i
    break
if breakflag==1:
  answer=N
if answer>=M:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

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

list_sum = sum(a)
num = list_sum * (1/(4*M))
judge = True
count = -1
list_count = len(a)


while judge == True:
    if a[count] <= num:
        count -= 1
    else:
        judge = False

if  N < (count*-1) + M:
    print('No')
else:
    print('Yes')

Submission status: Runtime Error

Solution code:
arrayNM = list(map(int, input.split()))
array = list(map(int, input.split()))
tokuhyousuu = 1 / (4 * array[1])
ninnkiCounter = 0
for num in array:
  if ((float)num >= tokuhyosuu):
    ninnkiCounter += 1
    

if (arrayNM[1] <= ninnkiCounter):
  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()
A.reverse()
K=sum(A)
answer=0
breakflag=0
for i in range(0,N):
    if  A[i]*M*4>=K:
    	if i==N-1:
        	breakflag=1
      	continue
    else:
      	answer=i
      	break
if breakflag==1:
  answer=N
if answer>=M:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

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

if M == 0:
    print('No')
if N < M:
    print('No')

A = [int(input()) for i in range(N)]


B = []
for i in range(len(A)):
    if A[i] > sum(A)/4/M:
        B.append(1)
    else:
        B.append(0)

if sum(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())) 
a.sort(reverse = True)

m = 4*M
c = 0 
for i  in range(0,M):
  if a[i] >=m:
    c +=1
   
  
  
if c = M:
  print('Yes')
else:
  print('No')

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
NM=input().split()
M=int(NM[1])
a=input().split()
a_list=[]
for i in a :
  a_list.append(int(i))
a_list.sort(reverse=True)
sum1=sum(a_list)
 
flag=True
for i,youso in enumerate(a_list) :
  if(youso*4*M<sum1 and i+1<=M) :
    print(youso)
    flag=False
    break
    
if flag=True :
  print('Yes')
else :
  print('No')
NM=input().split()
M=int(NM[1])
a=input().split()
a_list=[]
for i in a :
  a_list.append(int(i))
a_list.sort(reverse=True)
sum1=sum(a_list)
 
flag=True
for i,youso in enumerate(a_list) :
  if(youso*4*M<sum1 and i+1<=M) :
    print(youso)
    flag=False
    break
    
if flag==True :
  print('Yes')
else :
  print('No')

Submission status: Runtime Error

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

cnt = 0
cnt1 = 0

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

for i in range(N):
    if A[i] / cnt > 1 / 4 / M:
        cnt1 = cnt1 + 1

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N,M,s=map(int,input().split())
S=sum(s)
if sorted(s)[-1:-m]<S/(4*M):
    print('No')
else:
    print('Yes')

Submission status: Runtime Error

Solution code:
NM=input().split()
M=int(NM[1])
a=input().split()
a_list=[]
for i in a :
  a_list.append(int(i))
a_list.sort(reverse=True)
sum1=sum(a_list)
 
flag=True
for i,youso in enumerate(a_list) :
  if(youso*4*M<sum1 and i+1<=M) :
    print(youso)
    flag=False
    break
    
if flag=True :
  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)
print("YNeos"[sum([sum(a)/(4*m)<a[i] for i in range(m+1)])<m::2])

Submission status: Runtime Error

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

N = tmp[0]
M = tmp[1]

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



i.reverse()

souwa = sum(i)

if i[M] < (souwa * (1/(4*M))):
    print("Yes")
else:
    print("No")
# print(i[0]) #出力：i_1
# print(i[1]) #出力：i_2

Submission status: Runtime Error

Solution code:
N, M = map(int, input().split(' '))
lis1 = map(int, input().split(' '))
S = sum(lis1)
thresh = S / (4 * M)
lis2 = sorted(lis1)
if lis2[-M] < thresh:
  print('No')
else:
  print('Yes')

Submission status: Runtime Error

Solution code:
import numpy as np

N, M = map(int, input().split())
A = list(map(int, input().split()))
# 1 / (4 * M)
# N = len(A)
x = np.array(A)

if A[M] >= sum(A) *  {1 / (4 * M)}:
  print("Yes")
else:
  print('No')

Submission status: Runtime Error

Solution code:
N = int(NM[0])
M = int(NM[1])
ALL = sum(A)
k = 0
c = ALL/(4*M)

print(N, M, ALL, c)
for Ai in A:
    if Ai>=c:
        k += 1

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

Submission status: Runtime Error

Solution code:
A=list(map(int,input().split()))
pop = int(1/(4*M)*sum(A))
lis = []
for i in A:
    if i>=pop:
        lis.append(i)
if len(lis)>=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)

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

Submission status: Runtime Error

Solution code:
N, M = map(int, input().split())
N = input().split()
A = []
soutoku = 0
for i in N:
    soutoku += int(i)
N = sorted(N, reverse=True)
for i in range(M):
    A.append(N[i])

b = soutoku / 4 * M

if int(N[int(M)]) < int(b):
    print("No")
else:
    print("Yes")

Submission status: Runtime Error

Solution code:

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

list.sort(a, reverse=True)

ans = "No"


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

Submission status: Runtime Error

Solution code:
M = map(int, input().split())
A = [int(N) for N in input().split()]
X=0
F=int(sum(A)/(4*M))
for i in range(N):
    if A[i] >= F:
        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(reverse=True)

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

Submission status: Runtime Error

Solution code:
N, M = input().split(' ')
lis1 = map(int, input().split(' '))
S = sum(lis1)
thresh = S / (4 * M)
lis2 = sorted(lis1)
if lis2[M - 1] < thresh:
  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()
A.reverse()
K=sum(A)
for i in range(0,N):
    if  A[i]*M*4>=K:
        continue
    else:
        answer=i
        break
if answer>=M:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
A=list(map(int,input().split()))
pop = 1/(4*M)*sum(A)
lis = []
for i in A:
    if i>pop:
        lis.append(i)
if len(lis)>=M:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

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

if M == 0:
    print('No')
if N < M:
    print('No')

A = [int(input()) for i in range(N)]


B = []
for i in range(len(A)):
    if A[i] > sum(A)/4/M:
        B.append(1)
    else:
        B.append(0)

if sum(B) > N - M + 1:
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

Solution code:

N,M,s=map(int,input().split())
S=sum(s)
m=sorted(s)[-M]
if m<S/(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()))

count = 0
allpoint = 0

for i in A:
    allpoint += i

for i in A:
    if i >= float(allpoint * // (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[N]=map(int,input().split())

cnt = 0
cnt1 = 0

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

for i in range(N):
  	if  A[i]/cnt > 1/4/M:
		cnt1 =cnt1 + 1
      
if cnt1 > M:
	print('Yes')
elif
	print('No')

Submission status: Runtime Error

Solution code:
num1=input().split()
num2=input().split()

num2.sort(reverse=True)
N=int(num1[0])
M==int(num1[1])
A=int(num2[int(num1[1])-1])

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

Submission status: Runtime Error

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")
break

Submission status: Runtime Error

Solution code:
A=list(map(int,input().split()))
pop = 1/(4*M)*sum(A)
lis = []

for i in A:
    if i>pop:
        lis.append(i)
if len(lis)>=M:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

if M == 0:
    print('No')
if N < M:
    print('No')

A = [int(input()) for i in range(M)]


B = []
for i in range(len(A)):
    if A[i] > sum(A)/4/M:
        B.append(0)
    else:
        B.append(1)

if sum(B) > N - M + 1:
    print('No')
else:
    print('Yes')

Submission status: Runtime Error

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

Submission status: Runtime Error

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

A.sort(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())
Ai = list(map(int,input().split()))
Ai.sort(reverse=True)
x = sum(Ai[0:M])
soutokuhyou = sum(Ai[:])
seigen = soutokuhyou / (4*M)
if Ai[M] < seigen:
    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()
A.reverse()
K=sum(A)
for i in range(0,N):
    if  A[i]>=K/(4*M):
        continue
    else:
        answer=i+1
        break
if answer>=M:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

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

if M == 0:
    print('No')
if N < M:
    print('No')

A = [int(input()) for i in range(N)]


B = []
for i in range(len(A)):
    if A[i] > sum(A)/4/M:
        B.append(0)
    else:
        B.append(1)

if sum(B) > N - M + 1:
    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)
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: Runtime Error

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

Solution code:
#include <bits/stdc++.h>
using namespace std;

int main() {
  int n, m;
  cin >> n >> m;
  int a[n];
  double s=0;
  for(int i=0; i<n; i++){
    cin >> a[i];
    s+=a[i];
  }
  int count=0;
  for(int i=0; i<n; i++){
    if(s/(4*m)<=a[i])
      count++;
  }
  if(count>=m)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}

Submission status: Runtime Error

Solution code:
n,m=map(int,input().split())
a=list(map(int,input().split()))
a.sort()
s=0
b=True
for i in a:
  s+=a
  
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: Runtime Error

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

c = sum(li) / 4*M
res = 0
for l in li:
    res += 1 if l >= c
if res == M:
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

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

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

a.sort(reverse=True)
if a[m-1] >= toku:
  print("Yes")
  else:
  print("No")

Submission status: Runtime Error

Solution code:
N, M = input()
lis1 = input().split(' ')
S = sum(lis1)
thresh = S / (4 * M)
lis2 = sorted(lis1)
if lis2[M - 1] < thresh:
  print 'No'
else:
  print 'Yes'

Submission status: Runtime Error

Solution code:
import pandas as pd
N, M = map(int,input().split())
A = pd.Series(list(map(int,input().split())))
if A[A >= A.sum()/(4*M)].count()>=M:
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>
using namespace std;

int main() {
  int n,m;
  cin >> n >> m;
  int a[n];
  int sum=0;
  int ca = 1;
  for (int i = 0; i < n; ++i) {
      cin >> a[i];
      sum += a[i];
  }
  sort(a, a+n, greater<>());
  for (int i = 0; i < m; ++i) {
    
    if (a[i] < sum / (4 * m )) {
        ca = 0;
        break;
    }
  }
  if ( ca == 1) cout << "Yes" << endl;
  else cout << "No" << endl;
  
  return 0;

}

Submission status: Runtime Error

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

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

A = [int(input()) for i in range(N)]


B = []
for i in range(len(A)):
    if A[i] > sum(A)/4/M:
        B.append(0)
    else:
        B.append(1)

if sum(B) > N - M + 1:
    print('No')
else:
    print('Yes')

Submission status: Runtime Error

Solution code:
import pandas as pd
N, M = map(int,input().split())
A = pd.Series(list(map(int,input().split())))
A[A >= A.sum()/(4*M)].count() >= M

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N,M = map(int,input().split())
A = map(int,input().split())
new_A = []
for i in range(N):
  if A[a] >= 1/(4*M):
    new_A.append(a)
 
if len(new_A)>=M:
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
, M, *A = map(int, open(0).read().split())
print(sum(A))
vote = sum(A) / (4*M)
num = list(filter(lambda x: x > vote, A))
num = len(num)
if num >= 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()
print(S/4*M)
print(a)
if a[N-M+1] >= S/4*M:
  print('Yes')
else:
  print('No')

Submission status: Runtime Error

Solution code:
N,M = map(int,input().split())
A = []
for i in range(N):
  a = int(input()) 
  if a >= 1/(4*M):
    A.append(a)

if len(A)>=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 = sorted(a,reverse = True)
total = 0
for i in range(len(b)):
  total += b[i]

if b[M]<total/(4*M):
  print("No")
else:
  print("Yes")

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
nm = list(map(int, input().split()))
a = list(map(int, input().split()))
Sum=0
flag=0

for i in range(len(a)):
    Sum+=a[i]

a.sort(reverse=True)

for i in range(nm[1]):
    if a[i]<sum/(4*nm[1]):
        flag=1
        break

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

Submission status: Runtime Error

Solution code:
n,m=map(int,input().split())
a=list(map(int,input().split()))
b=sum(a)
for i in range(n):
    if a[i]>=b/(4*m):
        a[i]=x
if a.count(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()
A.reverse()
K=sum(A)
for i in range(0,N):
    if  A[i]>K/(4*M):
        continue
    else:
        answer=i+1
        break
if answer>=M:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>

#define rep(i, n) for(int i = 0; i < (n); ++i)
#define repc(i, t, n) for(int i = t; i < (n); ++i)

using namespace std;
using ll = long long;

int main(){

	int n, m; cin >> n >> m;
	vector<int> A(n);
	rep(i, n) cin >> A[i];

	int all = accumulate(A.begin(), A.end(), 0);

	int num = 0;
	rep(i, n){
		if(A[i] >= all / (4 * m)) ++num;
	}
	if(num >= m)
		cout << "Yes" << endl;
	else
		cout << "No" << endl;

	return 0;
}

Submission status: Runtime Error

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

a.sort(reverse = True);

i = 0;
while a[i] >= sum(a)/(4*m) and i < n:
    i += 1;

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

Submission status: Runtime Error

Solution code:
    N, M, *A = map(int, open(0).read().split())
    print(sum(A))
    vote = sum(A) / (4*M)
    num = list(filter(lambda x: x > vote, A))
    num = len(num)
    if num >= 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)
b=sum(a)/4/m
print(a)
print(a[m])
if a[m-1]<b:
    print('No')
else:
    print('Yes')

Submission status: Runtime Error

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

souwa = sum(A)
print(souwa)

hyou = 1(4*souwa)i
ninki = 0

for i in range(A):
    if A(i)>hyou:
      ninki = ninki + 1

if m == souwa:
     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()
S = sum(A)
         
if 1/(4*M) <= A[N-M]/S :
	print("YES")
else:
	print("NO")

Submission status: Runtime Error

Solution code:
N,M= map(int, raw_input().split())
A=list(map(int, raw_input().split()))
A.sort()
A.reverse()
K=sum(A)
for i in range(0,N):
    if  A[i]>K/(4*M):
        continue
    else:
        answer=i+1
        break
if answer>=M:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
s = input().split()
i = s[0]
m = s[1]
j = 0
el = input().split()
for p in el:
    if int(p) < 1 / (4 * m):
      j = 1 
if j == 0:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
N,M= map(int, input().split())
a = list(map(int,input().split()))
total = 0
for i in range(len(a)):
  total += a[i]

if a[M]<total/(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()
S = sum(A)
         
if 1/(4M) <= A[N-M]/S :
	print("YES")
else:
	print("NO")

Submission status: Runtime Error

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

su=sum(A)
i=0
while max(A)*4*M>=su:
    i+=1
    A.remove(max(A))
else:
    if i>=M:
        print("Yes")
    else:
        print("No")

Submission status: Runtime Error

Solution code:
def LI():
	return [ int(s) for s in input().split() ]
N,M = LI()
A = LI()

print('Yes') if sum(map(lambda x: x >= (1/4/M))) >= M else print('No')

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n, m = input().split()
a = input().split()
ans  = round(sum(a) * (1/(4 * m)))
if a[n-1] >= ans:
    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)

ans = []
for i in range(m+1) :
  if a[i] < sum(a) / (4 * m) :
    continue
  else :
    ans.append(a[-1])

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

Submission status: Runtime Error

Solution code:
url = "https://atcoder.jp/contests/abc161/tasks/abc161_b"

def main():
    n, m = list(map(int, input().split()))
    n_li = list(map(int, input().split()))
    n_li = sorted(n_li, reverse=True)
    all = sum(n_li)
    for i in range(1, m + 1):
        if all // (4 * m) > n_li[i]:
            print('No')
            exit()
    print('Yes')


if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
N, M = map(int, input().split())
A = list(map(int, input().split()))
sum = sum(A)
flag = 0
A = sorted(A, reverse=True)
# print(sum, A)

for i in range(0, M+1):
  if M == 0:
    break
  if A[i]<(sum/(4*M)):
    print('No')
    flag = 1
    break

if flag == 0:
  print("Yes")

Submission status: Runtime Error

Solution code:
n, m = map(int, input().split())
a = list(map(int, input().split()))
a.sort(reverse=True)
print(a)
ans = []
for i in range(m+1) :
  if a[i] < sum(a) / (4 * m) :
    continue
  else :
    ans.append(a[-1])

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

Submission status: Runtime Error

Solution code:
a,b,c = list(map(int,input().split()))
a,b = b,a
a,c = c,a
print(a," ",b," ",c)

Submission status: Runtime Error

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

all_sum_a = np.sum(A)

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

Submission status: Runtime Error

Solution code:
N,K = map(int,input().split())
li = list(map(int,input().split()))
x = sum(li) * 1/(4*M)
li.sort(reverse=True)

l = [i for i in li if i > x]
if M > len(l):
    print("No")
else:
    print("Yes")

Submission status: Runtime Error

Solution code:
#!/usr/bin/env python3

# line1 = '12 3'
# line2 = '4 56 78 901 2 345 67 890 123 45 6 789'
# N, M = [int(x) for x in line1.split()]
# A = [int(x) for x in line2.split()]

N, M = [int(x) for x in input().split()]
A = [int(x) for x in input().split()]


A = sorted(A)[::-1]
total = sum(A)
if A[M] < total * (1 / (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)
if A[m]<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)
ans = []
for i in range(1, m+1) :
  if a[i] < sum(a) / (4 * m) :
    continue
  else :
    ans.append(a[-1])

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

Submission status: Runtime Error

Solution code:
# coding: utf-8

a=list(map(int,input().split()))
#読み込み
N = a[0]
M = a[1]
b=list(map(int,input().split()))
#総得票数
Sum_vote = sum(b)
list.sort(b, reverse=True)

if b[M] < (Sum_vote / 4 * M):
    print("No")
else :
    print("Yes")

Submission status: Runtime Error

Solution code:
sfhgfh

Submission status: Runtime Error

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

a.sort(reverse=True)
s = sum(a)
thresh = s/(4*m)
flag=True
for i in range(m):
    if a[i]< thresh:
        flag=False
        break

if flag:
    print("YES")
else:
    print("NO")

Submission status: Runtime Error

Solution code:
#!/usr/bin/env python3

N,M =map(int, input().split())
A =list(map(int, input().split()))
B = sorted(A, reverse = True)
if B[M] >= sum(B)//4//M:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
m = input()
a = input()
x = int(0)
y1, y2 = int(0)

n, m = m.spilit()

for i in range(0, len(a), 2):
    x += int(a[i])
    y2 = y1 if y1 < int(a[i]) else y2
    y1 = int(a[i]) if y1 < int(a[i]) else y1

if not y1 // 4 * m or y2 // 4 * 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()))

sumA = sum(A)
lmt = sum(A) /(4*m)
#print(sumA, lmt)
A.sort(reverse=True)
if A[m] > lmt:
  print('Yes')
else:
  print('No')

Submission status: Runtime Error

Solution code:
N, M = map(int, input().split())
A = list(map(int, input().split()))
sum = sum(A)
flag = 0
A = sorted(A, reverse=True)
# print(sum, A)

for i in range(0, M+1):
  if A[i]<(sum/(4*M)):
    print('No')
    flag = 1
    break

if flag == 0:
  print("Yes")