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:
def main():
    N, M = map(int, input().split())
    A = list(map(int, input().split(' ')))
    A.sort()
    A.reverse()
    total = sum(A)
    for i in range(M):
        if (total // (4 * M)) + (total % (4 * M)) <= A[i]:
            continue
        print('No')
        return
    print('Yes')
main()

Submission status: Wrong Answer

Solution code:
def main():
    N, M = map(int, input().split())
    A = list(map(int, input().split(' ')))
    A.sort()
    A.reverse()
    total = sum(A)
    for i in range(M):
        if total // (4 * M) <= A[i]:
            continue
        print('No')
        return
    print('Yes')
main()

Submission status: Wrong Answer

Solution code:
def main():
    N, M = map(int, input().split())
    A = list(map(int, input().split(' ')))
    A.sort()
    A.reverse()
    total = sum(A)
    for i in range(M):
        if total // (4 * M) < A[i]:
            continue
        print('No')
        return
    print('Yes')
main()

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)
if A[M-1] > total / (4 * M):
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
import math
N, M = map(int, input().split())
ans = 0
Nlist = list(map(int, input().split()))
total = sum(Nlist)
Mmin = math.floor(total*1/(4*M))
ans = len([1 for x in Nlist if x >= Mmin])
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()))
print('NYoe s'[len([i for i in a if i>sum(a)/4/m])>=m::2])

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/(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)

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 = input().split()
s = 0
for i in a:
  s += int(i)
c = 0
for i in a:
  c = a.count(int(i) >= s/(4*m))
if c >= m:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
import numpy as np
import math
 
n, m = map(int, input().split())
vote_lists = list(map(int, input().split()))
 
vote_arr = np.array(vote_lists)
total_vote = vote_arr.sum()
popular = math.ceil(total_vote / (4 * m))
 
if len(vote_arr[vote_arr > popular]) >= m:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
import numpy as np
 
n, m = map(int, input().split())
vote_lists = list(map(int, input().split()))
 
vote_arr = np.array(vote_lists)
total_vote = vote_arr.sum()
popular = int(total_vote / (4 * m))
 
if len(vote_arr[vote_arr > popular]) >= m:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
import numpy as np

n, m = map(int, input().split())
vote_lists = list(map(int, input().split()))

vote_arr = np.array(vote_lists)
total_vote = vote_arr.sum()
popular = total_vote / (4 * m)

if len(vote_arr[vote_arr > popular]) >= m:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

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

for i in range(N):
    if i == M - 1:
        if (s / (4 * M)) > A[i]:
            print(A[i])
            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)
A=sorted(A)
for i in range(N):
    if i == M-1:
        if (s/(4*M))>A[i]:
            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)
A.sort()
for i in range(N):
    if i == M:
        if (s/(4*M))>A[i]:
            print('Yes')
        else:
            print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = [int(i) for i in input().split()]
a = [int(i) for i in input().split()]
count = 0
for i in a:
	if(i * 4 * n[1] >= n[0]):
		count += 1
if(count >= n[1]):
	print('Yes')
else:
	print('No')

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

def vote(a,m):
  a.sort(reverse=True)
  for i in range(m):
    if a[i] >= sum(a)/(4*m):
      return True
    else:
      return False
    
ans = "Yes" if vote(A,M) else "No"
print(ans)

Submission status: Wrong Answer

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

def vote(a,m):
  a.sort(reverse=True)
  for i in range(m):
    if a[i-1] >= sum(a)/(4*m):
      return True
    else:
      return False
    
ans = "Yes" if vote(A,M) else "No"
print(ans)

Submission status: Wrong Answer

Solution code:
N, M = map(int, input().split())
A_s = list(map(int, input().split()))
cnt = 0
for A in A_s:
    if A > sum(A_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())
li=list(map(int,input().split()))
count=0

for i in li:
  if i >= sum(li)*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())
li=list(map(int,input().split()))
count=0

for i in li:
  if i >= sum(li)*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())
hyou= list(map(int,input().split()))
all = sum(hyou)
min = all / 4 / m
erabu = 0
for i in range(n):
    if hyou[i]>min:
        erabu += 1
print("Yes" if erabu >= m else "No")

Submission status: Wrong Answer

Solution code:

import sys
input = sys.stdin.readline
# sys.setrecursionlimit(100000)


def main():
    N, M = [int(i) for i in input().strip().split()]
    A_list = [int(i) for i in input().strip().split()]
    table = [0] * N

    _sum = sum(A_list)

    for i in range(N):
        if A_list[i] > _sum / (4 * M):
            table[i] = 1

    if sum(table) >= M:
        return "Yes"
    else:
        return "No"


if __name__ == "__main__":
    print(main())

Submission status: Wrong Answer

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

for val in a:
  if val > sum(a) / (4 * m):
  	cnt += 1

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

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline
n,m = map(int,input().split())
L=list(map(int,input().split()))
mx = sum(L)
mn = mx/(4*m)
L.sort(reverse = True)
count = 0
for i in range(n):
    if L[i]>mn:
        count+=1
    if count ==m:
        print('Yes')
        sys.exit()
print('No')
sys.exit()

Submission status: Wrong Answer

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

for i in range(n):
    if a[i]>=x:
        c+=1
if c<m:
    print('No')
else:
    print('Yes')

Submission status: Wrong Answer

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

for i in range(n):
    if a[i]>=x:
        c+=1
if c<m:
    print('No')
else:
    print('Yes')

Submission status: Wrong Answer

Solution code:
N,M = map(int,input().split())
votes = list(map(int,input().split()))
votes.sort(reverse=True) #降順
for i in range(M):
  if(votes[i]/sum(votes) < 1/(4*M)):
    print("No")

Submission status: Wrong Answer

Solution code:
n , m = map(int,input().split())
a = list(map(int,input().split()))
can_choice_item_list =[]
for item in a:
  if item < 1 / (4 * m):
    pass
  else:
    can_choice_item_list.append(item)
if m <= len(can_choice_item_list):
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
n , m = map(int,input().split())
a = list(map(int,input().split()))
can_choice_item_list =[]
for item in a:
  if item < 1 / (4 * m):
    pass
  else:
    can_choice_item_list.append(item)
if m < len(can_choice_item_list):
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
n , m = map(int,input().split())
a = list(map(int,input().split()))
can_choice_item_list =[]
for item in a:
  if item < 1 / (4 * m):
    pass
  else:
    can_choice_item_list.append(item)
if m < len(can_choice_item_list):
  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)
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 = sorted(list(map(int,input().split())), reverse=True)
#print(a)
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()))

num = 0

for i in A:
  if i < sum(A) // 4*M:
    pass
  else:
    num += 1

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

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:
    pass
  else:
    num += 1

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

Submission status: Wrong Answer

Solution code:
#inport
import sys
import numpy as np
from collections import deque


#input
N,M = [int(x) for x in sys.stdin.readline().split()]
g = [int(x) for x in sys.stdin.readline().split()]

g = np.array(g)
#print(g)
#print(1/4/M*np.sum(g))
#print(g >= 1/4/M*np.sum(g))

if np.count_nonzero(g >= 1/4/M*np.sum(g)) > M:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
n, m = map(int, input().split())
a = list(map(int, input().split()))
select = 0
a.sort(reverse=True)
for i in range(m):
    if a[i]/sum(a) > 1/(4*m):
        select = 1
    else:
        select = 0

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

Submission status: Wrong Answer

Solution code:
n,m = map(int,input().split())
a=list(map(int,input().split()))
a_sum=sum(a)
a_sort=sorted(a)
for i in range(m):
  if a_sort[i]<(a_sum)/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()))
b = sum(A)/(4*m)
a = 0
print(b)
for i in range(n):
  if A[i] >= b:
    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()))
a.sort()
if a[n-1]>=sum(a)/(4*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().split()))
    s = sum(a)
    x = [i for i in a if i < int(s / (4*m))]
    if len(x) <= m:
        print('No')
    else:
        print('Yes')


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
n, m = map(int, input().split())
a = list(map(int, input().split()))
a = sorted(a, reverse=True)
a_sum = sum(a)
ans = 'Yes'
for i, c in enumerate(a[:m]):
    if c < a_sum / (4 * (i + 1)):
        ans = 'No'
        
if m == 0:
    ans = 'No'
print(ans)

Submission status: Wrong Answer

Solution code:
n, m = map(int, input().split())
a = list(map(int, input().split()))
a = sorted(a, reverse=True)
a_sum = sum(a)
ans = 'Yes'
for i, c in enumerate(a[:m]):
    if c < a_sum / (4 * (i + 1)):
        ans = 'No'
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

l = list(map(int,input().split()))
s = sum(l)
ans = 0
t = s/(4*m)

for i in l:
  if i>=math.ceil(t):
    ans+=1
  if ans>=m:
    print("Yes")
  else:
    print("No")

Submission status: Wrong Answer

Solution code:
N,M = (int(X) for X in input().split())
A   = sorted([int(X) for X in input().split()],reverse=True)
if A[M-1]/sum(A) > 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()))

A.sort()
all_A = sum(A)
border = all_A * (1 / (M*4))

select = 0

for a in A:
    if a > border:
        select += 1

if select >= 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()
all_A = sum(A)
border = all_A / (M*4)

select = 0

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

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

Submission status: Wrong Answer

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

all_A = sum(A)
border = all_A // (4*M)

select = 0

for a in A:
    if a > border:
        select += 1

if select >= 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()
all_A = sum(A)
border = all_A // (4*M)

select = 0

for a in A:
    if a > border:
        select += 1

if select >= 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()
all_A = sum(A)
border = all_A // (4*M)

select = 0

for a in A:
    if a > border:
        select += 1
    if select == M:
        break

if select == 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()
all_A = sum(A)
border = all_A // (4*M)

select = 0

for a in A:
    if a >= border:
        select += 1
    if select == M:
        break

if select == 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("No")

else:
    print("Yes")

Submission status: Wrong Answer

Solution code:
#

import sys
input=sys.stdin.readline

def main():
    n,m=map(int,input().split())
    A=list(map(int,input().split()))
    cnt=0
    for i in range(n):
        if A[i]>=1/(4*m):
            cnt+=1
    if cnt>=m:
        print("Yes")
    else:
        print("No")
    
    
    
if __name__=="__main__":
    main()

Submission status: Wrong Answer

Solution code:
import sys

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

p = sum(A) // ( 4 * M )
A = sorted(A, reverse=True)

for i in range(M):
    if p > A[i]:
        print("No")
        sys.exit()
    
print("Yes")

Submission status: Wrong Answer

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


if len(list(filter(lambda x: x >eligible, 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()))
sum, c = 0, 0
for i in a:
	sum += i
for i in a:
	if sum / (m * 4) <= i:
		c += 1
if c > m:
	print("Yes")
else:
	print("No")

Submission status: Wrong Answer

Solution code:
def actual(n, m, a_list):
    threshold = sum(a_list) / (4 * m)

    count_can_be_popular = 0

    for vote in a_list:
        if vote >= threshold:
            count_can_be_popular += 1

    if count_can_be_popular >= m:
        return 'Yes'

    return 'No'

n, m = map(int, input().split())
a_list = map(int, input().split())
  
print(actual(n, m, a_list))

Submission status: Wrong Answer

Solution code:
N,M=[int(i) for i in input().split(" ")]
A=[int(i) for i in input().split(" ")]
print( "Yes" if len([i for i in A if sum(A)*(1/(4*M)) < i]) >= M  else "No" )

Submission status: Wrong Answer

Solution code:
import itertools
from collections import deque,defaultdict,Counter
from itertools import accumulate
import bisect
from heapq import heappop,heappush,heapify
import math
from copy import deepcopy
import queue
import numpy as np
# sympy as syp(素因数分解とか)
Mod = 1000000007
def sieve_of_eratosthenes(n):
    if not isinstance(n,int):
        raise TypeError("n is not int")
    if n<2:
        raise ValueError("n is not effective")
    prime = [1]*(n+1)
    for i in range(2,int(math.sqrt(n))+1):
        if prime[i] == 1:
            for j in range(2*i,n+1):
                if j%i == 0:
                    prime[j] = 0
    res = []
    for i in range(2,n+1):
        if prime[i] == 1:
            res.append(i)
    return res

 
class UnionFind:
    def __init__(self,n):
        self.parent = [i for i in range(n+1)]
        self.rank = [0 for i in range(n+1)]
    
    def findroot(self,x):
        if x == self.parent[x]:
            return x
        else:
            y = self.parent[x]
            y = self.findroot(self.parent[x])
            return y
    
    def union(self,x,y):
        px = self.findroot(x)
        py = self.findroot(y)
        if px < py:
            self.parent[y] = px
        else:
            self.parent[px] = py
 
    def same_group_or_no(self,x,y):
        return self.findroot(x) == self.findroot(y)

def main():  #startline-------------------------------------------
    n, m = map(int, input().split())
    a = list(map(int, input().split()))
    a.sort(reverse = True)
    ans = 0
    for i in range(n):
        if a[i] >= sum(a) // (4 * m):
            ans += 1
    print("Yes" if ans >= m else "No")
if __name__ == "__main__":
    main() #endline===============================================

Submission status: Wrong Answer

Solution code:
n, m = map(int, input().split())
a = input().split()
a_int = list(map((lambda x: int(x)), a))
sum = 0

for i in range(n):
  if a_int[i] >= int(1 / 4 / m):
    sum += 1

if sum >= 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)
count=0

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

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

Submission status: Wrong Answer

Solution code:
import sys

input = lambda: sys.stdin.readline().rstrip()


def solve():
    N, M = map(int, input().split())
    A = list(map(int, input().split()))
    asum = sum(A)

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

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


if __name__ == '__main__':
    solve()

Submission status: Wrong Answer

Solution code:
n,m=map(int,input().split())
a=[2,1,3]
a=list(map(int,input().split()))

b=sorted(a,reverse=True)
if b[m-1]*4*m <= n:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
n,m=map(int,input().split())
a=list(map(int,input().split()))
sort=sorted(a,reverse=True)
b=sum(a)
count=0

for i in sort:
  if i<=b/(4*m):
    break
  else:
    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()))
MAX = sum(A)
A = sorted(A,reverse=True)
M_count = 0
for i in A:
  if i > MAX/(4*M):
    M_count += 1
  else:
    break
if M_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()))
sort=sorted(a,reverse=True)
b=sum(a)
count=0

for i in sort:
  count+=1
  if i<=b/(4*m):
    break

if count-1>=m:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
n,m=map(int,input().split())
a=list(map(int,input().split()))
sort=sorted(a,reverse=True)
b=sum(a)
count=0

for i in sort:
  count+=1
  if i<b/(4*m):
    break

if count-1>=m:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
n,m=map(int,input().split())
a=list(map(int,input().split()))
sort=sorted(a,reverse=True)
b=sum(a)
count=0

for i in sort:
  count+=1
  if i>=b/(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()))
sort=sorted(a,reverse=True)
b=sum(a)
count=0

for i in sort:
  count+=1
  if i < b/(4*m):
    break

if count-1>=m:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
n,m=map(int,input().split())
a=list(map(int,input().split()))
sort=sorted(a,reverse=True)
b=sum(a)
count=0
for i in sort:
  count+=1
  if i<b/4*m:
    break
if count-1<=m:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
n,m=map(int,input().split())
a=list(map(int,input().split()))
sort=sorted(a,reverse=True)
print(sort)
b=sum(a)
print(b)
count=0
for i in sort:
  count+=1
  if i<b/4*m:
    break
print(count-1)
 
if count-1<=m:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
n,m=map(int,input().split())
a=list(map(int,input().split()))
sort=sorted(a,reverse=True)
b=sum(a)
count=0
for i in sort:
  count+=1
  if i<b/4:
    break
    
if count-1<=m:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
n,m=map(int,input().split())
a=list(map(int,input().split()))
sort=sorted(a,reverse=True)
b=sum(a)
count=0
for i in a:
  count+=1
  if i<b/4:
    break
if count-1>=m:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

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

for i in A:
    if i >= sum(A)/4*M:
        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()))
c = 0
t = sum(A)/(4*M)

for i in A:
    if i >= t:
        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()))

t = sum(a) // (4*m)
cnt = 0

for i in a:
    if i >= t:
        cnt += 1

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

Submission status: Wrong Answer

Solution code:
def mput(): return map(int, input().split())
def lput(): return list(map(int, input().split()))
def iput(): return int(input())

def solve():
    n, m = mput()
    a = lput()
    line = n / (4 * m)
    bit = 0
    for i in a:
        if i >= line:
            bit += 1
    if bit >= m:
        print("Yes")
    else:
        print("No")
    return 0

if __name__ == "__main__":
    solve()

Submission status: Wrong Answer

Solution code:
try:
    N_s,M_s=input().split(' ')
    N=int(N_s)
    M=int(M_s)
    
    if N>=1 and N<=100 and M>=1 and M<=100:
        votes=input().split(' ')
        counter=0
        vote= list(map(int, votes))
        summer=sum(vote)
        percent=summer/(4*M)
        print(percent)
        for i in vote:
            if i>percent:
                counter+=1
        if counter>=M:
            print('Yes')
        else :
            print('No')
        
except Exception as e:
    print(e)

Submission status: Wrong Answer

Solution code:
try:
    N_s,M_s=input().split(' ')
    N=int(N_s)
    M=int(M_s)
    
    if N>=1 and N<=100 and M>=1 and M<=100:
        votes=input().split(' ')
        counter=0
        vote= list(map(int, votes))
        summer=sum(vote)
        for i in votes:
            if int(i)>summer*(1/(4*M)):
                counter+=1
        if counter>=M:
            print('Yes')
        else :
            print('No')
        
except Exception as e:
    print(e)

Submission status: Wrong Answer

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

s = sum(a)
t = s // 4*m
cnt = 0

for i in a:
    if i >= t:
        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()))
tot_sum = sum(A)
ans = "No"
cnt = 0
for val in A:
    if (val / tot_sum) > (1 / (4 * M)):
        cnt += 1
    if cnt == M:
        ans = "Yes"
        break

print(ans)

Submission status: Wrong Answer

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

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

select = 0
all = sum(a)

for i in a:
    if i >= (all/4*m):
        select += 1


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

Submission status: Wrong Answer

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

s = sum(A)

selected = []
for a in A:
    if a/s > 1/(4*m):
        selected.append(a)

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import os
import heapq
import sys
import math
from collections import defaultdict
from io import BytesIO, IOBase
def check_kth_power(n, k):
        while n%k == 0:
            n = n/k

        if n != 1:
            return False
        return True
def main():
    #for _ in range(int(input())):
    n,m=map(int,input().split())
    arr=[int(k) for k in input().split()]
    
    total=0
    for i in range(n):
        total+=arr[i]
    val=(total//(4*m))
    counter=0
    #print(val)
    ans="No"
    for i in range(n):
        if arr[i]>=val:
            counter+=1
        if counter==m:
            ans="Yes"
    print(ans)
        
BUFSIZE = 8192

class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)


class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")


sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")

if __name__ == "__main__":
    main()