Problem:


Score : 200 points

Problem Statement

We have held a popularity poll for N items on sale. Item i received A_i votes.

From these N items, we will select M as popular items. However, we cannot select an item with less than \dfrac{1}{4M} of the total number of votes.

If M popular items can be selected, print Yes; otherwise, print No.

Constraints

1 \leq M \leq N \leq 100

1 \leq A_i \leq 1000

A_i are distinct.

All values in input are integers.

Input

Input is given from Standard Input in the following format:

N M
A_1 ... A_N

Output

If M popular items can be selected, print Yes; otherwise, print No.

Sample Input 1

4 1
5 4 2 1

Sample Output 1

Yes

There were 12 votes in total. The most popular item received 5 votes, and we can select it.

Sample Input 2

3 2
380 19 1

Sample Output 2

No

There were 400 votes in total. The second and third most popular items received less than \dfrac{1}{4\times 2} of the total number of votes, so we cannot select them. Thus, we cannot select two popular items.

Sample Input 3

12 3
4 56 78 901 2 345 67 890 123 45 6 789

Sample Output 3

Yes



Sample input:
4 1
5 4 2 1


Sample output:
Yes

Submission status: Wrong Answer

Solution code:
N,M=map(int,input().split())
A=list(map(int,input().split()))
A.sort(reverse=True)
s=sum(A)

P=0 #選べる個数
for a in A:
    if a>=s/(4*M):
        P+=1
    else:
        break
        
if P==M:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

P=0 #選べる個数
for a in A:
    if a>=s/(4*M):
        P+=1
    else:
        break
        
if P==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)

P=0 #選べる個数
for a in A:
    if 4*M*a>=s:
        P+=1
        
if P==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)

P=0 #選べる個数
for n in range(N):
    if 4*M*A[n]>=s:
        P+=1
        
if P==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 aa in a:
  if aa>=sum(a)/4*m:
    count+=1
if count>=m:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
array = []

for i in range(2):
    val = input()
    array.append(val.split())

kinds = int(array[0][0])
populars = int(array[0][1])
votes_sum = 0

for vote in array[1]:
    votes_sum = votes_sum + int(vote)

winning = votes_sum / (4 * populars)
numbers = 0

for vote in array[1]:
    if int(vote) > winning:
        numbers = numbers + 1

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

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

cnt=0
sou=sum(a)
for i in range(n):
    if a[i]>=int(sou//(4*m)):
        cnt+=1
print('Yes' if cnt>=m else 'No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

s = sum(A)
p = s/4/M
cnt = 0
for i in range(N):
  if A[i] >= p:
    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()))
cnt = 0

for i in range(N):
    if A[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()))
cnt = 0

for i in range(N):
    if A[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()))
cnt = 0

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

Submission status: Wrong Answer

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

t = int(sum(a)/(4*m))
for i in range(m):
  if a[i] < t:
    print("No")
    exit()
print("Yes")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

for i in range(n):
  if a[i] > sum(a) / 4 * m:
    print("Yes")
    break;
  else:
    print("No")
    break;

Submission status: Wrong Answer

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

for i in range(m):
  if a[i] < sum(a)//(4*m):
    print("No")
    exit()
print("Yes")

Submission status: Wrong Answer

Solution code:
n, m = map(int, input().split())
a = sorted(map(int, input().split()), reverse=True)
print("No" if min(a[:m]) < (sum(a) // (4 * m)) else "Yes")

Submission status: Wrong Answer

Solution code:
n, m = map(int, input().split())
a = sorted(map(int, input().split()), reverse=True)
print("No" if min(a[:m]) < (sum(a) // 8) else "Yes")

Submission status: Wrong Answer

Solution code:
n, m = map(int, input().split())
a = sorted(map(int, input().split()), reverse=True)
print("NO" if min(a[:m]) < (sum(a) // 8) else "YES")

Submission status: Wrong Answer

Solution code:
import numpy as np
N, M = map(int, input().split())
A = np.array(input().split(), dtype=np.int16)
print(["Yes", "No"][(A > A.sum() / (4 * M)).sum() < M])

Submission status: Wrong Answer

Solution code:
N,M=map(int,(input().split()))
A=list(map(int,(input().split())))
count=0
for i in A:
    if i >= (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())
a = list(map(int, input().split()))
counter = 0

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

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

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

Solution code:
n,m = map(int, input().split())
ar = map(int,input().split())
ans = 0
th = 1/4/m
for i in ar:
  if i < th:
    continue
  ans+=1
print(ans)

Submission status: Wrong Answer

Solution code:
#! env/bin/local python3
# -*- coding:utf-8 -*-

is_first = True
while True:
    try:
        if is_first:
            n, m  = [int(i) for i in input().split()]
            is_first = False
        else:
            arr = [int(i) for i in input().split()]
    except EOFError:
        break

total_vote = sum(arr)
sorted_arr = sorted(arr, reverse=True)

list_up_arr = sorted_arr[: m]

flag = True
for l in list_up_arr:
    if l < 1 / 4 * m:
        flag = False

print('Yes' if flag else 'No')

Submission status: Wrong Answer

Solution code:
#! env/bin/local python3
# -*- coding:utf-8 -*-

is_first = True
while True:
    try:
        if is_first:
            n, m  = [int(i) for i in input().split()]
            is_first = False
        else:
            arr = [int(i) for i in input().split()]
    except EOFError:
        break

total_vote = sum(arr)
sorted_arr = sorted(arr, reverse=True)

list_up_arr = sorted_arr[: m]

flag = True
for l in list_up_arr:
    if l < 1 / (4 * m):
        flag = False

print('Yes' if flag else 'No')

Submission status: Wrong Answer

Solution code:
#! env/bin/local python3
# -*- coding:utf-8 -*-

is_first = True
while True:
    try:
        if is_first:
            n, m  = [int(i) for i in input().split()]
            is_first = False
        else:
            arr = [int(i) for i in input().split()]
    except EOFError:
        break

total_vote = sum(arr)
sorted_arr = sorted(arr, reverse=True)

list_up_arr = sorted_arr[: m]

flag = False
for l in list_up_arr:
    if l >= 1 / (4 * m):
        flag = True

print('Yes' if flag else 'No')

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(10 ** 6)
# input = sys.stdin.readline    ####
int1 = lambda x: int(x) - 1
def II(): return int(input())

def MI(): return map(int, input().split())
def MI1(): return map(int1, input().split())

def LI(): return list(map(int, input().split()))
def LI1(): return list(map(int1, input().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]

INF = float('inf')

def solve():
    n, m = MI()
    A = LI()

    s = sum(A)
    cnt = 0
    for a in A:
        if a * 4 * m > s:
            cnt += 1
    print('Yes' if cnt >= m else 'No')


if __name__ == '__main__':
    solve()

Submission status: Wrong Answer

Solution code:
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop
from itertools import permutations, accumulate
from math import sqrt, ceil, floor
from bisect import bisect_left, bisect_right
from copy import deepcopy
from operator import itemgetter
from fractions import gcd
import sys
def I(): return int(input())  # '123' -> 123
def Is(): return map(int, input().split())  # '123 456' -> 123, 456
def LI(): return list(map(int, input().split()))  # '123 456' -> [123, 456]
def TI(): return tuple(map(int, input().split()))  # '123 456' -> (123, 456)
def IR(n): return [I() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def TIR(n): return [TI() for _ in range(n)]
def S(): return input()
def Ss(): return input().split()  # 'aa bb' -> 'aa','bb' or ['aa','bb']
def LS(): return list(input())  # 'abc123' -> ['a','b','c','1','2','3']
def SR(n): return [S() for _ in range(n)]
def SsR(n): return [Ss() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
sys.setrecursionlimit(1000000)
MOD = 1000000007
INF = float('inf')

n, m = Is()
A = LI()
s = sum(A)
c = s/(4*m)
# print(c)
count = 0
for a in A:
    if a * m * 4 > s:
        count += 1
        # print(a)

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

Submission status: Wrong Answer

Solution code:
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop
from itertools import permutations, accumulate
from math import sqrt, ceil, floor
from bisect import bisect_left, bisect_right
from copy import deepcopy
from operator import itemgetter
from fractions import gcd
import sys
def I(): return int(input())  # '123' -> 123
def Is(): return map(int, input().split())  # '123 456' -> 123, 456
def LI(): return list(map(int, input().split()))  # '123 456' -> [123, 456]
def TI(): return tuple(map(int, input().split()))  # '123 456' -> (123, 456)
def IR(n): return [I() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def TIR(n): return [TI() for _ in range(n)]
def S(): return input()
def Ss(): return input().split()  # 'aa bb' -> 'aa','bb' or ['aa','bb']
def LS(): return list(input())  # 'abc123' -> ['a','b','c','1','2','3']
def SR(n): return [S() for _ in range(n)]
def SsR(n): return [Ss() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
sys.setrecursionlimit(1000000)
MOD = 1000000007
INF = float('inf')

n, m = Is()
A = LI()
s = sum(A)
c = s/(4*m)
# print(c)
count = 0
for a in A:
    if a > c:
        count += 1
        # print(a)

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

Submission status: Wrong Answer

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

sum = 0
for i in range(n):
    sum += a[i]

border = sum / (4*m)

ans = 0
for i in range(n):
    if a[i] > border:
        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 = 0
for i in range(n):
    sum += a[i]

border = sum / (4*m)

ans = 0
for i in range(n):
    if float(a[i]) > border:
        ans += 1

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

Submission status: Wrong Answer

Solution code:
#!usr/bin/env python3
from collections import defaultdict, deque
from heapq import heappush, heappop
from itertools import permutations, accumulate
import sys
import math
import bisect
def LI(): return [int(x) for x in sys.stdin.buffer.readline().split()]
def I(): return int(sys.stdin.buffer.readline())
def LS():return [list(x) for x in sys.stdin.readline().split()]
def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res
def IR(n):
    return [I() for i in range(n)]
def LIR(n):
    return [LI() for i in range(n)]
def SR(n):
    return [S() for i in range(n)]
def LSR(n):
    return [LS() for i in range(n)]
 
sys.setrecursionlimit(1000000)
mod = 1000000007
 
def solve():
  N,M = map(int,input().split())
  A = list(map(int,input().split()))
  count = 0
  
  for i in range(N):
    if A[i] >= sum(A)//(4*M):
      count += 1

  if count >= M:
    print("Yes")
  else:
    print("No")
  return
 
#Solve
if __name__ == "__main__":
    solve()

Submission status: Wrong Answer

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

if A[M-1] >= sum(A)/M/4 :
	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 = sorted(A, reverse = True)
if A[M-1] >= s//(4*M):
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
n,k=map(int,input().split())
while n>=0:
  n=abs(n-k)
  if n-k<=0:
    print(abs(n))
    break

Submission status: Wrong Answer

Solution code:
N, M = map(int, input().split())
A = list(map(int, input().split()))
all_vote = 0
x = 1 # =true


for i in range(N-1):
    all_vote = all_vote + A[i]
    if A[i] < (1/4)*M*all_vote:
        x = 0 # =false

if x == 1:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

n=0
def jugde_A(n):
    i=0
    for i in range(len(A)):
        if A[i]>=(Total/4*M):
            n+=1
    return n
if jugde_A(n)>=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)

n=0
def jugde_A(n):
    i=0
    for i in range(len(A)):
        if A[i]<(Total/4*M):
            n+=1
    return n
if jugde_A(n)>=M:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

l = int(sum(A)/(4*m))

cnt = 0
for a in A:
    if a >= l:
        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()))
s = sum(a)
a.sort()
a.reverse()

for i in range(n):
    if i >= m:
        print('Yes')
        exit()
    if a[i]*4*m < s:
        print('No')
        exit()

Submission status: Wrong Answer

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

total = sum(A)

selcnt = 0
for a_i in sorted(A):
    if a_i < total * (1/(4*M)):
        break
    selcnt += 1

if selcnt >= 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)

selcnt = 0
for a_i in A:
    if a_i >= total * (1/(4*M)):
        break
    selcnt += 1

if selcnt >= 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)

selcnt = 0
for a_i in sorted(A):
    if a_i >= total * (1/(4*M)):
        break
    selcnt += 1

if selcnt >= 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)

selcnt = 0
for a_i in A:
    if a_i >= total * (1/(4*M)):
        selcnt += 1

if selcnt >= 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)

selcnt = 0
for a_i in A:
    if a_i > total * (1/(4*M)):
        selcnt += 1

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

Submission status: Wrong Answer

Solution code:
# B - Popular Vote
# https://atcoder.jp/contests/abc161/tasks/abc161_bß

# N 商品の種類数
# M 選択したい商品数
# votes 各商品ごとの投票数
N,M = list(map(int,input().split()))
votes = list(map(int,input().split()))

# 総投票数
total_vote = 0

# 総投票数算出
for vote in votes:
    total_vote += vote

# 購入できる商品数
i = 0

for vote in votes:
    # 得票数が総投票数の 1/4M 以上であれば商品を選択
    if vote > total_vote*(1/(4*M)):
        i += 1

# 商品をM個購入できる場合
if i >= 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)
chk = True
s = sum(A)
for i in range(m):
    if A[i] >= s/4*m:
        pass
    else:
        chk = False
if chk == True:
    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)
chk = True
s = sum(A)
for i in range(m):
    if A[i] >= s//(4*m):
        pass
    else:
        chk = False
if chk == True:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
N, M = input().split()
list = input().split()
count = 0
sumall = 0
list_up = []
list.sort(reverse = True)

for i in range(int(N)):
  sumall = sumall + int(list[i])
for i in range(int(M)):
  list_up.append(int(list[i]))

for i in range(int(M)):
  if list_up[i] < sumall/(4*int(M)):
    count = count + 1

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

Submission status: Wrong Answer

Solution code:
N, M = input().split()
list = input().split()
count = 0
sumall = 0
list_up = []
list.sort(reverse = True)

for i in range(int(N)):
  sumall = sumall + int(list[i])
for i in range(int(M)):
  list_up.append(int(list[i]))

for i in range(int(M)):
  if list_up[i]*int(M)*4 < sumall:
    count = count + 1

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

Submission status: Wrong Answer

Solution code:
N, M = input().split()
list = input().split()
count = 0
sumall = 0
list_up = []
list.sort(reverse = True)

for i in range(int(N)):
  sumall = sumall + int(list[i])
for i in range(int(M)):
  list_up.append(int(list[i]))

for i in range(int(M)):
  if list_up[i]*int(M)*4 < sumall:
    count = count + 1
  else:
    pass
if count == 0:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N,M=map(int,input().split())
L=list(map(int,input().split()))
S=sum(L)
L.sort()
a=L[N-M]
if a*4*M<S:
  print('NO')
else:
  print('Yes')

Submission status: Wrong Answer

Solution code:
N,M=map(int,input().split())
L=list(map(int,input().split()))
S=sum(L)
a=max(L)
if a*4*M<S:
  print('NO')
else:
  print('Yes')

Submission status: Wrong Answer

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

print(N, M)
print(A)

for i in range(N):
  if A[i] >= vote / 4 / M:
    cnt += 1
  else:
    continue

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()))
vote = sum(A)
cnt = 0

for i in range(N-1):
  if A[i] >= vote / 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()))
vote = sum(A)
cnt = 0

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N, M = map(int, input().split())
A = list(map(int, input().split()))
border = sum(A) / (4 * M)
count = [i for i in A if i > border]
if len(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()))
border = sum(A) // (4 * M)
count = [i for i in A if i > border]

if len(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()))
border = sum(A) // int((4 * M))
count = [i for i in A if i > border]

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

Submission status: Wrong Answer

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

counta = sum(a)
count = 0

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

if count <= counta:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

counta = sum(a)
count = 0

for i in range(n):
    if a[i] >= counta/(4*m):
        count += 1

if count <= counta:
    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)
sum_vote = sum(a)
judge = sum_vote /  (4*m)
ans = 'Yes'
for x in a[:m:]:
    print(x,judge)
    if x < judge:
        ans = 'No'
        break
print(ans)

Submission status: Wrong Answer

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

a_sum = sum(a)
t = a_sum / (4*m)

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from functools import reduce
from operator import add

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

total = reduce(add, d)
print('Yes') if all(m >= total//(M*4) for m in d[:M]) else print('No')

Submission status: Wrong Answer

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

sum = 0
result = 0

for i in range(N):
    sum = sum + list[i] 

for i in range(N):
    if list[i] >= sum/4:
        result = result + 1
#print(result)
#print(sum)
if result >= M:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

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

qtd_votos = sum(votos)
minimo = qtd_votos/(4*M)

contador = 0
for i in votos:
    if i > minimo:
        contador += 1
if contador >= M:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

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

qtd_votos = sum(votos)
minimo = qtd_votos//(4*M)

contador = 0
for i in votos:
    if i > minimo:
        contador += 1
if contador >= M:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

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

qtd_votos = sum(votos)
minimo = qtd_votos//(4*M)

contador = 0
for i in votos:
    if i >= minimo:
        contador += 1
if contador >= M:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

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

qtd_votos = sum(votos)
minimo = qtd_votos//(4*M)

contador = 0
for i in votos:
    if i >= minimo:
        contador += 1

print(qtd_votos,contador,minimo)
if contador >= M:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
def main():
    M, N = map(int, input().split())
    A = list(map(int, input().split()))
    assert M == len(A)
    votes = sum(A)
    count = 0
    for i in A:
        if i * 4 * M >= votes:
            count += 1
    print("Yes") if count >= N else print("No")


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
def main():
    M, N = map(int, input().split())
    A = list(map(int, input().split()))
    assert M == len(A)
    votes = sum(A)/(4*M)
    count = 0
    for i in A:
        if i >= votes:
            count += 1
    print("Yes") if count >= N else print("No")


if __name__ == '__main__':
    main()