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 = list(map(int, input().split()))
a_list.sort(reverse=True)

total_votes = sum(a_list)

print(a_list[m-1])

if a_list[m-1] < total_votes / (4 * m):
    print('No')
else:
    print('Yes')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n, m = map(int, input().split())
a = [int(i) for i in input().split()]
s = sum(a)
a.sort()

c = 0

for i in range(len(a)):
    if (a[i] * 4 * m) > s:
        c += 1

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N,M=map(int,input().split())
A=[int(i) for i in input().split()]
count=0
for i in A:
  if((i/(4*M))>0):
    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.sort(reverse = True)
t = sum(a)
f = True
for i in range(m):
  if a[i] < t//(m*4):
    f = False
    break
if f:
    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.sort(reverse = True)
t = sum(a)
f = True
for i in range(m):
  if a[i] < t//(m*4):
    f = False
    break
if f:
    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
a=sum(A)
for i in range(N):
    if A[i]>=a/(4*M):
        count=count+1
print(count)
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()))
count=0
for i in range(N):
    if A[i]>=1/4*M:
        count=count+1
if count>=M:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
# n, m = map(int, '12 3'.split())
# a = list(map(int, '4 56 78 901 2 345 67 890 123 45 6 789'.split()))
n, m = map(int, (input()).split())
a = list(map(int, input().split()))

a = sorted(a, reverse=True)
thresh = sum(a)/(4*m)

count = 0
for i in a:
  if i >= thresh:
    count+=1
  else: 
    break
if count > m:
  print('Yes')  
else:
  print('No')

Submission status: Wrong Answer

Solution code:
n, m = map(int, '12 3'.split())
a = list(map(int, '4 56 78 901 2 345 67 890 123 45 6 789'.split()))
# n, m = map(int, (input()).split())
# a = list(map(int, input().split()))

a = sorted(a, reverse=True)
thresh = sum(a)/(4*m)

count = 0
for i in a:
  if i >= thresh:
    count+=1
  else: 
    break
if count > m:
  print('Yes')  
else:
  print('No')

Submission status: Wrong Answer

Solution code:
# n, m = map(int, '12 3'.split())
# a = list(map(int, '4 56 78 901 2 345 67 890 123 45 6 789'.split()))
n, m = map(int, (input()).split())
a = list(map(int, input().split()))

a = sorted(a, reverse=True)
thresh = sum(a)/(4*m)

count = 0
for i in a:
  if i > thresh:
    count+=1
  else: 
    break
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()))
a=sorted(a,reverse=True)
A=[]
s=sum(a)
c=s/(4*m)
for i in range(m):
  if a[i]>c:
    A.append(a[i])
print("Yes" if len(A)==m else "No")

Submission status: Wrong Answer

Solution code:
#!/usr/bin/python3

import sys

if __name__ == "__main__":
    n, m = map(int, input().split())

    a = list(map(int, input().split()))
    count = 0
    s = sum(a)

    for i in a:
        if s * (1 / 4 * m) <= i:
            count += 1
        if (m < count):
            print("Yes")
            sys.exit()

    print("No")

Submission status: Wrong Answer

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

num = a[0]
top_n = a[1]
print(num)
print(top_n)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#!/usr/bin/python3

import sys

if __name__ == "__main__":
    n, m = map(int, input().split())

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


    for i in a:
        if (1 / 4 * m) <= 1:
            count += 1
        if (m < count):
            print("Yes")
            sys.exit()

    print("No")

Submission status: Wrong Answer

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

N, M = a[0], a[1]

sum = sum(A)
print(sum)

c = 0

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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_num = sum(n_li)
    for i in range(1, m + 1):
        if all_num // (4 * m) > n_li[i - 1]:
            print('No')
            exit()
    print('Yes')


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
str1 = input()
A = input()

list1 = str1.split()
list2 = A.split()
N = list1[0]
M = list1[1]

M_count = 0

all = 0
for i in range(len(list2)):
    all = all + int(list2[i])
#print("all" + str(all))

judge =  1/(4*int(M)) * all
#print("judge" + str(judge))

for i in list2:
    #print("list2 = "+ i )
    if int(i) >= judge:
        M_count = M_count + 1
        #print("M_count" + str(M_count))
    
if M_count >= int(M):
    print("yes")
else:
    print("no")

Submission status: Wrong Answer

Solution code:
n,  m = map(int, input().split())
a=[int(x) for x in input().split()]
a=sorted(a, reverse=True)
c=0
anch=sum(a)/(4*m)
ans=[i for i in a if i>anch]
x=len(ans)
if x>=m:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
n,  m = map(int, input().split())
a=[int(x) for x in input().split()]
a=sorted(a, reverse=True)
c=0
anch=sum(a)//(4*m)
for i in a:
  if i>=anch:
    c+=1
  else:
    break
if c>=m:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

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

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

total_votes = sum(votes)
print(total_votes)
threshold = total_votes / (4*M)
print(threshold)
temp = 0
for v in votes:
    if v > threshold:
        temp += 1

if temp > M:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

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

total_votes = sum(votes)
threshold = total_votes / (4*M)
temp = 0
for v in votes:
    if v > threshold:
        temp += 1

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

Submission status: Wrong Answer

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

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

total_votes = sum(votes)
threshold = total_votes // (4*M)
temp = 0
for v in votes:
    if v > threshold:
        temp += 1

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

Submission status: Wrong Answer

Solution code:

n,m=input().split()
n,m=[int(n),int(m)]
a=list(map(int, input().strip().split()))
sum=0
for i in range(len(a)):
    sum=sum+a[i]

b=sorted(a)

if b[n-m]>sum/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()))

sumA = sum(A)

filteredA = list(filter(lambda x: x < (sumA / (4*M)), A))

if M <= len(filteredA):
    print('Yes')
else:
    print("No")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

sumA = sum(A)

filteredA = list(filter(lambda x: x < (sumA / (4*M)), A))

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n, m = map(int, input().split())
array=list(map(int, input().split()))
all = sum(array)
flag = 0
border = all/(4*m)
if array[n-1] >= border:
  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(A)
A.sort()
if A[N-M-1]<a/(4*M):
    print("No")
else:
    print("Yes")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

s = sum(a)
min_num = s//(4*m)

res = "No"
count = 0
for x in a:
    if x > min_num:
        count += 1
    if count >= m:
        res = "Yes"
        break
print(res)

Submission status: Wrong Answer

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

s = sum(a)
min_num = s//(4*m)

res = "No"
count = 0
for x in a:
    if x >= min_num:
        count += 1
    if count >= m:
        res = "Yes"
        break
print(res)

Submission status: Wrong Answer

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

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

B = sorted(A)[::-1]

T=0
for i in range(N):
  T=T+B[i]
  
#print(B)
#print(B[M-1])
#print('total',T)
#print(B[M-1])

if B[M-1]>T/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()))
b = sum(a)
c = 0
d = ""
l = 1 / (4 * m)
b = b * l
while c < m:
  if a[c] < b:
    d = "No"
  else:
    d = "Yes"
  c += 1
print(d)

Submission status: Wrong Answer

Solution code:
N,M=map(int,input().split())
A =list(map(int,input().split()))
if max(A)/sum(A)<(1/(4*M)):
    print('No')
else:
    print('Yes')

Submission status: Wrong Answer

Solution code:
n, m = map(int, input().split())
a = list(map(int, input().split()))
b = 0
c = 0
d = "Yes"
l = 1 / (4 * m)
for i in a:
  b += i
b = b * l
while c < m:
  if a[c] < b:
    d = "No"
  c += 1
print(d)

Submission status: Wrong Answer

Solution code:
n,m=map(int,input().split())
a=list(map(int,input().split()))
ma=sum(a)
a.sort()
for i in range(m):
  if(a[i]<ma/(4*m)):
    print("No")
    exit()
print("Yes")

Submission status: Wrong Answer

Solution code:
def popularVote():
    n, m = list(map(int, input().split()))
    item_votes = list(map(int, input().split()))
    total = sum(item_votes)

    selected = []
    isSelected = False

    req = 1 / (4 * m)
    for item in item_votes:
        if item / total >= req:
            selected.append(item)

        if len(selected) == n:
            isSelected = True
            print("Yes")
            break

    if not isSelected:
        print("No")


popularVote()

Submission status: Wrong Answer

Solution code:
def popularVote():
    m, n = list(map(int, input().split()))
    item_votes = list(map(int, input().split()))
    total = sum(item_votes)

    selected = []
    isSelected = False

    req = 1 / (4 * m)
    for item in item_votes:
        if item / total > req:
            selected.append(item)

        if len(selected) == n:
            isSelected = True
            print("Yes")
            break

    if not isSelected:
        print("No")


popularVote()

Submission status: Wrong Answer

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

selected = []
isSelected = False

req = 1 / (4 * m)
for item in item_votes:
  if item / total >= req:
    selected.append(item)

    if len(selected) == n:
      isSelected = True
      print("Yes")
      break

      if not isSelected:
        print("No")

Submission status: Wrong Answer

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

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

print("threshold is ",threshold)

gokaku = 0

for i in A:
  if i >= threshold:
    gokaku +=1

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

Submission status: Wrong Answer

Solution code:
def popularVote():
    m, n = list(map(int, input().split()))
    item_votes = list(map(int, input().split()))
    total = sum(item_votes)

    selected = []

    req = 1 / (4 * m)
    for item in item_votes:
        if item / total >= req:
            selected.append(item)

        if len(selected) == n:
            print("yes")
            return

    print("no")
    
popularVote()

Submission status: Wrong Answer

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

sum_line = int(sum(A) / (4 * M))
if max(A) < sum_line:
  print('No')
else:
  print('Yes')

Submission status: Wrong Answer

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

sum_line = sum(A) / (4 * M)
if max(A) < sum_line:
  print('No')
else:
  print('Yes')

Submission status: Wrong Answer

Solution code:
import numpy as np

tmp = input().split(" ")
allItem, trendingItem = int(tmp[0]), int(tmp[1])

votes = input().split(" ")
votesInt = np.asarray([int(s) for s in votes])
votesTotal = np.sum(votesInt)

standard = votesTotal // (4 * trendingItem) + 1

clearList = votesInt[votesInt >= standard]

result = 'Yes' if len(clearList) >= trendingItem else 'No'

print(result)

Submission status: Wrong Answer

Solution code:
import numpy as np

tmp = input().split(" ")
allItem, trendingItem = int(tmp[0]), int(tmp[1])

votes = input().split(" ")
votesInt = np.asarray([int(s) for s in votes])
votesTotal = np.sum(votesInt)

standard = votesTotal // (4 * trendingItem) + 1
print(votesInt)
print(standard)

clearList = votesInt[votesInt >= standard]

result = 'Yes' if len(clearList) >= trendingItem else 'No'

print(result)

Submission status: Wrong Answer

Solution code:
import numpy as np

tmp = input().split(" ")
allItem, trendingItem = int(tmp[0]), int(tmp[1])

votes = input().split(" ")
votesInt = np.asarray([int(s) for s in votes])
votesTotal = np.sum(votesInt)

standard = votesTotal // (4 * trendingItem)

clearList = votesInt[votesInt >= standard]

result = 'Yes' if len(clearList) >= trendingItem else 'No'

print(result)

Submission status: Wrong Answer

Solution code:
import numpy as np

tmp = input().split(" ")
allItem, trendingItem = int(tmp[0]), int(tmp[1])

votes = input().split(" ")
votesInt = np.asarray([int(s) for s in votes])
votesTotal = np.sum(votesInt)

standard = votesTotal // (4 * trendingItem)

clearList = votesInt[votesInt > standard]

result = 'Yes' if len(clearList) >= trendingItem else 'No'

print(result)

Submission status: Wrong Answer

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

total = sum(a)

count = 0

valid = total / (4 * m)

for i in a:
    if i > valid:
        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()))

total = sum(a)

count = 0

valid = total / (4 * m)

for i in a:
    if i > valid:
        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()))

total = 0

for i in a:
    total += i

count = 0

valid = total / (4 * m)

for i in a:
    if i > valid:
        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()))
a.sort(reverse=True)
t = sum(a) // (4 * m)
l = sum(x >= t for x in a)
if l >= m:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import numpy as np

N,M = map(int, input().split())
An = np.array(input().split(), dtype=int)

vote_sum = np.sum(An)
judge = np.where(An > vote_sum /(4 * M), 1, 0)
judge_sum = np.sum(judge)

if(judge_sum >= 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())),reverse=True)
print ("Yes") if a[m-1] > sum(a)/(4*m) else print ("No")

Submission status: Wrong Answer

Solution code:
x,y= list(map(int, input().split()))
i = list(map(int, input().split()))
i.sort(reverse=True)
k=sum(i)
ans=0
for j in range(y):
    if i[j]<k/(4*(j+1)):
        pass
    else:
      ans+=1
      
if ans<y:
    print("No")
else:
    print("Yes")

Submission status: Wrong Answer

Solution code:
n,m=map(int,input().split())
a=sorted(list(map(int,input().split())),reverse=True)
flag=1
s=sum(a)
for i in a[0:m]:
  if i>s/(4*m):
    pass
  else:
    print('No')
    flag=0
    break
if flag:
  print('Yes')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

def main():
	n, m = read()
	a = read()
	number_of_popular_items = 0
	total_vote = 0
	total_vote = sum(a)
	for i in range(n):
		if a[i] >= total_vote//(4*m):
			number_of_popular_items += 1
	if number_of_popular_items >= m:
		print("Yes")
	else:
		print("No")
main()

Submission status: Wrong Answer

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

for Ai in A:
    if Ai>=S//(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 = [int(i) for i in input().split()]
cnt = 0
flag = False
A = sorted(A)[::-1]
for a in A:
  if a >= (1/(4*m)):
    cnt += 1
  if cnt == m:
    flag = True
    break
if flag:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
n, m = map(int,input().split())
A = [int(i) for i in input().split()]
cnt = 0
flag = False
A = sorted(A)[::-1]
Asum = sum(A)
for a in A:
  if a >= (1/(4*Asum)):
    cnt += 1
  if cnt == m:
    flag = True
    break
if flag:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
#abc161b
n,m=map(int,raw_input().split())
a=map(int,raw_input().split())
x=sum(a)/(4*m)
l=[i for i in a if i>=x]
if len(l)>=m:
 print 'Yes'
else:
 print 'No'

Submission status: Wrong Answer

Solution code:
m = input()
b = input()
x = int(0)
a = list()

n, m = m.split(' ')
n = int(n)
m = int(m)

b = b.split(' ')
for i in range(len(b)):
    a.append(int(b[i]))

list.sort(a, reverse = True)

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

for i in range(m):
    print(a)
    if int(a[i]) < x / (4 * m):
        print('No')
        exit()

print('Yes')

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)
    c = 0
    for i in range(n):
        if a[i] < (s+1)//(4*m):
            c += 1
    ans = n - c
    print('Yes') if ans >= m else print('No')
main()

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)
    c = 0
    for i in range(n):
        if a[i] < (s+1)/(4*m):
            c += 1
    ans = n - c
    print('Yes') if ans >= m else print('No')
main()

Submission status: Wrong Answer

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

S = sum(A)
pop = []
for i in range(N):
    if S < A[i]*(4*M):
        pop.append(A[i])

if len(pop) >= M:
    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_sort=sorted(A_list, reverse=True)
if A_sort[M-1] <1/(4*M):
  print("No")
else:
  print("Yes")

Submission status: Wrong Answer

Solution code:
N,M=map(int, input().split())
A=list(map(int, input().split()))
s=sum(A)
cnt=0
for i in A:
    if i>s*1/(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()))
s=sum(A)
cnt=0
for i in A:
    if i>s/(4*M):
        cnt+=1
        
if cnt>=M:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

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

total_item_votes = sum(item_votes)

item_vote_percentages = [item_votes/total_item_votes for item_votes in item_votes]

required_vote_percentage = 1/(4*m)

can_select = 0
for vote_percentage in item_vote_percentages:
    if vote_percentage > required_vote_percentage:
        can_select += 1

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

Submission status: Wrong Answer

Solution code:
import math
N,M = map(int,input().split())
List = list(map(int,input().split()))
a = 0
b = 0
for i in range(0,N):
    a = a + List[i]
for j in range(0,N):
    if List[j] > math.floor(a/(4*M)):
        b = b+1
if b <  M:
    print('No')
else:
    print('Yes')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

B = [j for j in A if j>(sum(A)/(4*M))]

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

Submission status: Wrong Answer

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

#総投票数を求める
sum_vote = sum(A)
#print(sum_vote)

#投票数が1/4Mを下回る物を削除していく つまり　新しいリストに代入
for i in range(len(A)):
    if A[i] > sum_vote * 1/(4 * M):
        B.append(A[i])
    else:
        pass

#最終判断
if len(B) > 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
for i in a :
  if i >= 1/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_sum = sum(A) 
cnt = 0
for i, a in enumerate(A):
    if a*(4*M) < A_sum:
        cnt += 1

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

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
#標準入力の取得
N,M = map(int,input().split())
A = list(map(int,input().split()))

cutoff = sum(A)/(4*M)
count_pop = sum(i > cutoff for i in A)


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

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
#標準入力の取得
N,M = map(int,input().split())
A = list(map(int,input().split()))

cutoff = sum(A)/4
count_pop = sum(i >= cutoff for i in A)


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

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
#標準入力の取得
N,M = map(int,input().split())
A = list(map(int,input().split()))

cutoff = sum(A)/4
count_pop = sum(i > cutoff for i in A)


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

Submission status: Wrong Answer

Solution code:
N,M = map(int,input().split())
A = list(map(int,input().split()))
tot_votes = sum(A)
req = int(tot_votes//(4*M))
count = 0
i = 0
while(i<N):
    if(A[i]>=req):
        count+=1
    i+=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()))
tot_votes = sum(A)
req = int(tot_votes//(4*M))
count = 0
i = 0
while(count<M and i<N):
    if(A[i]>=req):
        count+=1
    i+=1
if(count<M):
    print("No")
else:
    print("Yes")

Submission status: Wrong Answer

Solution code:
N,M = map(int,input().split())
A = list(map(int,input().split()))
tot_votes = sum(A)
req = int(tot_votes//(4*M))
count = 0
i = 0
while(count!=M and i<N):
    if(A[i]>=req):
        count+=1
    i+=1
if(count<M):
    print("No")
else:
    print("Yes")

Submission status: Wrong Answer

Solution code:
N,M = map(int,input().split())
A = list(map(int,input().split()))
tot_votes = sum(A)
req = int(tot_votes//(4*M))
count = 0
i = 0
while(count!=M and i<N):
    if(A[i]>req):
        count+=1
    i+=1
if(count<=M):
    print("No")
else:
    print("Yes")

Submission status: Wrong Answer

Solution code:
N,M = map(int,input().split())
A = list(map(int,input().split()))
tot_votes = sum(A)
req = int(tot_votes//(4*M))
count = 0
i = 0
while(count!=M and i<N):
    if(A[i]>req):
        count+=1
    i+=1
if(count<M):
    print("No")
else:
    print("Yes")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N,M = input().split()
A = list(map(int,input().split()))
tv = sum(A)
req = int(tv/(4*int(M)))
i,count=0,0
while(i<int(N) and count<int(M)):
    if(A[i]>int(req)):
        count+=1
    i+=1
if(count==int(M)):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
N,M = input().split()
A = list(map(int,input().split()))
tv = sum(A)
req = int(tv/(4*int(M)))
i,count=0,0
while(i<int(N)):
    if(A[i]>int(req)):
        count+=1
    i+=1
if(count>int(M)):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
N,M = map(int,input().split())
A = list(map(int,input().split()))
tv = sum(A)
req = int(tv/(4*int(M)))
i,count=0,0
while(i<int(N)):
    if(A[i]>int(req)):
        count+=1
    i+=1
if(count>=int(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)
if A[M - 1] < 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()))

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

Submission status: Wrong Answer

Solution code:
nm=input().split()
vote=[int(i) for i in input().split()]
n=int(nm[0])
m=int(nm[1])
selectable=0
for v in vote:
	if v < 4*m:
		continue
	else:
		selectable+=1
if selectable>=m:
	print("Yes")
else:
	print("No")

Submission status: Wrong Answer

Solution code:
import sys
n,m=[int(x) for x in input().split()]
a = [int(x) for x in input().split()]
total = sum(a)
cnt = n
for i in range(0, n):
  if a[i] < int(total / (4 * m)):
    cnt -= 1
  if cnt < m:
    print("No")
    sys.exit()
print("Yes")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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