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:
#python3
from math import floor
def main():
    n, m = map(int, input().split())
    a = [int(i) for i in input().split()]
    c = 0
    s = sum(a)

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

    t = n - c
    if t >= m:
        print('Yes')
    else:
        print('No')
main()

Submission status: Wrong Answer

Solution code:
i = list(map(int, input().split()))
j = list(map(int, input().split()))

j.sort(reverse=True)
k = i[1]
l = sum(j)

if j[k-1] > l /(4*k):
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

#intの場合
N ,M = map(int,input().split())

intlist = list(map(int, input().split()))
newlist = sorted(intlist, reverse=True)[:M]

if newlist[M-1] > ( sum(intlist) / (4 * M) ):
  print ("Yes")
else:
  print ("No")

Submission status: Wrong Answer

Solution code:

N, M = [int(x) for x in input().split()]
A = [int(x) for x in input().split()]


print('Yes')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N,M = map(int,input().split())
li = list(map(int,input().split()))
x = sum(li) / (4*M)
li.sort(reverse=True)

l = [i for i in li if i > x]
if M >= len(l):
    print("No")
else:
    print("Yes")

Submission status: Wrong Answer

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

thresh_score = 1/(4*M) * sum(A)

over_count = sum([1 if a > thresh_score else 0 for a in A])
print('Yes' if over_count >= M else 'No')

Submission status: Wrong Answer

Solution code:
N , M = (map(int , input().split()))
A = list(map(int , input().split()))
s = sum(A)
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:
n,m = map(int, input().split())
a = list(map(int, input().split()))

t = 0
check=False
if(m<=n):
  check=True
  for i in range(len(a)):
    t += a[i]

  for i in reversed(range(len(a))):
    for j in range(i):
      if(a[j] < a[j+1]):
        a[j], a[j+1] = a[j+1],a[j]
      elif(a[j] == a[j+1]):
        check=False
        break

  if(check == True):
    for i in range(m):
      if(a[i] > t/(4*m)):
        check = True
      else:
        check=False


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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
input = lambda: sys.stdin.readline().rstrip()
yes = lambda boolean: print('Yes') if boolean else print('No')
input_ints = lambda: list(map(int, input().split()))

N, M = input_ints()
A = input_ints()
A.sort(reverse=1)
yes(A[M-1]*4*M>sum(A))

Submission status: Wrong Answer

Solution code:
n,m=map(int,input().split())
a=list(map(int,input().split()))
a.sort(reverse=True)
count=0
num=sum(a)/4*m
for i in range(m):
    if a[i]>=num:
        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()))
x = sum(li) / (4*M)
li.sort(reverse=True)

l = [i for i in li if i > x]
if M >= len(l):
    print("No")
else:
    print("Yes")

print(x)

Submission status: Wrong Answer

Solution code:
n,m = map(int,input().split())
A = list(map(int, input().split()))
x = sum(A)/(4*m)
count = 0
for i in range(0, n-1):

    if A[i] < x:
        continue
    else:
        count += 1
if count >= m:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
N,M = (int(x) for x in input().split())
A_list = [int(x) for x in input().split()]
A_sum = sum(A_list)
Bool_list = []
for A in A_list:
    if A*(N*M) >= A_sum:
        Bool_list.append("True")
        
if (len(Bool_list)) >= M:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:

N, M = [int(t) for t in input().split(" ")]
votes = [int(t) for t in input().split(" ")]
total = sum(votes)
t = total/(4*M)
popular = [v for v in votes if v > t]
if len(popular) >= M:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
data = [input().split() for i in range(2)]
NM = data[0]
A = data[1]
A_n = [int(j) for j in A]
all = sum(A_n)
criterion = round(all/(4*int(NM[1])))
appropriate = [k for k in A_n if k >= criterion]
if len(appropriate) >= int(NM[1]):
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
m,n=map(int,input().split())
l=list(map(int,input().strip().split()))
x=sum(l)
y=m+n
if(y<((1/(4*n))*x)):
    print("No")
else:
    print("Yes")

Submission status: Wrong Answer

Solution code:
N, M = map(int, input().split())
A = sorted(list(map(int, input().split())))
ans = sum(x >= sum(A) // 4 // M for x in A)
if ans >= M:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
nums = list(map(int, input().split()))
n = nums[0]
m = nums[1]

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

sum = 0
for v in a:
  sum += v

result = []
for s in a:
    if s >= sum * (1 / (4 * m)):
        result.append(s)
print(result)
if len(result) >= m:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

flag = "No"
removedElement = 0
while 1/(4*m) < max(aList) and removedElement <= m and 2 <= len(aList):
    if removedElement == m:
        flag = "Yes"
    removedElement += 1
    aList.remove(max(aList))

print(flag)

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:
n, m = map(int, input().split())
points = [i for i in map(int, input().split())]

sumValue = sum(points)

candidates = [i for i in points if i >= (sumValue/4)]

if len(candidates) >= 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()]
total = sum(A)

ans = sum([1 for a in A if a>=total/(4*M)])
print('Yes' if total >=M else '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:
import sys
n, m = map(int, input().split())
a = list(map(int, input().split()))
vote = sum(a)
rank = sorted(a, reverse=True)
border = vote // (4*m)
#print(border, rank)
count = 0

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

    if count == m:
        print('Yes')
        sys.exit()

print('No')

Submission status: Wrong Answer

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

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

a.sort(reverse=True)

b = 0
for i in a:
    b += i
c = b * (1 / (4 * m))
if m <= n:
    for j in range(m):
        if a[j] <= c:
            print('No')
            exit()

print('Yes')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def getInput():
    return [int(i) for i in input().rstrip().split(' ')]

N, M = getInput()
A = getInput()
_4M = int(sum(A)/(4*M))
A.sort(reverse=True)
cnt = 0
for i in A:
    if i >= _4M:
        cnt += 1

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N,M = map(int, input().split())
A = list(map(int, input().split()))
sum_A = sum(A)
cout = 0
flag = False
for i in range(N):
  if A[i] >= max(A) // (4 * M):
    cout += 1
    if cout > M:
      flag = True
      break
      
if flag:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
NM = input().split();
N,M = int(NM[0]),int(NM[1]);
A = list(map(int, input().split()));
A.sort(reverse=True);

#先に総得票数を調べる
Sum = 0;
for i in range(N):
    Sum = Sum + A[i];
    
#人気商品とは呼べないボーダー
fil = int(Sum / (4 * M));

#全探索
count=0;
for j in range(M):
    if(A[j] >= fil):
        count+=1;

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N, M = [int(x) for x in input().split()]
A = [int(x) for x in input().split()]
A.sort()
A.reverse()
total = 0
Flag = True
for i in A:
    total += i
for i in range(M):
    if A[i]*4*M < total:
        Flag = False
if Flag:
    print("YES")
else:
    print("NO")

Submission status: Wrong Answer

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

for i in range(n):
  if allVote/4 > a[i]:
    counter +=1 
  else:
    break

if counter >= m:
  flag = True

if flag is False:
  print("No")
else:
  print("Yes")

Submission status: Wrong Answer

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

def swap(A, B):
    temp = A
    A = B
    B = temp
    return A, B

def main():
    N, M = map(int, input().rstrip().split())
    As = list(map(int, input().rstrip().split()))
    bound = sum(As) / (4 * M)
    res = 0
    for a in As:
        if a > bound:
            res += 1
    if res >= M:
        print("Yes")
    else:
        print("No")

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
#At coder 2020/3/27 C

# スペース区切りの整数の入力
N,M= map(int, input().split())
A = list(map(int, input().split())) 
sumA=sum(A)
numM = sum(x>=(sumA*0.25/M) for x in A)
if numM>M:
    ans='Yes'
else:
    ans='No'
#print(numM,M)
print(ans)

Submission status: Wrong Answer

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

ans = 0
sums = 0

for _ in range(M):
  sums += A[_]


for i in range(N):
  if A[i]//sums >= 1//4*M:
    ans += 1
  else:
    pass
  
  
  

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

mm = int(sum(A) / (4 * M))
print('Yes' if len([i for i in A if i >= mm]) >= M else 'No')

Submission status: Wrong Answer

Solution code:
INPUT = input().split()
N = int(INPUT[0])
M = int(INPUT[1])
score_list = input().split()
score_list_int =  [int(n) for n in score_list]

border = sum(score_list_int)/4

answer = "yes"

for i in score_list_int:
    if i < border:
        N -= 1

if N < M:
    answer = "no"
    
print(answer)

Submission status: Wrong Answer

Solution code:
N,M = list(map(int,input().split()))
A = list(map(int,input().split()))
list.sort(A,reverse=True)
count = 0
Sum = sum(A)
for i in range(M):
    if A[i] > Sum/(4*M):
        count +=1

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

Submission status: Wrong Answer

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

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

FLAG=int(1/(4*M)*all)
flag=0

for i in range(N):
    if FLAG<=int(A[0][i]):
        flag+=1
if flag>=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)
d=s//(4*M)
count=0
i=0
while(i<N):
    if(A[i]>=d):
        count=count+1
    i=i+1

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

Submission status: Wrong Answer

Solution code:
nb_items, M = [int(x) for x in input().split()]
votes = [int(x) for x in input().split()]
sum_votes = sum(votes)
Mfactor  = sum_votes // (4 * M)
votes  = [ x for x in votes if x > Mfactor]
print("Yes" if len(votes)> M else "No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
url = "https://atcoder.jp/contests/abc161/tasks/abc161_b"

def main():
    n, m = list(map(int, input().split()))
    n_li = list(map(int, input().split()))
    n_li = sorted(n_li, reverse=True)
    all = sum(n_li)
    for i in range(1, m + 1):
        if all / (4 * m) >= n_li[i - 1]:
            print('No')
            exit()
    print('Yes')


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

#intの場合
N ,M = map(int,input().split())

intlist = list(map(int, input().split()))
newlist = sorted(intlist, reverse=True)[:M]

print ( newlist[M-1])
print ( sum(intlist) / (4 * M))
if newlist[M-1] > ( sum(intlist) / (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()))

sumOfA = sum(A)

condition = sumOfA//(4*M)

popItem  = []


for i in A:
    if(i > condition):
        popItem.append("Yes")
    else:
        popItem.append("No")

print("Yes" if popItem.count("Yes")>M else "No")

Submission status: Wrong Answer

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

s = sum(a) / (4 * m)
ans = 0
for i in range(n - 1):
    if a[i] >= s:
        ans += 1
    else:
        ans += 0
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_a = sum(a)

# print(n)
# print(m)

# print(sum_a)
# print(sum_a // n)

count = 0
for aa in a:
    # print(aa)
    if aa >= sum_a // (4 * m):
        count += 1
        
# print(count)
if count >= m:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-


'''

'''

import numpy as np

N, M = map(int, input().split())
a = list(map(int, input().split()))
a = np.array(a)
s = int(a.sum())
level = 1 / (4 * M)
# print(a)
# print(level)

cnt = (a > level * s).sum()

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input().split(" ")
N = int(s[0])
M = int(s[1])

s = input().split(" ")
sum = 0
for i in range(N):
    sum += int(s[i])

yes = True

for i in range(M):
    if int(s[i]) < sum / 4 * M:
        yes = False
if yes:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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


A=list(map(int,input().split()))
Sum=sum(A)
pop=[]
l=Sum/(4*M)
for i in range(N):
    if(A[i]>l):
        pop.append(A[i])
        
print("Yes" if len(pop)>=M else "No")

Submission status: Wrong Answer

Solution code:
N, M = map(int, input().split())
A = list(map(int, input().split()))
sorted_A = sorted(A, reverse=True)
all_vote = sum(A)
guard = all_vote // (M * 4)
selected = []

for i in range(M):
    if sorted_A[i] >= guard:
        selected.append(sorted_A[i])

if M == len(selected):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:

def resolve():
    N, M = map(int, input().split())
    A = sorted(map(int, input().split()), reverse=True)
    ok_line = sum(A)/(4*M)
    cnt = 0
    for a in A:
        if ok_line < a:
            cnt += 1
    ans = True if M <= cnt else False
    return print("Yes" if ans else "No")

if __name__ == "__main__":
    resolve()

Submission status: Wrong Answer

Solution code:

n, m = (int(x) for x in input().split())
a_list = list(map(int, input().split()))

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

# print('border')
# print(border)

count = 0

for i in range(len(a_list)):

    # print('a_list')
    # print(a_list[i])

    if border < a_list[i] :
        count = count + 1

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

Submission status: Wrong Answer

Solution code:
import sys
import os
import math

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 = math.floor(sm * (0.25 * 1/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:
nums = list(map(int, input().split()))
n = nums[0]
m = nums[1]

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

sum = 0
for v in a:
  sum += v

result = []
for s in a:
    if s >= sum * (1 / (4 * m)):
        result.append(s)
print(result)
if len(result) >= m:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
data = [input().split() for i in range(2)]
NM = data[0]
A = data[1]
A_n = [int(j) for j in A]
all = sum(A_n)
criterion = round(all/(4*int(NM[1])))
appropriate = [k for k in A_n if k >= criterion]
if len(appropriate) >= int(NM[1]) :
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
nm = input().split(" ")
N, M = int(nm[0]), int(nm[1])
# print(N, M)

sorted_data = sorted(list(map(int, input().split(" "))), reverse=True)
# print(sorted_data[M - 1], sum(sorted_data))
if sorted_data[M - 1] * 4 * M > sum(sorted_data):
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

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

if sum(A)/(4*M) >= A[M-1]:
    print("No")

print("Yes")

Submission status: Wrong Answer

Solution code:
import sys
import copy
import math
import bisect
import pprint
import bisect
from functools import reduce
from copy import deepcopy
from collections import deque
from decimal import *


def lcm(x, y):
    return (x * y) // math.gcd(x, y)


if __name__ == '__main__':
    b, c = map(int, input().split())

    a = [int(i) for i in input().split()]
    t = sum(a)
    a.sort(reverse=True)
    count = 0
    for i in range(c):
        if a[i] / t >= i / (4 * c):
            count += 1
    if count == 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_sorted = sorted(A, reverse=True)

A_sum = sum(A)

if A_sorted[m-1] > A_sum/(4*m):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
from sys import stdin
from operator import itemgetter
import math
# stdin = open("sample.txt")

N,M = [int(x) for x in stdin.readline().rstrip().split()]

hyo = list(map(int,[int(x) for x in stdin.readline().rstrip().split()]))
sort_hyo = sorted(hyo, reverse=True)
point = sum(hyo)
target = point // (4*M)
for i in range(len(hyo)):
    if sort_hyo[i] >= target:
        sort_hyo[i] = "Yes"
    else:
        sort_hyo[i] = "No"
        
print(sort_hyo[M-1])

Submission status: Wrong Answer

Solution code:
NM = [int(_) for _ in input().split()]
N = NM[0]
M = NM[1]

A = [int(_) for _ in input().split()]

def solve(N, M, A):
    
    d = int(sum(A) * 1/(4*M))
    
    ct = 0
    for i in A:
        if i <= d:
            ct += 1
    
    if ct >= M:
        return "Yes"
    else:
        return "No"

print(solve(N, M, A))

Submission status: Wrong Answer

Solution code:
nb_items, M = [int(x) for x in input().split()]
votes = [int(x) for x in input().split()]
sum_votes = sum(votes)
Mfactor  = sum_votes // (4 * M)
votes  = [ x for x in votes if x > Mfactor]
print("Yes" if len(votes)>= M else "No")

Submission status: Wrong Answer

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

count = 0
v = sum(B) // 4 // M

for i in B:
    if i >= v:
        count += 1

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

Submission status: Wrong Answer

Solution code:
def LI():
	return [ int(s) for s in input().split() ]
N,M = LI()
A = LI()
 
print('Yes') if sum(map(lambda x: x >= (1/4/M), A)) >= M else print('No')

Submission status: Wrong Answer

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

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

ksum= sum(k)
k.sort(reverse=True)
#print(k)
p = 'Yes'
for i in range(b):
    #print(i)
    if k[i] <= ksum/4/b:
        p = 'No'
        break
print(p)

Submission status: Wrong Answer

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

num = 0

for i in list:
    if i >= sum(list)/(4*M):
        num+=1

print(num)

if num >= 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 range(n):
	total=total+a[i]
th=total/(4*m)
    
for i in range(n):
  if(a[i]>(th)):
    count=count+1
#print(count)
if(count>=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()]
threshold = sum(A) / (4 * M)
A = [i for i in A if i > threshold ]
if len(A) >= M:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
N, M = list(map(int, input().split()))
scores = list(map(int, input().split()))
at_least = sum(scores) // (4*M)

if len([ s for s in scores if s > at_least]) >= M:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
#python3
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

    t = n - c
    if t >= m:
        print('Yes')
    else:
        print('No')
main()

Submission status: Wrong Answer

Solution code:
import math
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] < math.ceil(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()))

cut = int(sum(A)/(4*int(M)))

count = 0

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

total = sum(A)

th = total/(4*m)
A = sorted(A,reverse=True)

ans = 'Yes'
for i in range(m):
  if A[i] > th:
    continue
  else:
    ans = 'No'
  

print(ans)

Submission status: Wrong Answer

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

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

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

t = 0
check=True
for i in range(len(a)):
  t += a[i]

for i in reversed(range(len(a))):
  for j in range(i):
    if(a[j] < a[j+1]):
      a[j], a[j+1] = a[j+1],a[j]
    elif(a[j] == a[j+1]):
      check=False
      break

if(check == True):
  for i in range(m):
    if(a[i] > t/(4*m)):
      check = True
    else:
      check=False
    
    
if(check):
  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)
ta = int(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:


n, m = map(int, input().split())
a = list(map(int,input().split()))
l = []

for i in a:
    if i > sum(a) / (4 * m):
        l.append(i)

if len(l) >= m:
    print('Yes')

else:
    print('No')

Submission status: Wrong Answer

Solution code:
N,M = map(int,input().split())
li = list(map(int,input().split()))
x = sum(li) * 1/(4*M)
li.sort(reverse=True)

l = [i for i in li if i > x]
if M > len(l):
    print("No")
else:
    print("Yes")

Submission status: Wrong Answer

Solution code:
n,m = map(int, input().split())
a = list(map(int, input().split()))
flag = False
allVote = sum(a)
a.sort()
counter = 0

for i in range(n):
  if allVote/4 > a[i]:
    counter +=1 
  else:
    break

if counter >= m:
  flag = True

if flag is False:
  print("No")
else:
  print("Yes")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:

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:
a = input()
numbers = a.split()
b = input()
votes = b.split()
total = 0
for k in votes:
    total = total + int(k)
check = total/(4*int(numbers[1]))
items = 0
for i in votes:
    if int(i)>check:
        items = items+1
if items >= int(numbers[1]):
    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(" ")]
s = sum(a)
c = s//(4*m)
ans = [i for i in a if i >= c]
if len(ans) >= m:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

for i in range(n):
    l[i]=l[i]/suml

temp=4*m
temp=1/temp

flag=False

for i in range(n):
    if m==0:
        flag=True
        break
    else:
        if l[i]>=temp:
            m-=1

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

Submission status: Wrong Answer

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

count = 0
x = sum(a_list)/(4*m)
print(x)
for i in range(0,n):
  if a_list[i] >= x :
    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()))
sum=0;
count=0;
for i in range(len(a)):
    sum=sum+a[i]
c=(1/(4*m))*sum
for i in range(len(a)):
    if a[i]>c :
        count=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()))

t = sum(A) / (4 * M)
ans = 0
for a in A:
    if a >= t:
        ans += 1
if ans > M:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
nb_items, M = [int(x) for x in input().split()]
votes = [int(x) for x in input().split()]
sum_votes = sum(votes)
Mfactor  = sum_votes // (4 * M)
votes  = [ x for x in votes if x >= Mfactor]
print("Yes" if len(votes)>= M else "No")

Submission status: Wrong Answer

Solution code:
N,M=[int(x) for x in input().split()]
A=[int(x) for x in 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")