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: Wrong Answer

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

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

min_hyou = int(1/(4*m) * sum)

count = 0
for i in range(len(a)):
    if min_hyou < a[i]:
        count+=1
if count>=m:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
N,M=(input().split())
A=(input().split())
if 1//4==A:
    print("No")
else:
    print("Yes")

Submission status: Wrong Answer

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

a = sorted(A, reverse=True)

b = a[M-1]
c = sum(a)
d = 4*M
e = c//d

if b>e:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

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

count = 0

for i in range(N-1):
	if A[i]<(0.25/M*sum(A)):
		break
	else:
		count +=1
	if count == M:
		break

if N ==1:
	print("Yes" if A[0]>0 else "No")
else:
	print("Yes" if count >=M else "No")

Submission status: Wrong Answer

Solution code:
N, M = map(int, input().split())
N = input().split()
N = [int(n) for n in N]
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)

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

Submission status: Wrong Answer

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

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

min_hyou = int(1/(4*m) * sum)
print(min_hyou)

count = 0
for i in range(len(a)):
    if min_hyou < a[i]:
        count+=1
if count>=m:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

if (arrayNM[1] <= ninnkiCounter):
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
n, m = (int(x) for x in input().split())
num_point = [int(x) for x in input().split()]
count = 0

print(sum(num_point))
for n in num_point:
    n > (sum(num_point)/(4*m))
    count += 1

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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



def check(A,M):
    flag = 0
    condition = sum(A)/(4*M)
    if(M==1 and max(A)>condition):
        return "Yes"
    for i in A:
        if(i <= condition):
            continue
        else:
            flag+=1
            if(flag==M):
                return "Yes"
    return "No"

print(check(A,M) if N>=1 and N<=100 else "No")

Submission status: Wrong Answer

Solution code:
N, M = map(int, input().split())
A = sorted(list(map(int, input().split())))
ans = sum(x > sum(A) // 4 // M for x in A)
print('Yes' if ans >= M > 0 else 'No')

Submission status: Wrong Answer

Solution code:
a,b = list(map(int,input().split()))
aaa = list(map(int,input().split()))

result = [0]*a
for i in range(a):
    h = aaa[i]
    j = int(sum(aaa) / (4*b))

    if h > j:
        result[i] = 1
    else:
        result[i] = 0

if result.count(1) >= b:
    ans = "yes"
else:
    ans = "no"

print(ans)

Submission status: Wrong Answer

Solution code:
N,M=(input().split())
A=(input().split())
for i in range(int(M)):
    if 1//4==A:
        print("No")
    else:
        print("Yes")

Submission status: Wrong Answer

Solution code:
N,M=(int(x) for x in input().split())

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

list.sort(A,reverse = True)

s=float(sum(A)/(4*M))
check=0
for i in range(0, M):
    if A[i]<=s:
        check=1

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

Submission status: Wrong Answer

Solution code:
def resolve():
	N, M, *A = map(int, open(0).read().split())
	vote = sum(A) / (4*M)
	num = list(filter(lambda x: x > vote, A))
	num = len(num)
	if num >= M:
		print("Yes")
	else:
		print("No")
resolve()

Submission status: Wrong Answer

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



def check(A,M):
    flag = 0
    condition = sum(A)//(4*M)
    if(M==1 and max(A)>condition):
        return "Yes"
    for i in A:
        if(i <= condition):
            continue
        else:
            flag+=1
            if(flag==M):
                return "Yes"
    return "No"

print(check(A,M) if N>=1 and N<=100 else "No")

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())
l=list(map(int,input().split()))
t=sum(l)/(4*b)
ans = [i for i in l if i>t]
print('Yes' if len(ans)>=b else 'No')

Submission status: Wrong Answer

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

t = 0
check=False
if(1<=m<=n<100 and n==len(a)):
  check=True
  for i in range(len(a)):
    if(1<=a[i]<=1000):
      t += a[i]
    else:
      check=False
      break
   
  if(check):
    for i in reversed(range(len(a))):
      for j in range(i):
        if(a[j] < a[j+1]):
          a[j], a[j+1] = a[j+1],a[j]
        elif(a[j] == a[j+1]):
          check=False
          break

  if(check == True):
    for i in range(m):
      if(a[i] > t/(4*m)):
        check = True
      else:
        check=False
        break


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

Submission status: Wrong Answer

Solution code:
def resolve():
	N, M, *A = map(int, open(0).read().split())
	vote = sum(A) / (4*M)
	num = list(filter(lambda x: x > vote, A))
	num = len(num)
	if num > M:
		print("Yes")
	else:
		print("No")
resolve()

Submission status: Wrong Answer

Solution code:
N, M = map(int, input().split())
An   = list(map(int, input().strip().split()))
sumN = sum(An)
Limit = int(sumN/(4*M))

cnt = 0
i = 0
for i in range(N):
    if An[i] < Limit:
        cnt = cnt+1
        #得票数が総得票数1/4m未満である場合に、カウント+1
chosable = N - cnt
#選べない商品数を、Nから引いて、選べる商品数を出す。

if chosable >= M:
    print("Yes")
else:
    print("No")
#選べる消費数がM個以上なら、Yes。

Submission status: Wrong Answer

Solution code:
N, M = map(int, input().split())
A = sorted(list(map(int, input().split())))
ans = sum(x > sum(A) // 4 // M for x in A)
print('Yes' if ans >= M and ans != N else 'No')

Submission status: Wrong Answer

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

A = list(map(int,input().split()))
a = len(list(filter( lambda x:x>=1/(4*M),A)))

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

Submission status: Wrong Answer

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

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

min_hyou = 1/(4*m) * sum
count = 0
for i in range(len(a)):
    if min_hyou < a[i]:
        count+=1
if count==m:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

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

N = input_d21[0]
M = input_d21[1]

A = input_d22

sohyo = sum(A)
zyoken = float(sohyo) / float(4 * M)


A = sorted(A, reverse=True)
print(A)
print(sohyo)
print(zyoken)

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

Submission status: Wrong Answer

Solution code:
N, M= map(int, input().split())
votes = list(map(int, input().split()))
sumvotes = sum(votes)
cut = sumvotes/(4*M)
choice = 0


for i in range(N):
    if votes[i] > cut:
        choice = choice + 1
if choice >= M:
    print("Yes")
elif M > choice:
    print("No")

Submission status: Wrong Answer

Solution code:
n,m=map(int,input().split())
v=list(map(int,input().split()))
v.sort(reverse=True)
s=sum(v)//(4*m)
c=0
for x in v:
    if x>s:

        c+=1
if c>=m:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:

i = list(map(int, input().split()))
N = i[0]
M = i[1]
A  = list(map(int, input().split()))
S=sum(A)
A_sorted=sorted(A,reverse=True)
print(S*1/4*M)
if A_sorted[M-1] >= S*1/(4*M):
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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



def check(A,M):
    flag = 0
    condition = sum(A)//(4*M)
    if(M==1 and max(A)>condition):
        return "Yes"
    for i in A:
        if(i < condition):
            continue
        else:
            flag+=1
            if(flag==M):
                return "Yes"
    return "No"

print(check(A,M) if N>=1 and N<=100 else "No")

Submission status: Wrong Answer

Solution code:
N, M = map(int, input().split())
a_list =  list(map(int, input().split()))
a_list.sort(reverse = True)
count = 0
flag = False
for voted in a_list:
    if count == M:
        flag = True
    if voted >=1/(4*M):
        count +=1
if flag:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
N,M=(int(x) for x in input().split())

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

list.sort(A,reverse = True)
print(A)

s=float(sum(A)/(4*M))
check=0
for i in range(0, M):
    if A[i]<=s:
        check=1

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

Submission status: Wrong Answer

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

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

min_hyou = 1/(4*m) * sum
count = 0
for i in range(len(a)):
    if min_hyou < a[i]:
        count+=1
if count>=m:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

all_a = sum(a)
flag = True

a.sort(reverse=True)

for i in range(m):
    if a[i] <= (all_a / (4 * m)):
        flag = False
if flag:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
N,M = map(int,input().split())
l = [int(i) for i in input().split()]
l.sort(reverse = True)
l_sum = sum(l)
cnt = 0
 
for i in range(N):
    if l[i] > (1/(4*M))*l_sum:
        cnt += 1
    else:
        break
 
if cnt >= M:
    print("Yes")
elif cnt < M:
    print("No")

Submission status: Wrong Answer

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

# N種類の商品
N = li[0]

# 選ぶ個数M
M = li[1]

# 総得票数
sumA = sum(A)

# 基準総得票数の1/4M
check = sumA / (4*M)

# 基準より上の要素を入れる箱
box = []

for i in A:
    if i > check:
        box.append(i)

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

Submission status: Wrong Answer

Solution code:
N, M = map(int, input().split())
A = sorted(list(map(int, input().split())))
ans = sum(x > sum(A) // 4 // M for x in A)
print('Yes' if ans >= M else 'No')

Submission status: Wrong Answer

Solution code:
#python3
def main():
    n, m = map(int, input().split())
    a = [int(i) for i in input().split()]
    s = sum(a)
    x = s//(4*m)
    c = 0
    for i in range(n):
        if x >= a[i]:
            c += 1
    
    k = n-c
    if k >= m:
        print('Yes')
    else:
        print('No')
main()

Submission status: Wrong Answer

Solution code:
NM=list(map(int,input().split()))
N=NM[0]
M=NM[1]
N_list=list(map(int,input().split()))
 
total=sum(N_list)
 
total=total/4
 
counter=0
for number in N_list:
  if number>=total/4:
    counter+=1
    
if counter>=M:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N, M = map(int, input().split())
a_list =  list(map(int, input().split()))
a_list.sort(reverse = True)
count = 0
flag = False
for voted in a_list:
    if count > M:
        flag = True
    if voted >=1/(4*M):
        count +=1
if flag:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())
l=list(map(int,input().split()))
t=sum(l)//(4*b)
ans = [i for i in l if i>t]
print('Yes' if len(ans)>b else 'No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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



def check(A,M):
    flag = 0
    condition = sum(A)//(4*M)
    if(M == 0):
        return "No"
    if(M==1 and max(A)>condition):
        return "Yes"
    for i in A:
        if(i > 1000 or i < 1):
            print("No")
        if(i > condition):
            flag+=1
        if(flag==M):
            return "Yes"
    return "No"

print(check(A,M) if N>=1 and N<=100 else "No")

Submission status: Wrong Answer

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

A.sort(reverse=True)

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

Submission status: Wrong Answer

Solution code:
n, m = map(int,input().split())
a = list(map(int,input().split()))
a.sort(reverse = True)
s = sum(a)
for i, l in enumerate(a):
    if l < s//(4*m):
        i -= 1
        break
if i >= m-1:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
n=input().split()
N=int(n[0])
M=int(n[1])
a=input().split()
#print(a)
a = [int(i) for i in a] # ここでリストの中の値をint型へ変換しています。
b=sum(a)/(4*M)
c=sorted(a)[N-(M+1)]
if c>=b :
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

A_sum=0

for a in A:
    A_sum+=a

bording=A_sum/(4*M)

score=0
for a in A:
    if a >= bording:
        score += 1
if M<score:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())
l=list(map(int,input().split()))
t=sum(l)//(4*b)
ans = [i for i in l if i>t]
print('Yes' if len(ans)>=b else 'No')

Submission status: Wrong Answer

Solution code:
q,p= input().split()
a,b =(int(p), int(q))
s = input().split()
total = 0
for i in range(b):
    total += int(s[i])
if total >= a:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

A_sum =sum(A)

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

Submission status: Wrong Answer

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

if (arrayNM[1] <= ninnkiCounter):
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
import numpy as np

if __name__ == "__main__":
    N, M = map(int, input().split())
    A = list(map(int, input().split()))
    A = sorted(A, reverse=True)
    a = np.asarray(A[:M])
    for i in a:
        print(i)
        print(sum(A)/(M*4))
        if i >= sum(A)/(M*4):
            ret = "Yes"
            continue
        else:
            ret = "No"
            break
    print(ret)

Submission status: Wrong Answer

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

list_goods.sort(reverse=True)

flag = "Yes"

if list_goods[M-1] < sum(list_goods)//(4*M):
    flag = "No"

print(flag)

Submission status: Wrong Answer

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



def check(A,M):
    flag = 0 
    condition = sum(A)//(4*M)
    if(M==1 and max(A)>condition):
        return "Yes"
    for i in A:
        if(i > 1000 or i < 1):
            print("No")
        if(i > condition):
            flag+=1
        if(flag==M):
            return "Yes"
    return "No"

print(check(A,M) if N>=1 and N<=100 else "No")

Submission status: Wrong Answer

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

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

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

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

Submission status: Wrong Answer

Solution code:
import math

S =  list(map(int,input().split()))
N = S[0]
M = S[1]
A =  list(map(int,input().split()))

As = sorted(A,reverse=True)
r = []
s = sum(A)
for i in range(M):
    
    if As[i] > s*(1/4)*(1/M):
        r.append(As[i])
        if len(r) == M:
            print('Yes')
   
            
    else:
        print('No')

Submission status: Wrong Answer

Solution code:
n, m = map(int, input().split())
a = list(map(int, input().split()))
c = sum(a)//(4*m)
ans = sorted(a, reverse=True)
ans_0 = ans[:m]
if min(ans_0) < c:print('No')
else:print('Yes')

Submission status: Wrong Answer

Solution code:
N, M = map(int, input().split())
An   = list(map(int, input().strip().split()))
sumN = sum(An)
Limit = int(sumN/(4*M))

cnt = 0
i = 0
for i in range(N):
    if An[i] >= Limit:
        cnt = cnt+1

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

Submission status: Wrong Answer

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

a = sorted(A, reverse=True)

b = a[M-1]
c = sum(a)
d = 4*M
e = c//d

if b>e:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
a,b = list(map(int,input().split()))
aaa = list(map(int,input().split()))

result = [0]*a
for i in range(a):
    h = aaa[i]
    j = int(sum(aaa) / (4*b))

    if h >= j:
        result[i] = 1
    else:
        result[i] = 0

if result.count(1) >= b:
    ans = "yes"
else:
    ans = "no"

print(ans)

Submission status: Wrong Answer

Solution code:
n, m = map(int, input().split())
a =  list(map(int, input().split()))
t = sum(a)// (4 * m)
c = [i for i in a if i >= t]

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

Submission status: Wrong Answer

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

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

#総投票数
s = sum(a)

a.sort(reverse=True)

b = 0

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

N = input_d21[0]
M = input_d21[1]

A = input_d22

sohyo = sum(A)
zyoken = float(sohyo) // float(4 * M)


A = sorted(A, reverse=True)

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

Submission status: Wrong Answer

Solution code:
n, m = (int(x) for x in input().split())
num_point = [int(x) for x in input().split()]
count = 0

for n in num_point:
    n > sum(num_point) * 1 / (4 * m)
    count += 1
    print(n)

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

Submission status: Wrong Answer

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) >= tokuhyousuu):
    ninnkiCounter += 1
    

if (arrayNM[1] <= ninnkiCounter):
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

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

count = 0

for i in range(N-1):
	if A[i]<(0.25/M*sum(A)):
		break
	else:
		count +=1
	if count == M:
		break

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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



def check(A,M):
    flag = 0 
    condition = sum(A)//(4*M)
    if(M==1 and max(A)>condition):
        return "Yes"
    for i in A:
        if(i > 1000 or i < 1):
            print("No")
        if(i > condition):
            flag+=1
        if(flag==M):
            return "Yes"
    return "No"

print(check(A,M) if M>=1 and N<=100 else "No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

x = cnt // (4*M)

for i in range(N):
  if x > A[i]:
    ans += 1

Z = ans - M

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

Submission status: Wrong Answer

Solution code:
n,m = map(int,input().split())
arr = list(map(int,input().split()))
arr.sort()
M = round(sum(arr)/(2*m))
cnt = 0
for i in range(n):
  if arr[i] > M:
    cnt+=1
    
if cnt == m or cnt > m:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

A_sum =sum(A)

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a,b = list(map(int,input().split()))
aaa = list(map(int,input().split()))

aaa.sort(reverse = True)

result = [0]*a
for i in range(a):
    h = aaa[i]
    j = int(sum(aaa) / (4*b))

    if h >= j:
        result[i] = 1
    else:
        result[i] = 0

if result.count(1) >= b:
    ans = "yes"
else:
    ans = "no"

print(ans)

Submission status: Wrong Answer

Solution code:
N, M = map(int, input().split())
A = sorted(list(map(int, input().split())))
ans = sum(x >= sum(A) // 4 // M for x in A)
print('Yes' if ans >= M else 'No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import copy

n, m = map(int, input().split())
aList = list(map(int, input().split()))
oriList = copy.deepcopy(aList)

total = sum(aList)

flag = "No"
removedElement = 0
while 1/(4*m) < max(oriList) and removedElement <= m and 2 <= len(aList):
    if removedElement == m:
        flag = "Yes"
    removedElement += 1
    aList.remove(max(aList))

print(flag)

Submission status: Wrong Answer

Solution code:
def main():
    N, M = [int(x) for x in input().split()]
    A = [int(x) for x in input().split()]
    import heapq
    bests = heapq.nlargest(M, A)
    # print(bests)
    if bests[-1] >= sum(A)//(4*M):
        print("Yes")
    else:
        print("No")


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
n,m = map(int,input().split())
arr = list(map(int,input().split()))
arr.sort()
M = round(sum(arr)/(2*m))
cnt = 0
for i in range(n):
  if arr[i] >= M:
    cnt+=1
    
if cnt == m or cnt > m:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

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


ans = "Yes"
compare = sum(A)//(4*m)
for i in range(m):
    if A[i] < compare:
        ans = "No"

print(ans)

Submission status: Wrong Answer

Solution code:
NM = [int(_) for _ in input().split()]
N = NM[0]
M = NM[1]

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

def solve(N, M, A):
    
    d = int(sum(A) / (4 * M))
    
    a = [i for i in A if i>=d ]
    
    if  len(a) >= M:
        return "Yes"
    else:
        return "No"

print(solve(N, M, A))

Submission status: Wrong Answer

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



def check(A,M):
    flag = 0 
    condition = sum(A)//(4*M)
    if(M==1 and max(A)>condition):
        return "Yes"
    for i in A:
        if(i > condition):
            flag+=1
        if(flag==M):
            return "Yes"
    return "No"

print(check(A,M) if N<=100 else "No")

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())
l=list(map(int,input().split()))
t=sum(l)//(4*b)
ans = [True for i in range(len(l)-b) if sum(l[i:i+b])]
print('Yes' if ans and all(ans) else 'No')

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

if A[nm[1]-1] > s/4/nm[1]:
    print("Yes ")
else:
    print("No ")

Submission status: Wrong Answer

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: Wrong Answer

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

Submission status: Wrong Answer

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)])<m::2])

Submission status: Wrong Answer

Solution code:
NM=list(map(int,input().split()))
N=NM[0]
M=NM[1]
N_list=list(map(int,input().split()))

total=sum(N_list)

total=total/4

counter=0
for number in N_list:
  if number>total/4:
    counter+=1
    
if counter>=M:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
n,m = map(int, input().split())
i = list(map(int, input().split()))
j=sorted(i, reverse=True)

# print(n)
# print(m)
# print(i)
# print(j)

# print(j[m-1])
# print(sum(i))
# print(sum(i)/(4*m))
if j[m-1]>sum(i)/(4*m):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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-1)]) < b:
    print("No")
else:
    print("Yes")

Submission status: Wrong Answer

Solution code:
N, M = map(int, input().split())
A = list(map(int, input().split()))
F = 0
trigger = 1 / (4 * M)

for i in range(len(A)):
    if A[i]/sum(A) > trigger:
        F = F + 1
        
if F >= M:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
N,M = map(int, input().split())
list_A = input().split()
list_A_int = [int(s) for s in list_A]
list_A_int_sort = sorted(list_A_int, reverse=True)

compare_num = 1/(4*M)

if list_A_int_sort[M-1] < compare_num:
  print("No")
else:
  print("Yes")

Submission status: Wrong Answer

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

N = input_d21[0]
M = input_d21[1]

A = input_d22

sohyo = sum(A)
zyoken = float(sohyo) // (4 * M)


A = sorted(A, reverse=True)

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