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()))
a.sort(reverse=True)
ans = 0
for i in a:
  if i > sum(a)/(4*m):
    ans += 1
    if ans == m:
      print("Yes")
      exit()
  else:
    print("No")
    exit()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n,m = map(int,input().split())
l = list(map(int,input().split()))
l.sort(reverse=True)
for i in range(m) :
    if l[i] < (sum(l))/4*m :
        print('No')
        exit()
    else :
        continue
print('Yes')

Submission status: Wrong Answer

Solution code:
n,m=map(int,input().split())
a=list(map(int,input().split()))
h = True
s = sum(a)
ma = max(a)
ans =0
while ans<m and h == True:
  for i in range (len(a)):
    if a[i] == ma:
      ans +=1
      a[i] =0
      ma = max(a)

if ma <s/(4*m):
  print('No')
  exit()
print('Yes')

Submission status: Wrong Answer

Solution code:
n,m=map(int,input().split())
a=list(map(int,input().split()))
h = True
s = sum(a)
ma = max(a)
ans =0
while ans<m and h == True:
  for i in range (len(a)):
    print(a)
    if a[i] == ma:
      ans +=1
      a[i] =0
      ma = max(a)

if ma <s/(4*m):
  print('No')
  exit()
print('Yes')

Submission status: Wrong Answer

Solution code:
n,m=map(int,input().split())
a=list(map(int,input().split()))
h = True
s = sum(a)
ma = max(a)
ans =0
while ans<m and h == True:
  for i in range (len(a)):
    if a[i] == ma:
      ans +=1
      a[i] ==0
      ma = max(a)
      if ma<s/4/m:
        print('No')
        exit()
      if ans == m:
        print('Yes')
        exit()
      break

Submission status: Wrong Answer

Solution code:
n,m=map(int,input().split())
a=list(map(int,input().split()))
h = True
s = sum(a)
ma = max(a)
ans =0
while ans<m and h == True:
  for i in range (len(a)):
    if a[i] == ma:
      ans +=1
      a[i] ==0
      ma = max(a)
      if ma<s/4/m:
        ans -=1
        h == False
        print('No')
        exit()
    if ans == m:
      print('Yes')
      exit()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if N==K:
  print(0)

elif N<K:
  lis1=[N,abs(N-K)]
  print(min(lis1))
  
else:
  lis2=[N%K,abs(N%K-K)]
  print(min(lis2))

Submission status: Wrong Answer

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

sum_product = sum(product_list)

is_choose = 0
for i in range(M):
    if product_list[i] < (sum_product // (4*M)):
        is_choose = True

if is_choose:
    print("No")
else:
    print("Yes")

Submission status: Wrong Answer

Solution code:
n, m = map(int, input().split())
a = list(map(int, input().split()))
criteria = sum(a) / (m * 4)

ans = 0
for i in a:
    if i >= criteria:
        ans += 1

if ans >= m:
    print('YES')
else:
    print('NO')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N,M = map(int,input().split())
array = list(map(int,input().split()))
count = 0
for i in range(N):
  if array[i] > 1/4*M :
    count += 1
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()))
s=sum(a)
cnt=0
for i in range(n):
    if a[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 range(n):
    if a[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 = sorted([int(x) for x in input().split()], reverse=True)
sumA = sum(A)

if A[M - 1] > sumA / (4 * M):
    print("Yes")
else:
    print('No')

Submission status: Wrong Answer

Solution code:
import decimal

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

Submission status: Wrong Answer

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

if bisect.bisect(A,sum(A)/4/M)>=N-M:
  print('No')
else:print('Yes')

Submission status: Wrong Answer

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

if bisect.bisect(A,sum(A)/4/M)>N-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 = sum(A)
th = A_sum / (4 * M)
popular_product = 0

for a in A:
    if a >= th:
        popular_product += 1

if popular_product >= 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 = sum(A)
th = A_sum / (4 * M)
popular_product = 0

for a in A:
    if a >= th:
        popular_product += 1

if popular_product <= 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 = sum(A)
th = A_sum / (4 * M)
popular_product = 0

for a in A:
    if a <= th:
        popular_product += 1

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

Submission status: Wrong Answer

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

A = sorted(A, reverse=True)
S = sum(A)
ans = "No"
for i in range(M):
    if A[i] >= S // (4 * M):
        ans = "Yes"
    else:
        ans = "No"
        break
print(ans)

Submission status: Wrong Answer

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

comparison = sum(lst)
popular = max(lst)
limit = (1 / (4 * M))

if popular >= comparison * limit:
    print("Yes")
elif popular < comparison * limit:
    print("No")

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)

for i in range(M):
    if A[i] < sum_A / (4.0):
        print('No')
        exit()

print('Yes')

Submission status: Wrong Answer

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

std = sum(a)*1/(4*m)
print(std)

cnt = 0
for i in range(n):
    if a[i] >= std:
        cnt += 1


"""
cnt = 0
for i in range(m):
    if max(a) >= std:
        cnt += 1
        print(a[a.index(max(a))])
        del a[a.index(max(a))]
"""
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()))
k = sum(a)*(1/4*m)
b = [i for i in a if i >= k]

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()))
k = sum(a)//(4*m)
b = [i for i in a if i >= k]

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()))
k = sum(a)//(4*m)
b = [i for i in a if i >= k]

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

Submission status: Wrong Answer

Solution code:
# coding=utf-8

if __name__ == '__main__':
    N, M = map(int, input().split())
    li = list(map(int, input().split()))
    lisum = sum(li)

    cnt = 0
    for i in range(N):
        if int(lisum / (M * 4)) <= li[i]:
            cnt += 1

    if M <= cnt:
        print('Yes')

    else:
        print('No')

Submission status: Wrong Answer

Solution code:
# coding=utf-8

if __name__ == '__main__':
    N, M = map(int, input().split())
    li = list(map(int, input().split()))
    lisum = sum(li)

    cnt = 0
    for i in range(N):
        if int(lisum / (M * 4)) < li[i]:
            cnt += 1

    if M <= cnt:
        print('Yes')

    else:
        print('No')

Submission status: Wrong Answer

Solution code:
# coding=utf-8

if __name__ == '__main__':
    N, M = map(int, input().split())
    li = list(map(int, input().split()))
    lisum = sum(li)

    cnt = 0
    for i in range(N):
        if lisum / (M * 4) < li[i]:
            cnt += 1


    if M <= cnt:
        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)
th = s / (4*M)
cnt = 0

for a in A:
    if a > th:
        cnt += 1

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

Submission status: Wrong Answer

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

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

Alist = sorted(Alist,reverse=True)
#print (sum(Alist))
Ans = "No"
for i in range(M):
  #print (Alist[i])
  #print((sum(Alist)/4*M))
  if Alist[i]>(sum(Alist)/(4*M)):
    Ans ="Yes"
  else:
    Ans = "No"
    
print (Ans)

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())
c=list(map(int,input().split()))
d=sum(c)
e=d//(4*b)
f=0
for i in c:
    if(i>e):
        f+=1

if(f>=b):
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
mn = input().split()
ob = input().split()

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

votes = 0

for i in range(n):
    ob[i] = int(ob[i])
    votes += ob[i]

ob.sort(reverse = True)

line = votes/4/m

ans = 0

for i in range(m):
    if ob[i] <= line:
        ans += 1

if ans == 0:
    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
l.sort(reverse=True)
for i in l:
  count += i
if (l[m-1]) <= (count / (4*m)):
  print("No")
else:
  print("Yes")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n, m = map(int,input().split())
l = list(map(int,input().split()))
count = 0
l.sort(reverse=True)
for i in l:
  count += i

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

Submission status: Wrong Answer

Solution code:
mn = input().split()
ob = input().split()

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

votes = 0

for i in range(len(ob)):
    ob[i] = int(ob[i])
    votes += ob[i]

ob.sort()

line = votes//(4*m)

ans = 0

for i in range(m):
    if ob[-1*(i+1)] <= line:
        ans += 1

if ans == 0:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
mn = input().split()
ob = input().split()

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

votes = 0

for i in range(len(ob)):
    ob[i] = int(ob[i])
    votes += ob[i]

ob.sort()

line = votes//(4*m)

ans = 0

for i in range(m):
    if ob[-1*(i+1)] < line:
        ans += 1

if ans == 0:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
mn = input().split()
ob = input().split()

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

votes = 0

for i in range(len(ob)):
    ob[i] = int(ob[i])
    votes += ob[i]

ob.sort()

line = votes//(4*m)

ans = 0

for i in range(m):
    if ob[-1*(i+1)] <= line:
        ans += 1

if ans == 0:
    print("Yes")
else:
    print("NO")

Submission status: Wrong Answer

Solution code:
mn = input().split()
ob = input().split()

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

votes = 0

for i in range(len(ob)):
    ob[i] = int(ob[i])
    votes += ob[i]

ob.sort()

line = votes//(4*m)

ans = 0

for i in range(m):
    if ob[-1*(i+1)] < line:
        ans += 1

if ans == 0:
    print("Yes")
else:
    print("NO")

Submission status: Wrong Answer

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

    for i in A:
        if i/sum(A) > 1/(4*M):
            cnt += 1
    if cnt >= M:
        print('Yes')
    else:
        print('No')


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

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()))
rank = sum(A) / (4*m)
cnt =0

for a in A:
    cnt += rank <= a

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()))
rank = sum(A) / (4*m)
cnt =0

for a in A:
    cnt += rank < a

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()))
if A[M-1] < sum(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()))
border = sum(a) / (4 * m)
a.sort(reverse=True)

for i in range(m):
    if border >= a[i]:
        pass
    else:
        print('No')
        exit(0)

print('Yes')

Submission status: Wrong Answer

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

A.sort(reverse=True)

all_ =sum(A)
th = all_//(4*M)

ans='Yes'
if A[M-1] <= th:
    ans='No'
    
print(ans)

Submission status: Wrong Answer

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

A.sort(reverse=True)

all_ =sum(A)
th = all_//(4*M)

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

Submission status: Wrong Answer

Solution code:
N, M = map(int, input().split())
A = list(map(int, input().split()))
 
s = sum(A)
A = sorted(A, reverse=True)
print(A)
ans = 'Yes'
for i in range(M):
  if A[i] < s/(4*M): 
    ans = 'No'
    break

print(ans)

Submission status: Wrong Answer

Solution code:
n = input()
n = n.split()
m = int(n[1])
n = int(n[0])
a = input()
a = a.split()
c = int(a[0])
for b in range(n-1):
    c = c + int(a[b+1])
c = c / (4 * m)
e = 0
for d in range(n):
    if int(a[d]) > c :
        e = e + 1
if e >= m:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
# coding: utf-8

kind, choose = map(int, input().split())
count = 0
total = 0

num = input().split(" ")
for i in num:
    total += int(i)

ok = total / (4 * kind)
for i in num:
    if int(i) >= ok:
        count += 1

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

Submission status: Wrong Answer

Solution code:
# coding: utf-8

kind, choose = map(int, input().split())
count = 0
total = 0

num = input().split(" ")
for i in num:
    total += int(i)

ok = total / (4 * kind)
for i in num:
    if int(i) >= ok:
        count += 1

if count > choose:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
# coding: utf-8

kind, choose = map(int, input().split())
count = 0
total = 0

num = input().split(" ")
for i in num:
    total += int(i)

ok = total / (4 * kind)
for i in num:
    if int(i) >= total / ok:
        count += 1

if count > choose:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
# coding: utf-8

kind, choose = map(int, input().split())
count = 0
total = 0

num = input().split(" ")
for i in num:
    total += int(i)

ok = total / kind
for i in num:
    if int(i) >= total / ok:
        count += 1

if count > choose:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
n, m = (int(x) for x in input().split())
list_a = sorted([int(x) for x in input().split()], reverse=True)

for i in range(0, m):
    if list_a[i] < sum(list_a) // (4 * m):
        print('No')
        exit()
print('Yes')

Submission status: Wrong Answer

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

cnt = M
summ = sum(numss)
for num in numss:
  if num >= summ//(M*4):
    cnt -= 1
if cnt <= 0:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

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

add = sum(ar)
big = [0]*m

for num in ar:
    for i, number in enumerate(big):
        if num > number:
            big[i] = num
            break

check = add / (4 * m)
yes = True

for val in big:
    if val < check:
        print("No")
        yes = False

if yes:
    print("Yes")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

    if cnt >= 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()))

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

ans = True
for i in range(M):
    if A[i] < limit:
        ans = False
        break
if ans:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

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

ans = True
for i in range(M):
    if A[i] <= limit:
        ans = False
        break
if ans:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

cnt = N
A_sum = sum(A_list)

for i in range(N):
    if A_list[i] <= int(A_sum/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 = list(map(int, input().split()))

cnt = N
A_sum = sum(A_list)

for i in range(N):
    if A_list[i] <= int(A_sum/4/M):
        cnt -= 1
if cnt >= M:
    print("yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
import math

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

cnt = M
A_sum = sum(A_list)

for i in range(N):
    if A_list[i] <= int(A_sum/4/M):
        cnt -= 1
if cnt >= M:
    print("yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
import math

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

cnt = 0
A_sum = sum(A_list)

for i in range(N):
    if A_list[i] >= math.ceil(A_sum/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 = list(map(int, input().split()))

cnt = 0
A_sum = sum(A_list)

for i in range(N):
    if A_list[i] >= A_sum/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(x) for x in input().split()]

ans=0
for a in A:
  ans = ans + 1 if a*(4*M)>sum(A) else ans
print('Yes' if ans>=M else '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 sum(a) < a[i]*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()))
count = 0
for i in range(n):
    if sum(a)/(4*m) <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()))
count = 0
for i in range(n):
    if sum(a)//(4*m) <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()))
count=0
for i in range(n):
    if sum(a)/4 <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
a.sort(reverse=True)
ALL=0
print(a)

for i in a:
    ALL+=i

print(ALL)


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

Submission status: Wrong Answer

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

for i in range(m):
    ALL+=a[i]


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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N,M=map(int,input().split(" "))
l=list(map(int,input().split(" ")))
sum_list=sum(l)
border=sum_list/(4*M)
c=0
for i in range(N):
  if l[i]>border:
    c+=1
if 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()))
a.sort(reverse=True)
total = sum(a) // (4 * m)

for i in range(m):
    if a[i] < total:
        print("No")
        break
else:
    print("Yes")

Submission status: Wrong Answer

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

for s in a:
    if total // (4 * m) > s:
        n -= 1
    if n < m:
        print("No")
        break
else:
    print("Yes")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math

n,m = map(int, input().split())
A = list(map(int, input().split()))
line = math.floor(sum(A) / (4 * m))
cnt = 0
for a in A:
    if a >= line:
        cnt += 1
    if cnt >= m:
        print('Yes')
        break
else:
    print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x,y = map(int,input().split())
A=list(map(int,input().split()))
T=sum(A)
a=0
for i in range(x):
  if A[i]<1/(4*T):
    a+=1
if a>=y:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
from decimal import Decimal
n,m = map(int,input().split())
A = list(map(int,input().split()))
border = float(sum(A)/(4*m))
border2 = str(border)
border3 = Decimal(border2)
ans = 0
judge = 0
for i in range(n):
  if A[i] >= border3:
    ans+=1
if ans > m:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
from decimal import Decimal
n,m = map(int,input().split())
A = list(map(int,input().split()))
border = float(sum(A)/(4*m))
border2 = str(border)
border3 = Decimal(border2)
ans = 0
judge = 0
for i in range(n):
  if A[i] > border3:
    ans+=1
if ans > m:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
def main():
    n,m = map(int, input().split())
    a = list(map(int,input().strip().split()))
    t = sum(a)
    c = 0
    for aa in a:
        if aa >= int(t / (4*m)):
            c += 1
    if c >= m:
        print("Yes")
        return 
    else:
        print("No")
        return
main()

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

Solution code:
import numpy as np
p,q= input().split()
a,b =(int(p), int(q))
ans_list = input().split()
ans_list =np.array(ans_list).astype(float)
count = 0
for i in range(a):
    if ans_list[i] > sum(ans_list)/4/b:
        count += 1

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

Submission status: Wrong Answer

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

print([i for i in a if i >= sum(a)/(4*m)],sum(a)/(4*m))

if len([i for i in a if i >= sum(a)/(4*m)]) >= m:
    print("Yes")
else:
    print("No")