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()))
cnt_border = 0

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

Submission status: Wrong Answer

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

for a in A:
         if a>=sum(A)/4:
             count+=1

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

Submission status: Wrong Answer

Solution code:
import math
import sys

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

a = input().split()
l_si_i = [int(b) for b in a]
#print(l_si_i)

#print(max(l_si_i))
#print(sum(l_si_i))

border = math.floor(sum(l_si_i) / (4 * m))
#print(border)

check = 0
for i in range(n):
  c = l_si_i[i]
  if c > border:
    check += 1
    
  if check >= m:
    print("Yes")
    sys.exit()
    
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 float(AL[x]) < Li+1:
        print("No")
        exit()
print("Yes")

Submission status: Wrong Answer

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

waru = 4 * M
SUM = sum(list_a)
vote = SUM / waru

for i in range(0, N):
    if list_a[i] > vote:
        count += 1
    else:
        pass

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

Submission status: Wrong Answer

Solution code:
n,m = map(int,input().split())
l = list(map(int,input().split()))
l.sort(reverse=True)
if l[n-1] < sum(l)/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)
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 = map(int, input().split())
lists, count, error = [int(x) for x in input().split()], 0, 0
for x in lists:
    if x < ((1 / (4 * M)) * sum(lists)):
        count += 1
print('Yes' if count > M else 'No')

Submission status: Wrong Answer

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

m = 4*M
if a[M-1] <m:
  print('No')
else:
  print('Yes')

Submission status: Wrong Answer

Solution code:
n, m = map(int, input().split())
a = list(map(int, input().split()))
u = sum(a) / (4*m)
print(u)
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 = list(map(int, input().split()))
b = sum(list(map(lambda x: x >= sum(a)/(4*m), a)))
print(n,m,a,b)
print('Yes' if m<=b else 'No')

Submission status: Wrong Answer

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

L = math.ceil(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:
# B - Popular Vote
N,M=list(map(int, input().split()))
A=list(map(int, input().split()))

s0 = sum(A)

B = sorted(A,reverse=True)
s = 0
for i in range(M):
    s = s + B[i]

if s0 <= 4*M*s:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
n, m = map(int, input().split())
list_vote = list(map(int, input().split()))
list_vote_copy = list_vote[:]
total_votes = sum(list_vote)
check = (total_votes / (4 * m))
count = 0
for ele in list_vote_copy:
    if ele > check:
        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()]
sousuu = 0
kakutoku = 0
x = [0]*n

x = [int(x) for x in input().split()]

for i in range(n):
    sousuu += int(x[i])

for i in range(n):
    if int(x[i]) > sousuu*(1//4*m):
        kakutoku += 1

if kakutoku > m:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())
l=list(map(int,input().split()))
print('Yes' if sum(l[b:b+3])>sum(l)//(4*b) else 'No')

Submission status: Wrong Answer

Solution code:
def main():
    n, m = [int(e) for e in input().split()]
    A = [int(e) for e in input().split()]

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

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

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
in_ = input()
n, m = map(int, in_.split())
in_ = input()
a = map(int, in_.split())
a = sorted(a, reverse=True)
mm = int(sum(a) / (4. * m))
if a[m-1] >= mm:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

all_num = (sum(a_list) // (4 * m)) + 1
count = 0
flag = False
for i in range(n):
    a = a_list[i]
    if a >= all_num:
        count += 1
    if count == m:
        flag = True
        break

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

Submission status: Wrong Answer

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

print('Yes') if lst[m-1] > sum(lst)/4*m 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)

bool_list = []

for i in range(len(A)):
    if A[i] >= (sum_A / 4*M):
        bool_list.append("T")

    else:
        continue

# print(sum_A)
# print(bool_list)
if bool_list.count("T") >= M:
    print("Yes")

else:
    print("No")

Submission status: Wrong Answer

Solution code:
N,M=map(int,input().split())#N 種類の数 M 選ぶ品物の数
A=list(map(int,input().split()))#得票数

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

A=[i for i in A if i>=m]

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

Submission status: Wrong Answer

Solution code:
from bisect import bisect

n, m = input().split()
l = sorted(list(map(int, input().split())))
sum_touhyou = sum(l)
line_touhyou = sum_touhyou * (1 / (int(m) * 4))

index = bisect(l, line_touhyou)
if len(l[index:]) > int(m):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
N,M = map(int, input().split())
A = list(map(float, input().split()))
sum_A = sum(A)
cout = 0
flag = False
for i in range(N):
  if A[i] >= sum_A / (4 * M):
    cout += 1
    if cout > M:
      flag = True
      break
      
if flag:
  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)
cnt = 0
x = sum(A)//(4 * m)
for a in A:
    if a > x:
        cnt += 1
if cnt < m:
    print('No')
else:
    print('Yes')

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+1:
        print("No")
        exit()
print("Yes")

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 len(l) >= M:
    print("Yes")
else:
    print("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/M

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 = map(int, input().split())
A = list(map(int, input().split()))

count = 0
allpoint = 0

for i in A:
    allpoint += i

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

if  M > 0 and 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)
minimum = total / (4 * m)
choicable = list(map(lambda x:True if x>minimum else False,a))
print('Yes' if sum(choicable) >= m else '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])]):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
n,m = input().split(" ")
alist = input().split(" ")

n = int(n)
m = int(m)

sum = 0
for i in alist:
    sum += int(i)
l = sum * (1 / (4*m))
c = 0

for k in alist:
    if int(k) > l:
        c += 1

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

Submission status: Wrong Answer

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

ans1 = n%k

if ans1 > k-ans1:
  ans1 = k-ans1
print(ans1)

Submission status: Wrong Answer

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


th=int(sum(A)/(4*M))
#print("th="+ str(th))

A_th=[A_t for A_t in A if A_t>th]
if len(A_th)>=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()))
sorted_A = sorted(A, reverse=True) 
all_A = sum(A)

rule = (1/(4*M))

ans = 0

for i in A:
    if (i / all_A) > rule:
        ans = ans + 1
    else:
        pass

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

Submission status: Wrong Answer

Solution code:
n, m = map(int,input().split())
a = list(map(int,input().split()))
a.sort(reverse = True)
s = sum(a)
for i, l in enumerate(a):
    if l < s//(4*m):
        break
if i >= m-1:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

souwa = sum(A)

hyou = 1/(4*souwa)
ninki = 0

for number in A:
    if number > hyou:
      ninki = ninki + 1

if m == souwa:
     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()))
a.sort(reverse = True)
t = sum(a)
p = 0
for i in range(n):
  if a[i] >= t/(4*m):
    p += 1
  else:
    break

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

Submission status: Wrong Answer

Solution code:
def num():
    n,m=map(int,input().split())
    a=list(map(int,input().split()))
    a=sorted(a,reverse=True)
    for i in range(m):
        if a[i]<sum(a)/4*m:
            return "No"
    return "Yes"
print(num())

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 = []
if N<M:
    print("No")
else:
    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()))

ans = 0
sums = 0

for _ in range(N):
  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:

first_input = list(map(lambda x:int(x), input().split(" ")))
second_input = list(map(lambda x:int(x), input().split(" ")))

second_input.sort(reverse=True)
criteria = sum(second_input)/float(4*first_input[1])

for i in range(len(second_input)):
    if second_input[i]>=criteria:
        continue
    else:
        if i+1-1 >= first_input[1]:
            print("Yes")
        else:
            print("No")
        break

Submission status: Wrong Answer

Solution code:
n,m=map(int,input().split())
a=list(map(int,input().split()))
sum=0
for i in range(len(a)):
    sum=sum+a[i]
    
x= (sum)//(4*m)

l=[]
for j in range(len(a)):
    if(a[i]>=x):
        l.append(a[i])
        
if(len(l)>=m):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
n, m = map(int, input().split())
alis = list(map(int, input().split()))
func = lambda x : x > (sum(alis)/(4*m))
anslis = list(map(func, alis))
if anslis.count(True) >= 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 A:
    if (1/(M*4))-(i/S) < 0:
        c+=1
print("Yes" if M<=c else "No")

Submission status: Wrong Answer

Solution code:
n,m=map(int,input().split())
A=list(map(int,input().split()))
A.sort()
B=A[::-1]
if B[m-1]>sum(A)//(4*m):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-

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

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

s = sum(an)

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

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

Submission status: Wrong Answer

Solution code:
N,M=map(int, input().split())
Alist = list(map(int, input().split()))
Alist.sort(reverse=True)
sumnation = sum(Alist)
bordernum = sumnation / (4*M)
for i in Alist[:M]:
    judlist = []
    temp = True if i >= bordernum else False
    judlist.append(temp)
    judged =  all(judlist)
if judged:
    print('yes')
else :
    print('no')

Submission status: Wrong Answer

Solution code:
from bisect import bisect

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

#print(M)
A.sort()
#print(A)

limit = sum(A)/(4*M)
#print(limit)

n = bisect(A, limit)
#print(N-n-1)
if N-n-1 >= 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()))

for voted in a_list:
    if voted >=1/4*M:
        print("Yes")
        break
else:
    print("No")

Submission status: Wrong Answer

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

t = 0
for i in range(n):
  t += int(alist[i])
lm = t/(m*4)
s = 0
for i in range(n):
  a = int(alist[i])
  if a > lm:
    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()))
TOTAL = 0
for i in range(len(A)):
    TOTAL += A[i]
if A[-1] <= (1/(4*M))*TOTAL:
    print("No")
else:
    print("Yes")

Submission status: Wrong Answer

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



temp=4*m
temp=suml/temp

flag=False

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

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)
B = A[0:M]
C = B[-1]
Sum =  sum(A)
if C >Sum /(4*M):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

line = sum(A) // (4 * M)
ans = [i for i in A if i >= line]
print("Yes") if len(ans) >= M 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)

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

Submission status: Wrong Answer

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

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 = input().split()
list_a = [int(n) for n in A]
count = 0

waru = 4 * M
SUM = sum(list_a)
vote = SUM / waru

for i in range(0, N):
    if list_a[i] > vote:
        count += 1
    else:
        pass

print(count)

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

Submission status: Wrong Answer

Solution code:
line1 = input().rstrip().split(" ")
N = int(line1[0])
M = int(line1[1])
allvote = 0
ok = 0

line = input().rstrip().split(" ")
for i in range(N):
    get = int(line[i])
    allvote += get
# print(str(allvote))
worse = int(1 / (4 * M) * allvote)
# print(str(worse))

for j in range(N):
    get = int(line[j])
    if get < worse:
        pass
    else:
        ok += 1
        
# print(str(ok))

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
m,n=map(int,input().split())
a=sorted(list(map(int,input().split())))
s=0
aa=a
for j in range(n):
  s+=a[j]
for i in range(n):
  if a[n-i-1] < s/(4*m):
    if i!=0:
      aa=a[n-i:]
      break
    else:
      aa=[]
      break
if len(aa) >= m:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

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

sortedA = sorted(A, reverse=True)

AA = sum(A)
de = AA/(4*M)
picA = sortedA[0:M]


if (picA[-1] <= de):
  print("No")
  
else:
  print("Yes")

Submission status: Wrong Answer

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

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

list.sort(a, reverse=True)

ans = "No"

if a[m-1] > 4*m :
  ans = "Yes"
print (ans)

Submission status: Wrong Answer

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

b = 0
for i in A:
    if i > jud:
        b = b+1
if b > M:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

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

t = 0
for i in range(n):
  t += int(alist[i])
lm = t/(m*4)
print(lm)
s = 0
for i in range(n):
  a = int(alist[i])
  if a > lm:
    s+=1

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

Submission status: Wrong Answer

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

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


def solve(N: int, M: int, A: "List[int]"):
    A.sort(reverse=True)
    a=sum(A)
    count=0
    for i in range(M):
        if A[i]>a/(4*M):
            count+=1
    if count<M:
        print(NO)
    else:
        print(YES)
    return


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
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()))

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

Submission status: Wrong Answer

Solution code:
N, M = (int(x) for x in input().split())
A = list(map(int, input().strip().split()))
A.sort(reverse=True)

for m in range(M):
    s = sum(A)
    if A[m] > s / (4 * M):
        a = True
    else:
        a = False

if a == True:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
import math

n,m = 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(m):
    if s[i] < math.ceil(votes/(4*m)):
        print("No")
        exit()
 
print("Yes")

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-

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

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

s = sum(an)

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

flg = True

for num in list(range(M)):
    if a[num] < sum(a) * (1 / (4 * M)):
        flg = False
        break
    if num + 1 == N:
        break

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

Submission status: Wrong Answer

Solution code:
import math

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

cond = math.floor(sum(AS) / (4 * M))
AS = sorted(AS, reverse=True)

origin = AS[0:M]
result = list(filter(lambda a: a >= cond, origin))

if origin == result:
    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)
print(total,th)

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:
import sys
N,M = map(int, input().split())
A = list(map(int, input().split()))
sorted_A = sorted(A, reverse=True) 
all_A = sum(A)

rule = (1/(4*M))

ans = 0

for i in sorted_A:
    if (i / all_A) > rule:
        ans = ans + 1
    else:
        pass

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

Submission status: Wrong Answer

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

t = 0
check=False
if(1<=m<=n<100):
  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()))
su = sum(A)
A.sort(reverse=True)

cnt = 0
for i in A:
  if (i >= int(su / 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 = 0
allpoint = 0

for i in A:
    allpoint += i

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

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

Submission status: Wrong Answer

Solution code:
from sys import stdin

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

# print(N, M, A)
A.sort()
if sum(A) % (4*M):
    b = sum(A)//(4*M)
else:
    b = sum(A)//(4*M)+1
# print(b,A,A[N-1-M-1])
if A[N-1-(M-1)] >= b:
    print("Yes")
else:
    print("No")
# print(A)

Submission status: Wrong Answer

Solution code:
species, num = [int(i) for i in input().split()]
votes = [int(i) for i in input().split()]

sum_vote = sum(votes)
min_rate = sum_vote / 4 / species
votes.sort(reverse=True)

ans = 'Yes' if votes[num - 1] >= min_rate else 'No'

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(N):
  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')
  
print(sums)

Submission status: Wrong Answer

Solution code:
N, M, *A = map(int, open(0).read().split())
print(sum(A))
vote = sum(A) / (4*M)
num = list(filter(lambda x: x > vote, A))
num = len(num)
if num >= M:
	print("Yes")
else:
	print("No")

Submission status: Wrong Answer

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


if (sum(List)-max(List))>sum(List)*(1/4*m):
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:

first_input = list(map(lambda x:int(x), input().split(" ")))
second_input = list(map(lambda x:int(x), input().split(" ")))

second_input.sort(reverse=True)
criteria = sum(second_input)/4.0/first_input[1]

for i in range(len(second_input)):
    if second_input[i]>=criteria:
        continue
    else:
        if i+1-1 >= first_input[1]:
            print("Yes")
        else:
            print("No")
        break

Submission status: Wrong Answer

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

ans = 'Yes' if float(A[M-1]) >= (sum(A) / 4.0*M ) else 'No'
print(ans)

Submission status: Wrong Answer

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

all_num = sum(a_list) // (4 * m)
count = 0
flag = False
for i in range(n):
    a = a_list[i]
    if a >= all_num:
        count += 1
    if count == m:
        flag = True
        break

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()))
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 = input().split()
a_sum = 0
for i in range(len(a_list)):
    a_list[i] = int(a_list[i])
    a_sum += a_list[i]
a_list.reverse()

ok_num = 0
kijyun = int(a_sum/(4*m))
for i in a_list:
    if i > kijyun:
        ok_num += 1
    if ok_num >= m:
        print('Yes')
        quit()
print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N, M = map(int, input().split())
lists = list(map(int, input().split()))
# print(lists)
sigma_A = sum(lists)
val = 1/(4 * M) * sigma_A

count = 0
for i in range(M):
    if max(lists) > val:
        count += 1
        lists.remove(max(lists))
# print(lists)

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()))
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:
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] >= sum_A // (4 * M):
    cout += 1
    if cout > M:
      flag = True
      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()))
n_votes = sum(A)
print('Yes' if sum(map(lambda x: 4 * M * x > n_votes, A)) >= M
            else 'No')

Submission status: Wrong Answer

Solution code:
#coding:utf-8
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()))
sou = 0
for i in a:
    sou += i
line = sou//(4*m)
count = 0
for i in a:
    if i > line:
        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()))
S = sum(A)
ans = [i for i in A if i > S / (4*M)] 
if len(ans) > M:
    print('Yes')
else:
    print('No')