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

Submission status: Wrong Answer

Solution code:
# https://atcoder.jp/contests/abc161/tasks/abc161_b
N, M = map(int, input().split())
A = list(map(int, input().split()))
total = sum(A)
limit = total / (4 * M)

count = 0
for a in A:
    count += (a > limit)

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

Submission status: Wrong Answer

Solution code:
#


def main():
    n, m = map(int, input().split(" "))
    a = [int(s) for s in input().split(" ")]
    total = sum(a)
    lim = total // (4 * m)
    a = sorted(a, reverse=True)
    count = 0
    for i in a:
        if i >= lim:
            count += 1
        else:
            break
    if count >= m:
        print("Yes")
    else:
        print("No")


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import numpy as np
S = input().split(" ")
N = int(S[0])
M = int(S[1])

ARR = np.array([int(s) for s in input().split(" ")])


criterion = np.sum(ARR) / (4 * M)

res = ARR > criterion

result = np.sum(res)

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

Submission status: Wrong Answer

Solution code:
#python3
from math import ceil
def main():
    n, m = map(int, input().split())
    a = [int(i) for i in input().split()]
    c = 0
    s = sum(a)
    x = (s+1)/(4*m)
    for i in range(n):
        if x <= a[i]:
            c += 1

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

vote = sum(A)
ans = sum(x > vote//(4*M) for x in A)

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

Submission status: Wrong Answer

Solution code:
NM=input().split()
M=int(NM[1])
a=input().split()
a_list=[]
for i in a :
  a_list.append(int(i))
a_list.sort(reverse=True)
sum1=sum(a_list)

flag=True
for i,youso in enumerate(a_list) :
  if(youso*4*M<sum1 and i+1<=M) :
    print(youso)
    flag=False
    break
    
if flag :
  print('Yes')
else :
  print('No')

Submission status: Wrong Answer

Solution code:
# coding: utf-8

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

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

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

a_choiced_list = [a for a in a_list if a > border]

if len(a_choiced_list) < m:
    print('NO')
else:
    print('Yes')

Submission status: Wrong Answer

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

total = sum(A)
ta = total * (1/(4*M))
even = [i for i in A if i >= ta]

if len(even) > M:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
import sys
#sys.setrecursionlimit(150000)

#def my_index_multi(l, x):
#    return [i for i, _x in enumerate(l) if _x == x]

YES = "Yes"  # type: str
NO = "No"  # type: str


def solve(N: int, M: int, A: "List[int]"):
    A=sorted(A,reverse=True)
    sa=sum(A)
    if N==1:
        print(YES)
    else:
        print(YES if sa//(4*M)<=A[M-1] else NO)

    return


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    M = int(next(tokens))  # type: int
    A = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    solve(N, M, A)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
# from fractions import gcd
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from functools import reduce
from bisect import bisect_left, insort_left
from heapq import heapify, heappush, heappop

INPUT = lambda: sys.stdin.readline().rstrip()
INT = lambda: int(INPUT())
MAP = lambda: map(int, INPUT().split())
S_MAP = lambda: map(str, INPUT().split())
LIST = lambda: list(map(int, INPUT().split()))
S_LIST = lambda: list(map(str, INPUT().split()))
ZIP = lambda: zip(*(MAP() for _ in range(n)))

sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7


def main():
    N, M = MAP()
    A = LIST()

    W = sum(A)
    A = sorted(A, reverse=True)

    for i, a in enumerate(A):
        if a < W / (4*M):
            print("No")
            sys.exit()
        if i == M:
            print("Yes")
            sys.exit()


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
line = input().rstrip().split(' ')
n = int(line[0])
m = int(line[1])

line = input().rstrip().split(' ')
a = [0] * n
total = 0
for i in range(n):
    a[i] = int(line[i])
    total += a[i]

list.sort(a, reverse=True)
b = total / (4 * m)

ans = 'Yes'
for i in range(m):
    if a[i] < int(b):
        ans = 'No'

print(ans)

Submission status: Wrong Answer

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

sum_a = sum(a)
jouken = sum_a / (m * 4)
#print(jouken)
c = 0
for i in range(n):
    if a[i] > jouken:
        c += 1
if c > m:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
import sys
import os

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    N, M = il()
    A = il()
    sm = sum(A)
    mi = sm * (1 / (4 * M))
    cnt = 0

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

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


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

count=0
sum=0

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

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

Submission status: Wrong Answer

Solution code:
n, m = map(int, input().split())
lst = list(map(int, input().split()))
lst.sort(reverse=True)
ans = 0
sm = sum(lst)

for i in range(n):
    a = lst[i]
    if a > sm * (1 / (4 * m)):
        ans += 1
    else:
        break

if ans > m:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:

import sys, io, os
input = sys.stdin.readline
inputt = lambda: range(int(input()))
inputn = lambda n = 1: range(n)
inputi = lambda: map(int, input().split())
inputl = lambda: list(inputi())
from math import *
from heapq import *
from bisect import *
from functools import reduce, lru_cache
from collections import Counter, defaultdict
from builtins import *

N, M = inputi()
A = inputl()
S = sum(A)
t = ceil(S // (4 * M))
b = (sum(a > t for a in A) >= M)
if b:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
n, m = map(int, input().split())
votes = list(map(int, input().split()))
vote_total = sum(votes)
base_4m = vote_total / (4 * m)
over4m_count = 0

for i in votes:
    if i > base_4m:
        over4m_count += 1

if over4m_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()))

ans = 'No'
cnt = 0
for i in range(n):
  if a[i] >= sum(a)//(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 = sorted([int(x) for x in input().split()], reverse=True)
Asum = sum(A)
lmt = (Asum/(m*4))

print(A[m-1] )
if A[m-1] >= lmt:
    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[n-2] >= sum_a/(4*m):
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

if l[M-1]<1/(4*M):
    print('No')
else:
    print('Yes')

Submission status: Wrong Answer

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


def main(n, m, a):
    # print(n,m,a)
    x = [new_a for new_a in a if new_a >= sum(a) // (4 * m)]

    # print(x)

    if len(x) >= m:
        res = 'Yes'
    else:
        res = 'No'

    print(res)


main(N, M, A)

Submission status: Wrong Answer

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

t = input().split()
n = int(t[0])
m = int(t[1])

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

s = sum(a)

if a[-m] < s//(4*m):
    print("No")
else:
    print("Yes")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

#print(s)
count = 0

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

hoge = 4*M
thr = sum(num_list) // hoge

ans = 'Yes'
if sorted_list[M-1] < thr:
    ans = 'No'


print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from sys import stdin


def main():
    input = lambda: stdin.readline()[:-1]
    N, M = map(int, input().split())
    A = list(map(int, input().split()))

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


main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import numpy as np
n,m,*a = map(int,open(0).read().split())
if np.count_nonzero(np.array(a)>sum(a)/4/m)>=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()))
m = 0
s = sum(A)
for i in range(N):
  if A[i] >= math.ceil(s//(4*M)):
    m += 1
  if m == M:
    print("Yes")
    exit()
print("No")

Submission status: Wrong Answer

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

votes = 0
for i in range(m):
    votes += s[i]

s.sort(reverse=True)

for i in range(n):
    if s[i] < votes/(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()))
a_net = [k for k in a if k > (sum(a)/(4*m))]
if len(a_net) >= 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)
c=0
for i in range(len(a)):
  if a[i]>=round(s/(4*m),-1):
    c+=1
if c>=m:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

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

lower_bound = A_sum // (4 * M)
s = 0
for vote in A_list:
    if vote > lower_bound:
        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()))
s = sum(A)
tou = int((1/(4*M))*s)
count = 0
for i in A:
    if i >= tou:
        count += 1
if count >= M:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
import numpy as np
n, m = list(map(int, input().split()))

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

total = np.sum(a)
#print(len(a[a>=total//(4*m)]))

if len(a[a>=total//(4*m)])>=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='No'
sum=0
b=1/(4*M)
c=0
for i in range(N):
  c+=A[i]
d=c*b
for i in range(N):
  if d<A[i]:
    sum=sum+1
  if sum==M:
    ans='Yes'
print(ans)

Submission status: Wrong Answer

Solution code:
import numpy as np
tmp =list(map(int, input().split()))
num=list(map(int, input().split()))
num = np.array(num)

if tmp[1]<=len(num[num>int(num.sum()/(4*tmp[1]))]):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
def ism():return map(str,input().split())
def isl():return list(map(str,input().split()))

n,m = iim()
A = sorted(iil(),reverse=True)

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

Submission status: Wrong Answer

Solution code:
N,M=list(map(int,input().split()))
lst=list(map(int,input().split()))
lst.sort()
if lst[1-M]*4*M>=sum(lst):
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
import numpy as np

def main():
  
  n,m = map(int, input().split())
  A = sorted([int(x) for x in input().split()],reverse=True)
  
  sum = 0
  for a in A:
    sum += a
   
  if(A[m-1]>a/(4*m)):
    print("Yes")
  else:
    print("No")
  return 0
 
if __name__ == "__main__":
  main()

Submission status: Wrong Answer

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

A.sort()
A.reverse()

for i in range(M):
    if A[i] < sum(A) // (4 * M):
        print('No')
        exit(0)
    else:
        continue

print('Yes')

Submission status: Wrong Answer

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

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

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

x = sum(arr)

frac = x//(m*4)

ans=0

for i in range(len(arr)):
    if(arr[i]>frac):
        ans+=1
    
if(ans>=m):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n,m=map(int,input().split())
A=input().split()
AA=[]
for i in range(len(A)):
    AA.append(int(A[i]))
AA.sort(reverse=True)
s=sum(AA)

c=0
while AA[c]>=s/(4*c+4):
    c+=1
    if c==len(AA):
        break
if c>=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()]
a.sort()
if a[-m] > sum(a)*1/(4*m):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
def solve(n, m, arr):
    arr.sort()
    for i in range(m):
        if arr[-1 - i] < sum(arr) * (1 / 4 * m):
            return False
    return True

if __name__ == "__main__":
    n, m = map(int, input().split(' '))
    arr = [int(s) for s in list(input().split())]
    if solve(n, m, arr):
        print('Yes')
    else:
        print('No')

Submission status: Wrong Answer

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

L = sum(S) / 4 * M
SS = 0
for s in S:
    SS += s // L

if SS >= 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)
border = total // (4*m)
count = 0

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

ans = "Yes"
if count < m:
    ans = "No"

print(ans)

Submission status: Wrong Answer

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

ng = sum(a) // (4 * m)
a.sort(reverse=True)
ans = 'Yes'
for i in a[:m]:
    if i < ng:
        ans = 'No'
print(ans)

Submission status: Wrong Answer

Solution code:
N,M = list(map(lambda x:int(x),input().split()))
A_list = list(map(lambda x:int(x),input().split()))
A_total = 0
can_be_choosen = 0

for n in A_list:
    A_total += n

for n in range(len(A_list)):
    if (float(A_list[n]) > (A_total*(1.0/(4.0 * M)))):
        can_be_choosen += 1

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

Submission status: Wrong Answer

Solution code:
import numpy as np

def main():
    N,M = map(int,input().split())
    A = np.array(list(map(int,input().split())))
    ans = 'No'

    if sum( A>= int(sum(A)/4/M) ) >= M: ans = 'Yes'
    
    print(ans)
    return

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

total = sum(A)
A.sort()
A.reverse()
com = 0
for i in A:
    if(i < total/(4*m)):
        break
    else:
        com += 1
if(com>m):
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
n, m = input().split()
n, m = int(n), int(m)
a = input().split()
a = [int(i) for i in a]
a.sort()
a.reverse()
for i in range(n):
  if a[i] < 1/(4*m):
    print("No")
    break
  if i == m-1:
    print("Yes")
    break

Submission status: Wrong Answer

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

count = 0

for tg in l:
	if tg >= 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 = list(map(int, input().split()))

tot_num = sum(a_list)
selectable = len([el for el in a_list if el>=tot_num/4*m]) >= m

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

Submission status: Wrong Answer

Solution code:
N,M =  map(int,input().split())
AL=  [int(x) for x in input().split()]
AL.sort(reverse=True)
Li = sum(AL) // (4*M)
for x in range(M):
    if AL[x] < Li:
        print("No")
        exit()
print("Yes")

Submission status: Wrong Answer

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

sum_a = sum(a)
jouken = sum_a / (m * 4)
#print(jouken)
c = 0
for i in range(n):
    if a[i] < jouken:
        c += 1
if c > m:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
#coding : utf-8

N, M = map(lambda x: int(x), input().split(" "))
A = list(map(lambda x: int(x), input().split(" ")))

total = 0
for a in A:
	total += a

thresh = total // (4 * M)

m = 0

for a in A:
	if a >= thresh:
		m += 1

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

Submission status: Wrong Answer

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

A_list.sort(reverse=True)
SUM = sum(A_list)

if A_list[M-1] > (SUM//(4*M)) :
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

YES = "Yes"
NO = "No"

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

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

B = sorted(A,reverse=True)

cnt = 0
for i in range(N):
    if B[i] > least:
        cnt += 1
    else:
        break

if cnt >= M:
    print(YES)
else:
    print(NO)

Submission status: Wrong Answer

Solution code:
n,m = map(int,input().split())
line = sorted(list(map(int,input().split())),reverse = True)
sums = sum(line)
least = sums//(4*m)
box = []
for i in line:
  if i > least:
    box.append(i)
if len(box) >= 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()]
total_votes = sum(A)
threshold = total_votes / (4 * M)
uppers = [int(i >= threshold) for i in A]
if sum(uppers) > M:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
n,m = map(int,input().split())
a = list(map(int, input().split()))
popular = list(filter(lambda e: e>(1/(4*m))*sum(a),a))
print("Yes" if len(popular) >= m else "No")

Submission status: Wrong Answer

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

for i, a in enumerate(A_list):
    if a >= (1/(4 * M)):
        c += 1
    else:
        break

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

Submission status: Wrong Answer

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

sm = sum(A)
ms = sm // (4*M)
pop = []
for i in range(N):
    if ms < A[i]:
        pop.append(A[i])
    else:
        pass

if len(pop) >= 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()))
    m_count = sum(x > sum(A)/(4*M) for x in A)
    if M <= m_count:
        print("Yes")
    else:
        print("No")
if __name__ == '__main__':
    main()

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-2] >= sum_a/(4*m):
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import numpy as np
tmp =list(map(int, input().split()))
num=list(map(int, input().split()))
num = np.array(num)

if tmp[1]<=len(num[num>(num.sum()+(4*tmp[1])-1//(4*tmp[1]))]):
    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)

A_m = A[m-1]

if A_m > sum(A) / (4 * m):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
import sys

n, m = map(int, input().split())
table = list(map(int, input().split()))
table.sort(reverse=True)
for x in range(0, m):
    if not table[x] >= sum(table) // (4 * m):
        break
else:
    print('Yes')
    sys.exit()
print('No')

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 range(len(a)):
  if a[i]>=round(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())
A = list(map(int, input().split(" ")))

val = sum(A) / (4 * M)
A.sort(reverse=True)
flag = True
for i in range(0,M):
    print(A[i])
    if A[i] < val:
        flag = False
        break
    
if flag:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def listint():
  a = input().split()
  for i in range(len(a)):
    a[i] = int(a[i])
  return a
num,mem = listint()
votes = listint()
sumvo = 0
for i in range(num):
  sumvo = sumvo + votes[i]
able = 0
mini = int(sumvo/(4*mem))
for i in range(num):
  if mini <= votes[i]:
    able = able+1
if able >= mem:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
N, M = map(int,input().split())
AA = list(map(int,input().split()))
AA.sort()
SUM = sum(AA)
TH = SUM/4/M
if AA[-M]>TH:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
n, m = input().split()
n, m = int(n), int(m)
a = input().split()
a = [int(i) for i in a]
a.sort()
a.reverse()
for i in range(n):
  if a[i] < 1/4*m:
    print("No")
    break
  if i == m-1:
    print("Yes")
    break

Submission status: Wrong Answer

Solution code:
nm = input('')
n = int(nm.split(' ')[0])
m = int(nm.split(' ')[1])
alist = input('').split(' ')

s = 0
t = 0
for a in alist:
  t += int(a)

for a in alist:
  a2 = int(a)
  if a2 > t/(m*4):
    s+=1

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

Submission status: Wrong Answer

Solution code:
N, M = list(map(int, input().split()))
a_i = list(map(int, input().split()))
v_sum = sum(a_i)
n = len([a for a in a_i if a >= (1/(4*M))])
if n >= M:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

#print(n,m,l,total)

y = 0
for i in range(n):
    if l[i] > x:
        y += 1
        
if y >= m:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

sum_p = sum(A) * Fraction(1,M*4)
count = 0
for i in A:
    if i > sum_p:
        count += count + 1
if M <= count:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
import math

def solve(n,m,lst):
  min_vote = math.ceil(sum(lst)/4/m) - 1
  print(min_vote)
  print(sum(lst))
  return lst[m-1] > min_vote

if __name__ == "__main__":
  _n, _m = map(int, input().split())
  a_list = [int(i) for i in input().split()]
  a_list = sorted(a_list,reverse=True)
  if solve(_n,_m,a_list):
    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)
c=0
for i in range(len(A)):
  if A[i] >= A_sum/(M*4):
    c+=1
if M < c:
  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)

vote = sum(a)

if a[m-1] > vote*1/(4*m):
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
NM = input().split()
A = input().split()
N = int(NM[0])
M = int(NM[1])
for j in range (N):
    A[j] =int(A[j])
for i in range(M):
    if int(A[i])<sum(A)/4*M:
        print("No")
        exit()
print("Yes")

Submission status: Wrong Answer

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

sumA = sum(A)
count = 0

for i in A:
    if(i > sumA/(4*M)):
        count += 1

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