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 = [int(i) for i in input().split()]

vote = sum(A)
num = 0
for a in A:
    if a >= vote // (4 * M):
        num += 1

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

Submission status: Wrong Answer

Solution code:
n, m = map(int, input().split())
l = sorted(map(int, input().split()), reverse=True)
c = sum(l)

if l[m-1] >= c//(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()))
count = 0
for i in range(n):
    if A[i] >= (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())
a=list(map(int,input().split()))
a.sort()
a.reverse()
if a[m-1]>sum(a)/4/m:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
def main():
    #from sys import stdin, setrecursionlimit
    #setrecursionlimit(10**9)
    #r = input()
    #n = int(input())
    #a, b = map(int, input().split())
    #s, y = input().split()
    #a = input().split()
    #a = list(map(int, input().split()))
    #a = [list(input().split()) for i in range(n)]
    #a = [int(input()) for i in range(n)]
    #a = [list(map(int, input().split())) for i in range(n)]
    #a = [int(s) - 1 for s in input().split()]
    #l=[int(input()) for _ in range(int(input()))]
    #res = 0
    x,m=map(int,input().split())
    a=sorted(list(map(int,input().split())),reverse=True)
    if a[m-1] > sum(a)/(m*4):
        print('Yes')
    else:
        print('No')


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
n, m = map(int, input().split())
a_list = [int(i) for i in input().split()]

a_sum = sum(a_list)
a_sorted = sorted(a_list)[::-1]

if a_sorted[m-1] > a_sum/m/4:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
n, m = map(int, input().split())
a = sorted(list(map(int, input().split())))
sum_a = sum(a)
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())
arr = list(map(int, input().split()))

total = sum(arr)

temp = total/(4*m)

ans =0
for i in arr:
    if i>=temp:
        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()))
a.sort()
sum_vote=sum(a)
least_vote=int((sum_vote/(4*m)))
if(a[-1*m]<least_vote):
    print("No")
else:
    print("Yes")

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 4*m*a[i] >= n:
		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()))
vote = sum(A) // (4 * M)
ans = 0
for a in A:
    if a > vote:
        ans += 1
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()))
A.sort()
if A[N - M] < 1/(4 * M):
    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)
if A[M-1]>=1/M:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

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

for i in range(M):
    if not(A[i] > miman):
        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()))
b = 0
s = sum(a)
d = s*(1/(4*m))
for i in a:
    if i>d:
        b += 1

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

Submission status: Wrong Answer

Solution code:
def solve():
    N, M = map(int, input().split())
    A = list(map(int, input().split()))
    s = sum(A)
    b = s // (4 * M)
    
    c = 0
    for a in A:
        if a >= b:
            c+=1

    return 'Yes' if c >= M else 'No'

print(solve())

Submission status: Wrong Answer

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

S = sum(A)
t = 0
for i in A:
    if i >= S/(4*M):
        t += 1
        
if t > 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 * 4 * m) > s:
        cnt += 1
if cnt >= m:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
#!usr/bin/env python3
import sys
import math
import string
import collections
import fractions
import random
from operator import itemgetter
import itertools
from collections import deque
import copy
import heapq
import bisect

MOD = 10 ** 9 + 7
INF = float('inf')
input = lambda: sys.stdin.readline().strip()

sys.setrecursionlimit(10 ** 8)

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

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

A.sort(reverse=True)
S = sum(A[0:M])
if S <= A[M - 1] * 4 * M:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline

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

s = sum(A) // (4 * M)
c = sum([1 for a in A if a >= s])
print("Yes") if c >= M else print("No")

Submission status: Wrong Answer

Solution code:
# import sys
# import math #sqrt
# import decimal
# import queue # queue
# import bisect
# import heapq # priolity-queue
# import time
# import itertools
# import collections # deque
# from operator import itemgetter
# from fractions import Fraction

mod = int(1e9+7)
INF = 1<<29
lINF = 1<<35

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

if __name__=='__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math
N,M = map(int,input().split())
A = list(map(int,input().split()))
kizyun = math.floor(sum(A)*(1/(4*M)))
ans = 0
for i in range(N):
    if A[i]>kizyun:
        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()))
cnt = 0
a.sort()
a.reverse()
for i in a:
    if i >= sum(a) / (4 * m):
        cnt += 1
    else:
        if cnt >= m:
            print("Yes")
        else:
            print("No")
        exit()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
n,m = [int(j) for j in sys.stdin.readline().split()]
l = [int(j) for j in sys.stdin.readline().split()]
l.sort(reverse=True)
for i in range(m):
    if l[i]<sum(l)/(4*m):
        print(l[i])
        print("No")
        break
else:
    print("Yes")
    # else:

Submission status: Wrong Answer

Solution code:
N, M = map(int, input().split())
A = list(map(int, input().split()))
A.sort()
A.reverse()
A_sum = sum(A)
bound = 0
if A_sum % (4 * M) == 0:
    bound = A_sum // (4 * M) - 1
else:
    bound = A_sum // (4 * M)

if A[M - 1] >= bound:
    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)
vor = s//(4*M)
if a[M-1] >= vor:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
n , m = map(int, input().split())
arr = list(map(int, input().split()))
check = 1/(4*m)
count = 0
for i in arr:
	if i < check:
		continue
	else:
		count+=1
if count >= m:
	print("Yes")
else:
	print("No")

Submission status: Wrong Answer

Solution code:
import sys
import heapq, math
from itertools import zip_longest, permutations, combinations, combinations_with_replacement
from itertools import accumulate, dropwhile, takewhile, groupby
from functools import lru_cache
from copy import deepcopy

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

S = sum(A)
l = len(list(filter(lambda x: x >= S // (4 * M), A)))
print("Yes" if l >= M else "No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n,m=map(int,input().split())
a=list(map(int,input().split()))
ans=0
for i in range(n):
    if a[i]>=sum(a)//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()))

SUM = sum(A)
count = 0
for a in A:
    if a >= SUM // (4*M):
        count += 1
    
    if M == count:
        print("Yes")
        exit()

print("No")

Submission status: Wrong Answer

Solution code:


############ ---- USER DEFINED INPUT FUNCTIONS ---- ############
def inp():
    return(int(input().rstrip()))
def inlt():
    return(list(map(int,input().rstrip().split())))
def insr():
    s = input().rstrip()
    return(s[:len(s) - 1])
def invr():
    return(map(int,input().rstrip().split()))
################################################################
n,m = invr()
nums = inlt()
standard = (sum(nums))//(4*m)
nums.sort(reverse = True)
has = True
index = 0
while index < m:
    if nums[index] < standard:
        has = False
        break
    index += 1
if has:
    print('Yes')
else:
    print('No')
#print()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

cnt = 0

for _a in a:
    if _a >= border:
        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()))
b = sum(a) / (4 * m)
c = 0
for i in a:
    if i > b:
        c += 1
if c >= m:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

lim = sum(a) / (4*m)
ans = 0
for i in range(n):
    if a[i] > lim:
        ans += 1
    else:
        pass
if m <= ans:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
n,m = map(int,input().strip().split())
ls = list(map(int,input().strip().split()))
mini = sum(ls)//(4*m)
i = 0
while i<n and m>0:
    if ls[i]>=mini:
        m -= 1
    i += 1
if m<=0:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
N, M = map(int, input().split())
cnt = 0
A = list(map(int, input().split()))
s = sum(A)
for i in range(N):
  if(A[i] < (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 = list(map(int, input().split()))
sum_A, ans = sum(A), 0

for a in A:
    if a > sum_A / (4*M):
        ans += 1

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

Submission status: Wrong Answer

Solution code:
import sys
 
RI = lambda : [int(x) for x in sys.stdin.readline().split()]
ri = lambda : sys.stdin.readline().strip()

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e): return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(N=None): return list(MAP()) if N is None else [INT() for i in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
INF = 10 ** 18
MOD = 10 ** 9 + 7
 
# for i in range(int(ri())):
n,m = RI()
a = RI()
summ = sum(a)
cnt = summ//(4*m)
tot = 0
for i in range(len(a)):
    if a[i] >= cnt:
        tot+=1
if tot >= m:
    Yes()
else:
    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)
cnt = 0
for a in A:
    if a * 4 * M > total:
        cnt += 1

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

Submission status: Wrong Answer

Solution code:
N,M=map(int,input().split())
A=list(map(int,input().split()))
su=sum(A)
th=su//(4*M)
ans=0
for i in A:
    if not(i <th):
        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()))
line = sum(A)/(4*m)
ans = 0
for a in A:
  if a > line:
    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()))

s = sum(a) // (4 * m) 
cnt = 0
for ai in a:
    if ai >= s:
        cnt += 1
if cnt >= 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(a)
total=sum(a)
import math
border=math.ceil(total/(4*m))
cnt=0
for i in a:
    if i>=border:
        cnt+=1
print('Yes' if cnt>=m else 'No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n, m = map(int, input().split())
As = list(map(int, input().split()))
As = sorted(As, reverse=True)
num = sum(As)
ans = 0
for a in As:
  if num / (4*m) <= a:
    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()))
cnt = 0
for i in range(N):
  if 1/4/M*sum(A)<A[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()))

S = sum(A)
l  = S / (4 * M)

a = len(list( i for i in A if i > l ))
if a >= M:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

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

ls = list(map(int, input().split()))
ls = sorted(ls,reverse=True)

print("Yes" if ls[m-1]*4*m >sum(ls) else "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] >= int(sum_a/(n*m)):
        continue
    else:
        print('No')
        exit()

print('Yes')

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>sum(A)/(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()))
A = list(map(int,input().split()))
total = sum(A)
maxi = total / (4*M)
item = 0
for a in A:
    if a > maxi:
        item+=1
print('Yes' if item >= M else 'No')

Submission status: Wrong Answer

Solution code:
M,N = map(int,input().split())
A = list(map(int,input().split()))
A.sort()
if A[N - M] < 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()))
soutokuhyou = sum(A)
A.sort(reverse=True)
if A[M-1] > soutokuhyou * (1/(4*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())))[::-1]
s = sum(A)
print('Yes' if A[m-1]>=s//(4*m) else 'No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def main():
    n, m, *a = map(int, open(0).read().split())
    k = sum(a)//(4*m)
    l = sum([i>=k for i in a])
    print('Yes' if l>=m else 'No')

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
n,m=map(int,input().split())
arr=list(map(int,input().split()))
arr=sorted(arr,reverse=True)
cnt=0
for val in arr:
  if val*4*m>sum(arr):
    cnt+=1
if cnt>=m:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
#!usr/bin/env python3
import sys
import math
import string
import collections
import fractions
import random
from operator import itemgetter
import itertools
from collections import deque
import copy
import heapq
import bisect

MOD = 10 ** 9 + 7
INF = float('inf')
input = lambda: sys.stdin.readline().strip()

sys.setrecursionlimit(10 ** 8)

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

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

A.sort(reverse=True)
S = sum(A[0:M])
if S < A[M - 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()))

get = sum(a)

num = 0

for i in range(n):
	if 4 * m * a[i] > get:
		num += 1

print('Yes') if num >= m else print('No')

Submission status: Wrong Answer

Solution code:
from sys import stdin
from sys import setrecursionlimit
from math import ceil
from collections import Counter, deque, defaultdict
setrecursionlimit(1000000)

# INF = float('inf')
INF = int(1e10)

def input():
    return stdin.readline()[:-1]

def main():
    from builtins import int, map
    N, M = map(int, input().split())
    A = list(map(int, input().split()))
    Asum = sum(A)
    th = ceil(Asum / (4 * M))
    count = 0
    A.sort()
    A.reverse()
    for a in A:
        if a > th:
            count += 1
    # print(A)
    # print(th)
    # print(count)
    if count >= M:
        print("Yes")
    else:
        print("No")

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
N,M=[int(x) for x in input().split()]
A=[int(x) for x in input().split()]
sum=0
for i in A:
    sum+=i
count=0
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 = list(map(int, input().split()))

sum_a = 0
for a in a_list:
    sum_a += a
count_a = 0
for a in a_list:
    if a >= sum_a// 4 // m:
        count_a += 1
if count_a >= m:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
N, M = list(map(int, input().split()))
A = sorted(list(map(int, input().split())))[::-1]
th = sum(A)/4/M
if A[M-1]>th:
    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()
if a[-m]<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()))

mean = sum(a) / n / 4
cnt = 0
for i in range(n):
    if a[i] >= mean:
        cnt += 1

print("Yes" if cnt >= m else "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]>=1/(4*m):
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

for a in A:
    if a >= sum(A)/4*M:
        c+=1

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

Submission status: Wrong Answer

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

count = 0
for A in A_list:
  if A >= sum_A // (4 * M):
    count += 1

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

Submission status: Wrong Answer

Solution code:
n, m = map(int, input().split())
arr = list(map(int, input().split()))
temp = sum(arr)//(4 * m)
arr.sort()
arr = arr[::-1]
cnt = 0
for i in range(n):
    if arr[i] >= temp:
        cnt += 1
if cnt >= m:
    print("Yes")
    exit()
print("No")

Submission status: Wrong Answer

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

al = sum(a)
count = 0
for i in range(n):
	if a[i] <al/(4*m):
		count += 1

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

Submission status: Wrong Answer

Solution code:
I=lambda:list(map(int,input().split()))
n,m=I()
l=I()
te=1/(4*m)
c=0
for i in l:
    if i>=te:
        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()))
a = sum(l)
b = a/4/m
ans = 0
for i in l:
    if i > b:
        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()))

total = sum(a)

cnt = 0
for ai in a:
    if ai > (total/(4*m)):
        cnt += 1

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

Submission status: Wrong Answer

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

def main():
    n, m = map(int, input().split())
    a = list(map(int, input().split()))
    a = sorted(a)
    sa = sum(a)
    f = [x for x in a if x >= sa // (4 * m)]
    print("Yes" if len(f) >= m else "No")

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
N,M = map(int ,input().split())
A = [int(c) for c in input().split()]
A.sort()
s = sum(A)
ans = 0
for c in A:
  if c>=s//(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,=map(int, input().split())

A.sort(reverse=True)
print('Yes' if A[M-1] >= sum(A)//4//M else 'No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n , m = map(int, input().split())
arr = list(map(int, input().split()))
check = 1/(4*m)
count = 0
for i in arr:
	if i < check:
		continue
	else:
		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()]

threshold = N/M/4
count = 0
for elem in A:
    if elem >= threshold:
        count += 1
        
if count >= M:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
def main():
    import sys
    input = sys.stdin.readline

    N, M = map(int, input().split())
    A = list(map(int, input().split()))
    S = sum(A)
    X = S // (4*M)
    cnt = 0
    for a in A:
        if a >= X:
            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()))
B = [x for x in A if x >= sum(A)//(4*M)]
print("Yes" if len(B) >= M else "No")

Submission status: Wrong Answer

Solution code:
import sys
def ii(): return int(sys.stdin.readline())
def mi(): return map(int, sys.stdin.readline().split())
def li(): return list(map(int, sys.stdin.readline().split()))
def li2(N): return [list(map(int, sys.stdin.readline().split())) for i in range(N)]
def dp2(ini, i, j): return [[ini]*i for i2 in range(j)]
def dp3(ini, i, j, k): return [[[ini]*i for i2 in range(j)] for i3 in range(k)]
#import bisect #bisect.bisect_left(B, a)
#from collections import defaultdict #d = defaultdict(int) d[key] += value

N, M = mi()
A = sorted(li())[:M]

all = float(sum(A)) /4.0 /M

for a in A:
    if a < all:
        print('No')
        exit()
print('Yes')

Submission status: Wrong Answer

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

t = sum(aa) // (4 * m)
c = 0
for a in aa:
    if a >= t:
        c += 1
if c >= m:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
import math,itertools,fractions,heapq,collections,bisect,sys,queue,copy

sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7
dd=[(-1,0),(0,1),(1,0),(0,-1)]
ddn=[(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS(): return sys.stdin.readline().split()
def S(): return input()

def main():
  n,m=LI()
  l=LI()

  sm=sum(l)
  a=sm/(4*m)

  l.sort(reverse=True)
  for x in l:
    if m<=0:
      return 'Yes'
    m-=1
    if x<a:
      return 'No'

# main()
print(main())

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] < 1/4*m:
  print("No")
else:
  print("Yes")

Submission status: Wrong Answer

Solution code:
n,m=map(int,input().split())
ans=0
lis=list(map(int,input().split()))
for num in lis:
  if num*4*m>=n:
    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()))
a.sort(reverse=True)

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

sm=sum(a)

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

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(10 ** 7)

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

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

S = sum(A)
m = S // (4 * M)
cnt = 0
for a in A:
    if a < m:
        continue
    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()))
c = 0
s = sum(a)
for i in range(n):
    if a[i] >= s//(4*m):
        c += 1
if c >= m:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N,M=map(int,input().split())
A=sorted(map(int,input().split()))
print(['No','Yes'][A[-M]>=sum(A)//(4*M)])

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n,m=map(int,input().split())
arr=list(map(int,input().split()))
arr=sorted(arr,reverse=True)
cnt=0
for val in arr:
  if val>sum(arr)/(4*m):
    cnt+=1
if cnt>=m:
  print('Yes')
else:
  print('No')