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=int(input().split())
l=list(map(int,input().split()))
limit=sum(l)/(M*3)
num=0
for i in l:
  if i >= limit:
    num+=0
if num >=M:
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

Solution code:
from sys import stdin
import numpy as np


############################################

# read data for n sequences.
temp = stdin.readline().split()
N, M = np.asarray(temp).astype(int)
temp = stdin.readline().split()
a = np.asarray(temp).astype(int)

sumvotes = np.sum(a)

c = 0; OUT = False
for data in a:
    if data >= sumvotes/(4*M):
        c += 1
    if c >= M:
        OUT = True
        #break

if OUT:
    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[i] >= 1 / (4 * M) for i in N)

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
NM = input()
arr=input()

nmi=NM.split(" ")
n=nmi[0]
m=nmi[1]
listike=arr.split(" ")

def partition(arr,low,high): 
    i = ( low-1 )         # index of smaller element 
    pivot = arr[high]     # pivot 
  
    for j in range(low , high): 
  
        # If current element is smaller than or 
        # equal to pivot 
        if   arr[j] <= pivot: 
          
            # increment index of smaller element 
            i = i+1 
            arr[i],arr[j] = arr[j],arr[i] 
  
    arr[i+1],arr[high] = arr[high],arr[i+1] 
    return ( i+1 ) 
   
def quickSort(arr,low,high): 
    if low < high: 
  
        pi = partition(arr,low,high) 
  
        quickSort(arr, low, pi-1) 
        quickSort(arr, pi+1, high) 
      
sort = quickSort(arr,0,n-1)
vajalik = sort[n-m: n-1]

if sort[n-m]>(sum(sort)/4*m):
  print("yes")
else:
  print("no")

Submission status: Runtime Error

Solution code:
n,m = map(int,input().split())
num = list(map(int,input().split()))
limit = 1/(4*m)
count = 0
for i in range(n):
  if num[i] >= limit: 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()))
a.sort(reverse = True)
print('Yes' if a[m-1] >= 1/4M else 'No')

Submission status: Runtime Error

Solution code:
N,M = map(int,input().split())
m = 0
v = input().split()
for i in range(N): v[i] = int(v[i])
  
v.sort(reverse=True)
v_min = sum(v)/4/M

while v[0]:
  if v.pop(0) >= v_min:
    m += 1
  else:
    break

if M <= m:
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

Solution code:
N,M = map(int,input().split())
m = 0
v = input().split()
for i in range(N): v[i] = int(v[i])
  
v.sort(reverse=True)
v_min = sum(v)/4/M

while v[0]:
  if v.pop(0) >= v_min:
    m += 1

if M <= m:
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

Solution code:
N,M = map(int,input().split())
m = 0
v = input().split()
for i in range(N): v[i] = int(v[i])
  
v.sort(reverse=True)
v_min = sum(v)/4/M

while v.pop(0) >= v_min:
  m += 1

if M <= m:
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

Solution code:
n_m = input()
sp_n_m = n_m.split()
ai = input()
sp_ai = ai.split()
sum = 0

for num in sp_ai:
  sum += num

th = sum / (4 * sp_n_m[1])

cnt = 0
for num2 in sp_ai:
  if num2 > th:
    cnt+= 1

if cnt >= sp_n_m[0]:
  print('Yes')
else:
  print('No')

Submission status: Runtime Error

Solution code:
n_m = input()
sp_n_m = n_m.split()
ai = input()
sp_ai = ai.split()
sum = 0

for num in sp_ai:
  sum += num

th = sum / (4 * sp_n_m[1])

cnt = 0
for num2 in sp_ai:
  if num2 > th:
    cnt++

if cnt >= sp_n_m[0]:
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

Solution code:
l = input()
m = input()
z = l.split(" ")
M = int(z[1])
F = m.split(" ")
X = []
amount=0
for item in F:
  votes = int(item)
  amount = amount + votes
  X.append(votes)
X.sort(reverse=True)
C = (1/4*M)*amount
for i in range(M):
  if X[i]<C:
    print("No")
    return
print("Yes")

Submission status: Runtime Error

Solution code:
l = input()
m = input()
z = l.split(" ")
M = int(z[1])
F = m.split(" ")
X = []
amount=0
for item in F:
  votes = int(item)
  amount = amount + votes
  X.append(votes)
X.sort(reverse=True)
C = (1/4M)*amount
for i in range(M):
  if X[i]<C:
    print("No")
    return
print("Yes")

Submission status: Runtime Error

Solution code:
l = input()
m = input()
z = l.split(" ")
M = int(z[1])
F = m.split(" ")
X = []
amount=0
for item in F:
  votes = int(item)
  amount = amount + votes
  X.append(votes)
  X.sort(reverse=True)
C = (1/4M)*amount
for i in range(M):
  if X[i]<C:
    print("No")
    return
print("Yes")

Submission status: Runtime Error

Solution code:
l = input()
m = input()
z = l.split(' ')
M = int(z[1])
N = int(z[0])
F = m.split(' ')
X = []

for item in F:
  votes = int(item)
  X.append(votes)
print("Yes")
S = sum(S)
C = (S/(4*M))
X.sort(reverse=True)
if X[M-1]<C:
  print("No")
else:
  print("Yes")

Submission status: Runtime Error

Solution code:
l = input()
m = input()
z = l.split(' ')
M = int(z[1])
N = int(z[0])
F = m.split(' ')
X = []
for item in F:
  votes = int(item)
  X.append(votes)
S = sum(S)
C = (S/(4*M))
X.sort(reverse=True)
if X[M-1]<C:
  print("No")
else:
  print("Yes")

Submission status: Runtime Error

Solution code:
l = input()
m = input()
z = l.split(" ")
M = int(z[1])
N = int(z[0])
F = m.split(" ")
X = []
amount=0
for item in F:
  votes = int(item)
  amount = amount + votes
  X.append(votes)
  X.sort(reverse==true)
C = (1/4M)*amount
for i in range(M):
  if X[i]<C:
    print("No")
    return
print("Yes")

Submission status: Runtime Error

Solution code:
l = input()
m = input()
z = l.split(' ')
M = int(z[1])
N = int(z[0])
C = (N/(4*M))
F = m.split(' ')
X = []
count = 0
for item in F:
  vote = int(item)
  if vote>C:
    count += 1
  if count = M:
    print("Yes")
    return
print("No")

Submission status: Runtime Error

Solution code:
l = input()
m = input()
z = l.split(' ')
M = int(z[1])
N = int(z[0])
C = (N/(4*M))
F = m.split(' ')
X = []
for item in F:
  votes = int(item)
  X.append(votes)

X.sort(reverse=True)
for i in range(M+1):
  if X[i]<C:
    print("No")
    break
  else:
    if i==M:
      print("Yes")

Submission status: Runtime Error

Solution code:
l = input()
m = input()
z = l.split(' ')
M = int(z[1])
N = int(z[0])
C = (N/(4*M))
F = m.split(' ')
print("Yes")
X = []
for item in F:
  votes = int(item)
  X.append(votes)

X.sort(reverse=True)
for i in range(M+1):
  if X[i]<C:
    print("No")
    break
  else:
    if i==M:
      print("Yes")

Submission status: Runtime Error

Solution code:
l = input()
m = input()
z = l.split(' ')
M = int(z[1])
N = int(z[0])
C = (N/(4*M))
F = m.split(' ')
print("Yes")
X = []
for item in F:
  votes = int(item)
  X.append(votes)

X.sort(reverse=True)
for i in range(M):
  if X[i]<C:
    print("No")
    return
print("Yes")

Submission status: Runtime Error

Solution code:
l = input()
m = input()
z = l.split(' ')
M = int(z[1])
N = int(z[0])
print("Yes")
C = (1/(4*M))*N
F = m.split(' ')
X = []
for item in F:
  votes = int(item)
  X.append(votes)

X.sort(reverse=True)
for i in range(M):
  if X[i]<C:
    print("No")
    return
print("Yes")

Submission status: Runtime Error

Solution code:

inpt = input()
l = inpt.split("\n")[0]
m = inpt.split("\n")[1]

z = l.split(' ')
M = int(z[1])
N = int(z[0])
C = (1/(4*M))*N
F = m.split(' ')
X = []
print("No")

for item in F:
	votes = int(item)
	X.append(votes)
X.sort(reverse = True)
for i in range(M):
	if X[i]<C:
		print("No")
		return
print("Yes")

Submission status: Runtime Error

Solution code:
l = input()
m = input()
z = l.split(" ")
M = int(z[1])
N = int(z[0])
C = (1/4M)N
F = m.split(" ")
X = []
for item in F:
  votes = int(item)
  X.append(votes)
  X.sort(reverse==true)
for i in range(M):
  if X[i]<C:
    print("No")
    return
print("Yes")

Submission status: Runtime Error

Solution code:
l = input()
m = input()
z = l.split(' ')
M = int(z[1])
N = int(z[0])
C = (1/(4*M))*N
F = m.split(' ')
X = []
for item in F:
	votes = int(item)
	X.append(votes)
X.sort(reverse = True)
for i in range(M):
	if X[i]<C:
		print("No")
		return
print("Yes")

Submission status: Runtime Error

Solution code:
l = input()
m = input()
z = l.split(' ')
M = int(z[1])
N = int(z[0])
C = (1/(4*M))*N
F = m.split(' ')
X = []
for item in f:
	votes = int(item)
	X.append(votes)
X.sort(reverse = True)
print("No")
for i in range(M):
	if X[i]<C:
		print("No")
		return
print("Yes")

Submission status: Runtime Error

Solution code:
l = input()
m = input()
z = l.split(" ")
M = int(z[1])
N = int(z[0])
C = (1/4M)N
F = m.split(" ")
X = []
for item in f:
  votes = int(item)
  X.append(votes)
  X.sort(reverse==true)
for i in range(M):
  if X[i]<C:
    print("No")
    return
print("Yes")

Submission status: Runtime Error

Solution code:
l = input()
m = input()
z = l.split(' ')
M = int(z[1])
N = int(z[0])
C = (1/(4*M))*N
F = m.split(' ')
X = []
for item in f:
	votes = int(item)
	X.append(votes)
X.sort(reverse = True)
for i in range(M):
	if X[i]<C:
		print("No")
		return
print("Yes")

Submission status: Runtime Error

Solution code:
l = input()
m = input()
z = l.split(" ")
M = int(z[1])
N = int(z[0])
C = (1/(4*M))*N
F = m.split(" ")
X = []
for item in f:
	votes = int(item)
	X.append(votes)
	X.sort()
for i in range(M):
	if X[i]<C:
		print("No")
		return
print("Yes")

Submission status: Runtime Error

Solution code:
l = input()
m = input()
z = l.split(" ")
M = int(l[1])
N = int(l[0])
C = (1/(4*M))*N
F = m.split(" ")
X = []
for item in f:
	votes = int(item)
	X.append(votes)
	X.sort()
for i in range(M):
	if X[i]<C:
		print("No")
		return
print("Yes")

Submission status: Runtime Error

Solution code:
N,M=map(int,input().split())
A=list(map(int,input().split()))
new_A= sorted(A,reverse=True)
if(new_A[M-1]>=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()))
  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:
#include<stdio.h>

int main()
{
    int N, M;
    int A[100];
    int all;
    double border;
    int count;
    int i;

    scanf("%d %d",&N,&M);
    for (i=0;i<N;i++){
        scanf("%d",&A[i]);
    }

    all = 0;
    for (i=0;i<N;i++){
        all += A[i];
    }

    border = all / (4*M);

    count = 0;
    for (i=0;i<N;i++){
        if (A[i]>=border) {
            count++;
        }
    }

    if (count>=M) {
        printf("Yes");
    }    
    else {
        printf("No");
    }
    return 0;
}

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import sys

nm=input().split()
a=input()
n=int(nm[0])
m=int(nm[1])
lista=[]
for i in a:
  lista.append(int(i))
count=0
suma=sum(lista)
thre=suma/4/m
for i in lista:
  if i >= thre:
    count+=1
  if count >= m:
    print('Yes')
    sys.exit()
print('No')

Submission status: Runtime Error

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

B_n=sorted(A_n,reverse=True)
i =0
count = M
while B_n[i] >= sum(B_n)/(4*M) and count>0:
    i +=1
    count -=1
if count == 0:
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

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

B_n=sorted(A_n)
i =0
count =N
while B_n[i] < sum(B_n)/(4*M) and i<=N-1:
    i +=1
    count -=1
if count >= M:
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

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

B_n=sorted(A_n)
i =0
count =len(B_n)
while B_n[i] < sum(B_n)/(4*M) and i-1<=len(B_n):
    i +=1
    count -=1
if count >= M:
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

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

B_n=sorted(A_n)
i =0
count =len(B_n)
while B_n[i] < sum(B_n)/(4*M) and i<=len(B_n):
    i +=1
    count -=1
if count >= M:
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

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

B_n=sorted(A_n)
i =0
count =len(B_n)
while B_n[i] < sum(B_n)/(4*M):
    i +=1
    count -=1
if count >= M:
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

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

B_n=sorted(A_n,reverse =True)
i =0
count =0
while B_n[i] >= sum(B_n)/(4*M):
    i +=1
    count +=1
if count >= M:
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

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

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

pro = [int(s) for s in input().split()]

vote = 0
for i in pro:
    vote += i

s_pro = sorted(pro,reverse=True)

if s_pro[m-1] < vote * 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()))
total = sum(A)
cutoff = total/4N

over=[]
for i in A:
    if i>=cutoff:
        over.append(i)

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

Submission status: Runtime Error

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

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

pro = [int(s) for s in input().split()]

vote = 0
for i in pro:
  vote += i

pro.sort(reverse=true)

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

Submission status: Runtime Error

Solution code:
#!/usr/bin/env python
# coding: utf-8

# In[10]:


N,K = int(input()), int(input())
new = abs(N-K)
while(new<N):
    N = new
    new = abs(new-K)
print(N)

Submission status: Runtime Error

Solution code:
from sys import stdin,stdout

n,m = map(int,stdin.readline().split())
a = list(map(int,stdin.readline().split())
total = sum(a)
count =0;
for x in a:
         if x>=sum/(4*m):
             count++
if(count>=m):
         print("Yes")
else:
         print("No")

Submission status: Runtime Error

Solution code:
N,M = int(input()),int(input())
l = []
for i in range(N):
  x = int(input())
  l.append(x)
l.sort(reverse = True)
if (l[M-1] >= int(sum(l)/4*M)):
	print("Yes")
else :
	print("No")

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N,M = [int(s) for s in input().split(" ")]
l = [int(k) for k in input().split(" ")]
l.sort(reverse = True)
if (l[m-1] >= (sum(l)/4*M)):
	print("Yes")
else :
	print("No")

Submission status: Runtime Error

Solution code:
N,M = [int(s) for s in input().split(" ")]
l = [int(k) for k in input().split(" ")]
l.sort(reverse = True)
if (l[m-1] >= int(sum(l)/4M)):
	print("Yes")
else :
	print("No")

Submission status: Runtime Error

Solution code:
N,M = [int(s) for s in input().split(" ")]
l = [int(k) for k in input().split(" ")]
l.sort(reverse = True)
if l[m-1] >= sum(l)/4M:
  print("Yes")
else :
  print("No")

Submission status: Runtime Error

Solution code:
N,M = [int(s) for s in input().split(" ")]
l = [int(k) for k in input().split(" ")]
l.sort(reverse = True)
if l[m-1] >= sum(l)/4M:
	print("Yes")
else :
	print("No")

Submission status: Runtime Error

Solution code:
n, m = map(int, input().split())
a = list(map(int, input().split()))
cnt = 0
 
for i in a:
  if i >= (1/(4*m)):
    cnt += 1

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

Submission status: Runtime Error

Solution code:
n, m = map(int, input().split())
a = list(map(int, input().split()))
cnt = 0
 
if sum(a) < (1/4m) or n < m:
  print("No")
else:
  print("Yes")

Submission status: Runtime Error

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

for i in a:
  if i >= (1/4m):
    cnt += 1

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

Submission status: Runtime Error

Solution code:
#!/usr/bin/env python3
import pandas as pd

n ,m = map(int, input().split())
a = pd.Series(list(map(int, input().split())))
t = a >= a.sum() * 1/(4*m)
if t.sum() >= m:
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

Solution code:
= input().split(" ")
n = int(nm[0])
m = int(nm[1])
 
a = input().split(" ")
 
total = 0
for v in a:
  total += int(v)
  
mv = total / (4 * m)
q = 0
for e in a:
  e = int(e)
  if e >= mv:
    q += 1
    
if q >= m:
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

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

a = input().split(" ")

total = 0
for v in a:
  total += int(a)
  
mv = total / (4 * m)
q = 0
for e in a:
  e = int(e)
  if e >= mv:
    q += 1
    
if q >= m:
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

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

a = input().split(" ")

total = 0
for v in a:
  total += int(a)
  
mv = total / (4 * m)
q = 0
for e in a:
  e = int(e)
  if e >= mv:
    q += 1
    
if q >= m:
  print("Yes", end="")
else:
  print("No", end="")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
s = list(map(int, input().split()))
popular = 0
vote_number = list(map(int, input().slpit()))
for i in range(s[0]):
    if vote_number[i] > popular:
        popular = vote_number[i]
if vote_number >= 1 // s[1]:
    return 'Yes'
else:
    return 'No'

Submission status: Runtime Error

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

border = sum(vote_list)/(4*m)

for i in vote_list:
  	if i > border:
      	print("yes")
    else:
      	print("no")

Submission status: Runtime Error

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

S = 0

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

for j in range (0 , N):
  	m = 0
  	if A[j] >= S / ( 4 * M ):
    	m = m + 1
    
if m >= 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)

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

if a[m] <= thold:
    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)

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

if a[m] < thold:
    print('No')
else:
    print('Yes')

Submission status: Runtime Error

Solution code:
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

// 文字列を1行入力
func StrStdin() (stringReturned string) {
	scanner := bufio.NewScanner(os.Stdin)

	scanner.Scan()
	stringReturned = scanner.Text()

	stringReturned = strings.TrimSpace(stringReturned)
	return
}

// 空白や空文字だけの値を除去したSplit()
func SplitWithoutEmpty(stringTargeted string, delim string) (stringReturned []string) {
	stringSplited := strings.Split(stringTargeted, delim)

	for _, str := range stringSplited {
		if str != "" {
			stringReturned = append(stringReturned, str)
		}
	}
	return
}

// デリミタで分割して文字列スライスを取得
func SplitStrStdin(delim string) (stringReturned []string) {
	// 文字列で1行取得
	stringInput := StrStdin()

	// 空白で分割
	// stringSplited := strings.Split(stringInput, delim)
	stringReturned = SplitWithoutEmpty(stringInput, delim)

	return
}

// デリミタで分割して整数値スライスを取得
func SplitIntStdin(delim string) (intSlices []int, err error) {
	// 文字列スライスを取得
	stringSplited := SplitStrStdin(" ")

	// 整数スライスに保存
	for i := range stringSplited {
		var iparam int
		iparam, err = strconv.Atoi(stringSplited[i])
		if err != nil {
			return
		}
		intSlices = append(intSlices, iparam)
	}
	return
}

func main() {
	input, _ := SplitIntStdin(" ")
	N, M := input[0], input[1]

	input, _ = SplitIntStdin(" ")
	input = input[0:N]
	sum := 0
	for _, x := range input {
		sum += x
	}

	var M_f float64 = float64(M)
	var sum_f float64 = float64(sum)

	count := 0
	for _, x := range input {
		var x_f float64 = float64(x)
		if x_f >= sum_f/(4.0*M_f) {
			count += 1
		}
	}
	fmt.Println(sum_f / (4.0 * M_f))
	fmt.Println(count)
}

Submission status: Runtime Error

Solution code:
N ,M = map(int, input().split())
List = list(map(int, input().split()))
stand = 1 / (4 * M) * sum(List)
arr = []
for i in range(List):
  if List[i] >= stand:
    arr.append(List[i])
if len(arr) >= 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 = list(map(int, input().split()))
     
    sum_A =0
    for i in range(N):
        sum_A += A[i]
     
    ans = 1
    for i in range(M):
        if (4*M*A[i] > sum_A):
            ans= ans*1
        else:
        	ans =ans*0
     
    if (ans == 1):
        print('Yes')
    else:
        print('No')

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N,M = map(int, input().split())
x = input()
total_vote = sum(x)
count = 0
for y in x:
    if y >=(total_vote/(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)
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())) S = sum(A)
cnt = 0
forainA:
if a >= S / (4*M): cnt += 1
ifcnt>=M: print("Yes")
else: print("No")

Submission status: Runtime Error

Solution code:
m, n = list(map(int, input().split(" ")))
a_list = list(map(int, input().split(" "))).sort(reverse=True)
if m == 0:
    print('Yes')
else:
    if a_list[m-1] >= sum(a_list) / (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()))
 
sum_A =0
for i in range(N):
    sum_A += A[i]

for i in range(N):
    if (4*M*A[M] < sum_A):
        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 =0
for i in range(N):
    sum_A += A[i]
 
if (4*M*A[M] < sum_A):
    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 =0
for i in range(N):
    sum_A += A[i]

if (4*M*A[M] < sum_A):
    print('No')
else:
    print('Yes')

Submission status: Runtime Error

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

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

if (4*M*A[M] < sum_A):
    print('No')
else:
    print('Yes')

Submission status: Runtime Error

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

items = [int(i) for i in input().join(' ')]
items.sort()
total = sum(items)

flag = 1
for i in range(M):
  if 1 // (4 * M) >= items[i]:
    pass
  else:
    flag = 0
if not flag:
  print('Yes')
else:
  print('No')

Submission status: Runtime Error

Solution code:
a = [int(i) for i in input().join(' ')]
N = a[0]
M = a[1]

items = [int(i) for i in input().join(' ')]
items.sort()
total = sum(items)

flag = 1
for i in range(M):
  if 1 // (4 * M) >= items[i]:
    pass
  else:
    flag = 0
if not flag:
  print('Yes')
else:
  print('No')

Submission status: Runtime Error

Solution code:
[int(i) for i in input().join(' ')]
N = input()
M = input()

items = [int(i) for i in input().join(' ')]
items.sort()
total = sum(items)

flag = 1
for i in range(M):
  if 1 // (4 * M) >= items[i]:
    pass
  else:
    flag = 0
if not flag:
  print('Yes')
else:
  print('No')

Submission status: Runtime Error

Solution code:
N, M= int(input().join(' '))

items = [int(i) for i in input().join(' ')]
items.sort()
total = sum(items)

flag = 1
for i in range(M):
  if 1 // (4 * M) >= items[i]:
    pass
  else:
    flag = 0
if not flag:
  print('Yes')
else:
  print('No')

Submission status: Runtime Error

Solution code:
N, M= int(input().join(' '))

items = [i for i in input().join(' ')]
items.sort()
total = sum(items)

flag = 1
for i in range(M):
  if 1 // (4 * M) >= items[i]:
    pass
  else:
    flag = 0
if not flag:
  print('Yes')
else:
  print('No')

Submission status: Runtime Error

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

items = [i for i in input().join(' ')]
items.sort()
total = sum(items)

flag = 1
for i in range(M):
  if 1 // (4 * M) >= items[i]:
    pass
  else:
    flag = 0
if not flag:
  print('Yes')
else:
  print('No')

Submission status: Runtime Error

Solution code:
a,b = map(int, input().split())
List = list(map(int, input().split()))
c = sum(List)
List = sorted(List)[::-1]
d = List(b-1)
if d < c/4/b:
	print("No")
else:
	print("Yes")

Submission status: Runtime Error

Solution code:
a,b = map(int, input().split())
List = list(map(int, input().split()))
c = sum(List)
List = sorted(List)[::-1]
d = List(b-1)
if d < c/4/b;
	print("No")
elif
	print("Yes")

Submission status: Runtime Error

Solution code:
S = input();
 
if S[2]==S[3] and S[4]==S[5]:
  print("Yes");
else:
  print("No");

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

vote.sort(reverse=True)
max_vote = sum(vote) 
flag = False
for v in vote[:select]:
	if v < max_vote/(4*select):
		print('No')
		break
else:
    print('Yse')