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 = list(map(int, input().split()))
A = list(map(int, input().split()))
count = N
for a in A:
  if a < N / (4 * M):
    count -= 1
if count < sum(A):
  print('No')
else:
  print('Yes')

Submission status: Wrong Answer

Solution code:
N, M = list(map(int, input().split()))
A = list(map(int, input().split()))
count = N
for a in A:
  if a < N / (4 * M):
    count -= 1
if count < M:
  print('No')
else:
  print('Yes')

Submission status: Wrong Answer

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

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

c=0
for i in range(M):
    if A[i]<sum(A)*(1/4*M):c+=0
    else:c+=1
if c==0:print('Yes')
else:print('No')

Submission status: Wrong Answer

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

c=0
for i in range(M):
    if A[i]<sum(A)*(1/4*M):c+=0
    else:c+=1
if c==0: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)
t = sum(A)
if t/(4*M) <= A[M-1]:
    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)
t = sum(A)
if (1/(4*M))*t <= A[M-1]:
    print("YES")
else:
    print("NO")

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
N, M = map(int, input().split())
A = list(map(int, input().split()))
cnt = 0
for Ai in A:
    if (sum(A))*(1/(4*M)) <= Ai:
        cnt += 1
if cnt == M:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
N, M = map(int, input().split())
A = list(map(int, input().split()))
cnt = 0
for Ai in range(len(A)):
    if (sum(A))*(1/(4*M)) <= Ai:
        cnt += 1
if cnt >= M:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
N, M = map(int, input().split())
A = list(map(int, input().split()))
cnt = 0
for Ai in range(len(A)):
    if 1/(4*M) <= Ai:
        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()))
k=sum(a)
r=1/4*m
c=0
count=0
for i in range(n):
    
    if a[i]/k>=r:
        count+=1
    if count>=m:
        c=1
        print("Yes")
        break
if c==0:
  print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

total_vote = sum(a)

popular = [p for p in a if p*4 >= total_vote]

if len(popular) >= 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()]

total_vote = sum(a)

popular = [p for p in a if p >= total_vote/4]

if len(popular) >= 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()]

total_vote = sum(a)

popular = [p for p in a if p >= total_vote/4]

if len(popular) >= 2:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
n, m = [int(x) for x in input().split(' ')]
ns = sorted([int(x) for x in input().split(' ')], reverse=True)
total = sum(ns)
for i in range(m):
  if ns[i] < int(total * (1 / (4 * m))):
    print('No')
    break
else:
  print('Yes')

Submission status: Wrong Answer

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

l = list(x for x in a if x >= (sum(a)/4*m))

print("Yes" if len(l) >= m else "No")

Submission status: Wrong Answer

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

a.sort(reverse=True)

thold = sum(a) // (4 * m)

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

Submission status: Wrong Answer

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

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

count = 0
for i in vote_list:
  if i > border:
    count += 1

if count >= m:
  print("yes")
else:
  print("no")

Submission status: Wrong Answer

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

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

count = 0
for i in vote_list:
  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(" "))
MER = list(map(int,input().split(" ")))
mer_sum = sum(MER)

threshold = mer_sum / (4 * M)
mer_over = [1 if i < threshold else 0 for i in MER]
mer_threshold = sum(mer_over)

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

Submission status: Wrong Answer

Solution code:
N,M = map(int,input().split(" "))
MER = map(int,input().split(" "))
mer_sum = sum(MER)
 
threshold = mer_sum / (4 * M)
mer_over = [1 if i >= threshold else 0 for i in MER]
mer_threshold = sum(mer_over)
 
if N <= mer_threshold:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
N,M = map(int,input().split(" "))
MER = map(int,input().split(" "))
mer_sum = sum(MER)

threshold = mer_sum / (4 * M)
mer_over = [1 if i < threshold else 0 for i in MER]
mer_threshold = sum(mer_over)

if N <= mer_threshold:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
val1= input()
val2= input()
num1= list(map(int,val1.split()))
num2= list(map(int,val2.split()))
n= num1[0]
m= num1[1]
sumup=0;
for i in range(0,n):
    sumup= sumup+ num2[i]

border= sumup/ (4* m)
judge=0
for j in range(0,n):
    if num2[j] > border:
        judge= judge + 1
if judge >= 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)

thold = sum(a) / (4 * m)

try:
    if a[m] < thold:
        print('No')
    else:
        print('Yes')
except:
    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:
  print('No')
else:
  print('Yes')

Submission status: Wrong Answer

Solution code:
n, m=map(int, input().split())
a = input().split()
point = [int(s) for s in a]
point.sort(reverse=True)
if sum(point)/(4*m) < point[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()))
 
sum_A =0
for i in range(N):
    sum_A += A[i]

ans = 0
for i in range(N):
    if (4*M*A[i] > sum_A):
        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 =0
for i in range(N):
    sum_A += A[i]

ans = 0
for i in range(N):
    if (4*M*A[i] < sum_A):
        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()))




total = sum(A)
A.sort(reverse = True)
print(A)

judge = True

for i in range(m):
    if (total / (4*m)) < A[i]:
        continue
    else:
        judge = not judge
        break

if judge:
    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(N):
    sum_A += A[i]

ans = 1
for i in range(N):
    if (4*M*A[i] > sum_A):
        ans= ans*1
    else:
    	ans =ans*0
    	
if (ans != 0):
    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)
A.sort(reverse = True)
print(A)

judge = True

for i in range(m):
    if (total / (4*m)) < A[i]:
        continue
    else:
        judge = not judge

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

Submission status: Wrong Answer

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

d = int((1/(4*m)) * sum(a))
count=0

for x in a:
    if x<d:
        count+=1

if count>m:
    print("No")
    
else:
    print("yes")

Submission status: Wrong Answer

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

d = int((1/(4*m)) * sum(a))
count=0

for x in a:
    if x<d:
        count+=1

if count<m:
    print("No")
    
else:
    print("yes")

Submission status: Wrong Answer

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

d = int((1/(4*m)) * sum(a))
count=0
print(d)
for x in a:
    if x<d:
        count+=1

if count<m:
    print("No")
    
else:
    print("yes")

Submission status: Wrong Answer

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

d = int((1/(4*m)) * sum(a))
count=0
print(d)
for x in a:
    if x<d:
        count+=1

if (n-count)>=m:
    print("No")
    
else:
    print("yes")

Submission status: Wrong Answer

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

d = int((1/(4*m)) * sum(a))
count=0
print(d)
for x in a:
    if x<d:
        count+=1

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

Submission status: Wrong Answer

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

d = int((1/(4*m)) * sum(a))
count=0
for x in a:
    if x>=d:
        count+=1

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

Submission status: Wrong Answer

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

if sorted(hoge)[-M] > sum(hoge)/(4*M):
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7
 
N, M  = MAP()
A = LIST()
sum_A = sum(A)
c = 0
 
for i in range(N):
  if A[i] > sum_A/4/M:
    c = c+1
      
if c >= M:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N, M  = MAP()
A = LIST()
sum_A = sum(A)
c = 0

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!
N, M = list(map(int, input().split()))
a = list(map(int, input().split()))

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

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

Submission status: Wrong Answer

Solution code:
from sys import stdin
N,M=list(map(int,(stdin.readline().strip().split())))
A=list(map(int,(stdin.readline().strip().split())))
hyou=sum(A)/(4*M)
count=0
for i in range(N):
    if (A[i])<hyou:continue
    count+=1
if count>=M:print("yes")
else:print("no")

Submission status: Wrong Answer

Solution code:
from sys import stdin
N,M=list(map(int,(stdin.readline().strip().split())))
A=list(map(int,(stdin.readline().strip().split())))
hyou=sum(A)/(4*M)
count=0
for i in range(N):
    if float(A[i])>=hyou:count+=1
if count>=M:print("yes")
else:print("no")

Submission status: Wrong Answer

Solution code:
from sys import stdin
N,M=list(map(int,(stdin.readline().strip().split())))
A=list(map(int,(stdin.readline().strip().split())))
hyou=sum(A)/(4*M)
count=0
for i in range(N):
    if A[i]>=hyou:count+=1
if count>=M:print("yes")
else:print("no")

Submission status: Wrong Answer

Solution code:
from sys import stdin
N,M=list(map(int,(stdin.readline().strip().split())))
A=list(map(int,(stdin.readline().strip().split())))
hyou=int(sum(A)/(4*M))
count=0
for i in range(N):
    if A[i]>hyou:count+=1
if count>=M:print("yes")
else:print("no")

Submission status: Wrong Answer

Solution code:
from sys import stdin
N,M=list(map(int,(stdin.readline().strip().split())))
A=list(map(int,(stdin.readline().strip().split())))
hyou=int(sum(A)/(4*M))
count=0
for i in range(N):
    if A[i]>=hyou:count+=1
if count==M:print("yes")
else:print("no")

Submission status: Wrong Answer

Solution code:
from sys import stdin
N,M=list(map(int,(stdin.readline().strip().split())))
A=list(map(int,(stdin.readline().strip().split())))
hyou=int(sum(A)/(4*M))
count=0
for i in range(N):
    if A[i]<hyou:count=count
    else:count+=1
if count>=M:print("yes")
else:print("no")

Submission status: Wrong Answer

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

A.sort(reverse=True)

T = (sum(A)//(4*M))
n = 0
for i in range(N):
    if A[i] < T:
        continue
    n += 1

if 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()))
 
sum_A =0
for i in range(N):
    sum_A += A[i]
 
ans = 1
for i in range(M):
    if (4*M*A[i] < sum_A):
        ans= ans*1
    else:
    	ans =ans*0
 
if (ans == 1):
    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(N):
    sum_A += A[i]
 
ans = 1
for i in range(N):
    if (4*M*A[i] > sum_A):
        ans= ans*1
    else:
    	ans =ans*0
 
if (ans != 0):
    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(N):
    sum_A += A[i]
 
ans = 1
for i in range(N):
    if (4*M*A[i] < sum_A):
    	ans =ans*0
    else:
        ans= ans*1
 
if (ans != 0):
    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(N):
    sum_A += A[i]
 
ans = 1
for i in range(N):
    if (4*M*A[i] < sum_A):
        ans= ans*1
    else:
    	ans =ans*0
 
if (ans != 0):
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n , m = list(map(int, input().split()))
ans = list(map(int, input().split()))
for i in ans:
    if(i < ((1/4*m)*sum(ans))):
        print("no")
        break
    else:
        print("Yes")
        break

Submission status: Wrong Answer

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

items = [int(i) for i in input().split()]
items.sort(reverse=True)
total = sum(items)

flag = 1
for i in range(M):
  if total / (4 * M) >= items[i]:
    pass
  else:
    flag = 0
if flag:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

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

items = [int(i) for i in input().split()]
items.sort(reverse=True)
total = sum(items)

flag = 1
for i in range(M):
  if total // (4 * M) >= items[i]:
    pass
  else:
    flag = 0
if flag:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

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

items = [int(i) for i in input().split()]
items.sort()
total = sum(items)

flag = 1
for i in range(M):
  if total // (4 * M) >= items[i]:
    pass
  else:
    flag = 0
if flag:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

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

items = [int(i) for i in input().split()]
items.sort()
total = sum(items)

flag = 1
for i in range(M):
  if 1 // (4 * M) >= items[i]:
    pass
  else:
    flag = 0
if flag:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

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

items = [int(i) for i in input().split()]
items.sort()
total = sum(items)

flag = 1
for i in range(M):
  if 1 // (4 * M) >= items[i]:
    pass
  else:
    flag = 0
if not flag:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
import sys
N, M = map(int, sys.stdin.readline().split())
A = list(map(int, sys.stdin.readline().split()))
sum_A = sum(A)

if max(A) >= sum_A / (4 * M):
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
# import inbuilt standard input output  
from sys import stdin, stdout  
  
# suppose a function called main() and 
# all the operations are performed 
def main(): 
  
    # input via readline method 
    info_input = stdin.readline() 
    vote_input = stdin.readline() 

    info = [int(x) for x in info_input.split()] 
    votes = [int(x) for x in vote_input.split()] 

    n = info[0]; m = info[1]; 

    counter = 0 
    bound = 1/(4*m)
    total = sum(votes)

    for vote in votes:
    	if vote > bound*total:
    		counter += 1
    		if counter == m:
    			return "Yes"
    return "No"

   
# call the main method 
if __name__ == "__main__": 
    print(main())

Submission status: Wrong Answer

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

i = list(map(int, input().split()))
a=[]
for x in range(n):
    a.append(i[x])
a.sort(reverse = True)
if a[m-1] >= 1/(4*m*sum(a)):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:

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

i = list(map(int, input().split()))
a=[]
for x in range(n):
    a.append(i[x])
a.sort(reverse = True)
if a[m-1] >= (1/4)*sum(a):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

i = list(map(int, input().split()))
a=[]
for x in range(n):
    a.append(i[x])
a.sort(reverse = True)
if a[m-1] >= (1/4)*m:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
def pickup(vote, choice):
	flag = 0
	for i in vote:
		if i >= 1 / choice * 4:
			continue
		else:
			flag = flag + 1
	if  choice >= int(len(vote)) - flag:
		return 0
	else:
		return 1

numbers, choice = list(map(int, input().split()))

vote = [numbers]
vote = list(map(int, input().split()))

if pickup(vote, choice) == 0:
	print("Yes")
else:
	print("No")

Submission status: Wrong Answer

Solution code:
def pickup(vote, choice):
	flag = 0
	for i in vote:
		if i >= 1 / choice * 4:
			continue
		else:
			flag = flag + 1
	if  choice >= len(vote) - flag:
		return 0
	else:
		return 1

numbers, choice = list(map(int, input().split()))

vote = [numbers]
vote = list(map(int, input().split()))

if pickup(vote, choice) == 0:
	print("Yes")
else:
	print("No")

Submission status: Wrong Answer

Solution code:
def pickup(vote, choice):
	flag = 0
	for i in vote:
		if i >= 1 / choice * 4:
			continue
		else:
			flag = flag + 1
	if  choice >= len(vote) - flag:
		return 1
	else:
		return 0

numbers, choice = list(map(int, input().split()))

vote = [numbers]
vote = list(map(int, input().split()))

if pickup(vote, choice) == 0:
	print("Yes")
else:
	print("No")

Submission status: Wrong Answer

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

i = list(map(int, input().split()))
a=[]
for x in range(n):
    a.append(i[x])
a.sort(reverse = True)
if a[m-1] >= 1/4*m:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

i = list(map(int, input().split()))
a=[]
for x in range(n):
    a.append(i[x])
a.sort()
if a[m-1] >= 1/4*m:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
import numpy as np

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

i = list(map(int, input().split()))
a=[]
for x in np.arange(n):
    a.append(i[x])
a.sort()
if a[m-1] > 1/4*m:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
n=input().split()
m=input().split()

N=n[0]
Nn=n[1]
l = 0
a = 0

for k in range(int(Nn)):
    a+=int(m[k])

for i in range(int(N)):
    if int(m[i])/(a/(int(Nn)*4)) >= 1:
        l+=1

if l >= int(Nn) :
    print("Yes")
else :
    print("No")

Submission status: Wrong Answer

Solution code:
n=input().split()
m=input().split()

N=n[0]
Nn=n[1]
l = 0

for i in range(int(N)):
    if int(m[i])/(int(Nn)*4) >= 1:
        l+=1

if l >= int(Nn) :
    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 i in range(n):
       if a[i]>=S//(4*m):
              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 i in range(n):
       if a[i]>S//(4*m):
        p+=1
if p>=m:
       print("Yes")
else:
       print("No")

Submission status: Wrong Answer

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


def main():
    import sys
    input = sys.stdin.readline

    n, m = map(int, input().split())
    a = list(map(int, input().split()))
    total = sum(a)
    limit = total // (4 * m)
    count = 0

    for ai in sorted(a, reverse=True):
        if ai >= limit:
            count += 1

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


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

a.sort()
cnt=0

if a[-m]>=m:
    print('YES')
else:
    print('NO')

Submission status: Wrong Answer

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

cnt=0

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

if cnt>=m:
    print('YES')
else:
    print('NO')

exit()

Submission status: Wrong Answer

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

cnt=0

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

if cnt>=m:
    print('YES')
else:
    print('NO')

Submission status: Wrong Answer

Solution code:
import numpy as np
N,M=map(int,input().split())
A=np.array(list(map(int,input().split())))
print('Yes' if sum(A>=sum(A)/(4*M))>M else 'No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n,m=map(int,input().split())
print("YNeos"[len([x for x in map(int,input().split()) if x>=1/4/m])<m::2])

Submission status: Wrong Answer

Solution code:
N,M=map(int,input().split())#整数を複数の変数に格納
A=list(map(int,input().split()))#リストに整数を格納

if sum(A) >= 1/(4*M):
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
n = [int(e) for e in input().split(" ")]
a = [int(e) for e in input().split(" ")]
c = 0
s = sum(a) / (4 * n[1])
for e_a in a:
    if s < e_a:
        c += 1
print("Yes" if n[1] <= c else "No")

Submission status: Wrong Answer

Solution code:
N, M = map(int, input().split())
A = list(map(int, input().split()))
for i in range(N-1):
  if A[i+1] > A[i]:
    a = A[i+1]
    A[i+1] = A[i]
    A[i] = a

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

if A[M-1] < float(S)/(4.0*float(M)):
  print("No")
else:
  print("Yes")

Submission status: Wrong Answer

Solution code:
N, M = map(int, input().split())
A = list(map(int, input().split()))
S = A[N-1]
for i in range(N-1):
  S += A[i]
  if A[i+1] > A[i]:
    a = A[i+1]
    A[i+1] = A[i]
    A[i] = a

if A[M-1] > float(S)/(4.0*float(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 = A[N-1]
for i in range(N-1):
  S += A[i]
  if A[i+1] < A[i]:
    a = A[i+1]
    A[i+1] = A[i]
    A[i] = a

if A[M-1] > float(S)/(4.0*float(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_sorted = sorted(A, reverse=True)
max_numbers = A_sorted[:M]
A_sum = sum(A)
print("sum:", sum(A))
for i in max_numbers:
    if i < A_sum / (4 * M):
        print("No")
        break
else:
    print("Yes")

Submission status: Wrong Answer

Solution code:
N, M = map(int, input().split())
A = list(map(int, input().split()))
for i in range(N-1):
  if A[i+1] < A[i]:
    a = A[i+1]
    A[i+1] = A[i]
    A[i] = a

if A[M-1] > 1.0/(4.0*float(M)):
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

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

votesum = sum(votes)
st = votesum // 4 * m
count = 0
for v in votes :
    if v >= st:
        count += 1
print("Yes" if count == m else "No")

Submission status: Wrong Answer

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

votesum = sum(votes)
st = votesum // 4 * m
count = 0
for v in votes :
    if v >= st:
        count += 1
print("Yes" if count >= m else "No")

Submission status: Wrong Answer

Solution code:
n,m = list(map(int,input().split()))
votes = [int(x) for x in input().split()]
votesum = sum(votes)
st = 1 // 4 * votesum
count = 0
for v in votes :
    if v >= st:
        count += 1
print("Yes" if count == m else "No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#B
n,m = map(int,input().split())
arr = list(map(int,input().split()))
s = sum(arr)
a = (s/(4*m))
arr.sort(reverse = True)
if arr[m-1] > a:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#B
n,m = map(int,input().split())
arr = list(map(int,input().split()))
c = 0
s = sum(arr)
a = (s//(4*m))
print(a)
for i in range(n):
    if arr[i]>a:
        c +=1
if c >= m:
    print('YES')
else:
    print('NO')

Submission status: Wrong Answer

Solution code:
N, M, *A = map(int,open(0).read().split())
border = sum(A) / (4 * M)
ans = 0
for i in A:
    if i > border:
        ans += 1
if ans >= M:
  	print("Yes")
else:
  	print("No")

Submission status: Wrong Answer

Solution code:
val1 = input().split()
val2 = input().split()
total = 0
for votes in val2:
  total += int(votes)
thres = total * 1/4 / int(val1[1]) 
i = 0
for votes in val2:
  if int(votes) >= thres:
    i += 1
if i >= int(val1[1]):
  print("yes")
else:
  print("no")

Submission status: Wrong Answer

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

MAX_VOTE_NUM = 1000

x = [-1] * MAX_VOTE_NUM
total_vote_num = 0
for i in range(n):
  x[a[i] - 1] = i
  total_vote_num += a[i]

  popular_num = 0
  for i in range(MAX_VOTE_NUM):
    index = MAX_VOTE_NUM - i - 1
    if x[index] != -1 and ((index + 1) * 4 * m) >= total_vote_num:
      popular_num += 1

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