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

all_vote = sum(A)
minimum = all_vote/(4*M)
count = 0
for i in A:
  if i >= minimum:
    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())

all_vote = sum(A)
minimum = all_vote//(4*M)
count = 0
for i in A:
  if i >= minimum:
    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())

all_vote = sum(A)
minimum = all_vote//(4*M)
count = 0
for i in A:
  if i > minimum:
    count += 1
if count >= M:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
NM = input()
arr=input()

nmi=NM.split(" ")
n=int(nmi[0])
m=int(nmi[1])
listike=arr.split(" ")
listike = list(map(int, listike))

def partition(arr,low,high): 
    i = ( low-1 )         # index of smaller element 
    pivot = arr[high]     
  
    for j in range(low , high): 
        if   arr[j] <= pivot: 
            i = i+1 
            arr[i],arr[j] = arr[j],arr[i] 
  
    arr[i+1],arr[high] = arr[high],arr[i+1] 
    return ( i+1 ) 
   
def quickSort(arr,low,high): 
    if low < high: 
  
        pi = partition(arr,low,high) 
  
        quickSort(arr, low, pi-1) 
        quickSort(arr, pi+1, high) 
      
quickSort(listike,0,n-1)
vajalik = listike[n-m: n-1]

if listike[n-m]>=(sum(listike)/(4*m)):
  print('yes')
else:
  print('no')

Submission status: Wrong Answer

Solution code:
NM = input()
arr=input()

nmi=NM.split(" ")
n=int(nmi[0])
m=int(nmi[1])
listike=arr.split(" ")
listike = list(map(int, listike))

def partition(arr,low,high): 
    i = ( low-1 )         # index of smaller element 
    pivot = arr[high]     
  
    for j in range(low , high): 
        if   arr[j] <= pivot: 
            i = i+1 
            arr[i],arr[j] = arr[j],arr[i] 
  
    arr[i+1],arr[high] = arr[high],arr[i+1] 
    return ( i+1 ) 
   
def quickSort(arr,low,high): 
    if low < high: 
  
        pi = partition(arr,low,high) 
  
        quickSort(arr, low, pi-1) 
        quickSort(arr, pi+1, high) 
      
quickSort(listike,0,n-1)
vajalik = listike[n-m: n-1]

if listike[n-m]>=(sum(listike)/(4*m)):
  print("yes")
else:
  print("no")

Submission status: Wrong Answer

Solution code:
NM = input()
arr=input()

nmi=NM.split(" ")
n=int(nmi[0])
m=int(nmi[1])
listike=arr.split(" ")
listike = list(map(int, listike))

def partition(arr,low,high): 
    i = ( low-1 )         # index of smaller element 
    pivot = arr[high]     
  
    for j in range(low , high): 
        if   arr[j] <= pivot: 
            i = i+1 
            arr[i],arr[j] = arr[j],arr[i] 
  
    arr[i+1],arr[high] = arr[high],arr[i+1] 
    return ( i+1 ) 
   
def quickSort(arr,low,high): 
    if low < high: 
  
        pi = partition(arr,low,high) 
  
        quickSort(arr, low, pi-1) 
        quickSort(arr, pi+1, high) 
      
quickSort(listike,0,n-1)
vajalik = listike[n-m: n-1]

if listike[n-m]>(sum(listike)/4*m):
  print('yes')
else:
  print('no')

Submission status: Wrong Answer

Solution code:
NM = input()
arr=input()

nmi=NM.split(" ")
n=int(nmi[0])
m=int(nmi[1])
listike=arr.split(" ")
listike = list(map(int, listike))

def partition(arr,low,high): 
    i = ( low-1 )         # index of smaller element 
    pivot = arr[high]     
  
    for j in range(low , high): 
        if   arr[j] <= pivot: 
            i = i+1 
            arr[i],arr[j] = arr[j],arr[i] 
  
    arr[i+1],arr[high] = arr[high],arr[i+1] 
    return ( i+1 ) 
   
def quickSort(arr,low,high): 
    if low < high: 
  
        pi = partition(arr,low,high) 
  
        quickSort(arr, low, pi-1) 
        quickSort(arr, pi+1, high) 
      
quickSort(listike,0,n-1)
vajalik = listike[n-m: n-1]

if listike[n-m]>(sum(listike)/4*m):
  print("yes")
else:
  print("no")

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

Solution code:
n,m = map(int,input().split())
num = list(map(int,input().split()))
limit = 1/(4*m)
count = 0
for i in range(n):
  if num[i] >= limit: 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()))
c =0
s = sum(A)
for x in range(M):
    if A[x] > s/(4*M):
        c+=1
if c >= M :
    print("Yes")
else: 
    print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N,M = map(int,input().split())
m = 0
v = input().split()
for i in range(N): v[i] = int(v[i])
  
v.sort(reverse=True)
v_min = sum(v)/4/M
print(v_min)

while len(v):
  if v.pop(0) >= v_min:
    m += 1
  else:
    break

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

Submission status: Wrong Answer

Solution code:
n_m = input()
sp_n_m = n_m.split()
ai = input()
sp_ai = ai.split()
sum = 0

for num in sp_ai:
  sum += int(num)

th = sum / (4 * int(sp_n_m[1]))

cnt = 0
for num2 in sp_ai:
  if int(num2) > int(th):
    cnt+= 1

if cnt >= int(sp_n_m[1]):
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
n_m = input()
sp_n_m = n_m.split()
ai = input()
sp_ai = ai.split()
sum = 0

for num in sp_ai:
  sum += int(num)

th = sum / (4 * int(sp_n_m[1]))

cnt = 0
for num2 in sp_ai:
  if int(num2) > th:
    cnt+= 1

if cnt >= int(sp_n_m[1]):
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

count = 0
sumA = sum(A)
board = sumA // (4*NM[1])


# print(sumA)
# print(board)

for i in range(len(A)):
    if A[i] > board:
        count += 1
    else:
        continue


if count >= NM[1]:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

count = 0
sumA = sum(A)
board = sumA // (4*NM[1])


# print(sumA)
# print(board)

for i in range(len(A)):
    if A[i] > board:
        count += 1
    else:
        continue


if count > NM[1]:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

count = 0
sumA = sum(A)
board = sumA // (4*NM[1])


# print(sumA)
# print(board)

for i in range(len(A)):
    if A[i] >= board:
        count += 1
    else:
        continue


if count > NM[1]:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

count = 0
sumA = sum(A)
board = sumA // (4*NM[1])


print(sumA)
print(board)

for i in range(len(A)):
    if A[i] >= board:
        count += 1
    else:
        continue


if count > NM[1]:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

count = 0
sumA = sum(A)
board = sumA // (4*NM[1])


print(sumA)
print(board)

for i in range(len(A)):
    if A[i] > board:
        count += 1
    else:
        continue


if count >= NM[1]:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

count = 0
sumA = sum(A)
board = sumA // (4*NM[1])

# print(sumA)
# print(board)

for i in range(len(A)):
    if A[i] >= board:
        count+=1
    else:
        continue

if count >= NM[1]:
    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)

cnt = 0
for a in A:
	if a<=S/(4*M):
		cnt += 1

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

Submission status: Wrong Answer

Solution code:
def main():
  n, m = (int(x) for x in input().split())
  a_list = list(map(int, input().split()))
  sum_num = 0
  sum_num = sum(a_list)
  count = 0
  for i in a_list:
    if(i >= sum_num/(4 * m)):
      count += 1

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

if __name__ == '__main__':
  main()

Submission status: Wrong Answer

Solution code:
def main():
  n, m = (int(x) for x in input().split())
  a_list = list(map(int, input().split()))
  sum_num = 0
  sum_num = sum(a_list)
  count = 0
  for i in a_list:
    if(i >= sum_num/4):
      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()))
sumVal = sum(A) // 4 // M

ansCnt = 0
for i in A:
    if i >= sumVal:
        ansCnt += 1

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

Submission status: Wrong Answer

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

ansCnt = 0
for i in A:
    if i > sumVal:
        ansCnt += 1

if ansCnt >= 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()
if a[-m+1]<(sum(a)/(4*m)):
    print("No")
else:
    print("Yes")

Submission status: Wrong Answer

Solution code:
def main():
    N, M = map(int, input().split())
    A = list(map(int, input().split()))
    sum_A = sum(A)
    border = (1 / 4 * M) * sum_A
    count = 0
    for a in A:
        if a < border:continue
        count += 1
        if count == M:
            print("Yes")
            exit(0)
    print("No")


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
l = input()
m = input()
z = l.split(" ")
M = int(z[1])
F = m.split(" ")
X = []
amount=0
for item in F:
  votes = int(item)
  amount = amount + votes
  X.append(votes)
X.sort(reverse=True)
C = (1/4*M)*amount
if X[M-1]<C:
  print("No")
else:
  print("Yes")

Submission status: Wrong Answer

Solution code:
l = input()
m = input()
z = l.split(' ')
M = int(z[1])
N = int(z[0])
F = m.split(' ')
X = []
 
for item in F:
  votes = int(item)
  X.append(votes)
print("Yes")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
l = input()
m = input()
z = l.split(' ')
M = int(z[1])
N = int(z[0])
C = (N/(4*M))
F = m.split(' ')
X = []
count = 0
i = 0
while i < N:
  vote = int(F[i])
  i += 1
  if vote>=C:
    count += 1

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

Submission status: Wrong Answer

Solution code:
l = input()
m = input()
z = l.split(' ')
M = int(z[1])
N = int(z[0])
C = (N/(4*M))
F = m.split(' ')
X = []
count = 0
i = 0
while i < N:
  vote = int(F[i])
  i += 1
  if vote>=C:
    count += 1

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

Submission status: Wrong Answer

Solution code:
l = input()
m = input()
z = l.split(' ')
M = int(z[1])
N = int(z[0])
C = (N/(4*M))
F = m.split(' ')
print("Yes")
X = []
for item in F:
  votes = int(item)
  X.append(votes)

X.sort(reverse=True)

Submission status: Wrong Answer

Solution code:
l = input()
m = input()
z = l.split(' ')
M = int(z[1])
N = int(z[0])
C = (N/(4*M))
F = m.split(' ')
print("Yes")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

counter = 0

for i in an:
  if i >= 1/(4*m):
    counter += 1
    
if counter >= m:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

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

counter = 0

for i in an:
  if i >= 1/4*m:
    counter += 1
    
if counter >= m:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

print(A[M-1])

result = 'No' if A[M-1] < sum(A) / (4 * M) else 'Yes'
print(result)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n, m= input().split()
n, m= int(n), int(m)
eq=0
soma=0
cont=0
lista=[]
for x in input().split():
	x= int(x)
	lista.append(x)
	soma+=x

eq= soma/4*m
for x in range(n):
	if lista[x] >= eq:
		cont+=1


if cont < m:
	print('No')
else:
	print('Yes')

Submission status: Wrong Answer

Solution code:
# coding: utf-8
DATA = """
12 3
4 56 78 901 2 345 67 890 123 45 6 789
""".split("\n")

def get_debug_line():
	for i in DATA:
		yield i

if 1:
	get_line = input
else:
	get_line = get_debug_line().__next__
	get_line()

N, M = [int(i) for i in get_line().strip().split(" ")]
A = [int(i) for i in get_line().strip().split(" ")]
total = sum(A) / (4 * M)

count = 0
for v in A:
	if v > total:
		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)
if a[m-1] < s/(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()))
a.sort(reverse=True)
s = sum(a)
if a[m-1] > s//(4*m)+0.5:
  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)
if a[m-1] >= s//(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()))
a.sort(reverse=True)
s = sum(a)
if a[m-1] <= s//(4*m):
  print("No")
else:
  print("Yes")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N,M=map(int,input().split())
As=[i for i in range(N)]
if max(As)<(1/4*M):
    print("No")
else:
    print("Yes")

Submission status: Wrong Answer

Solution code:
import sys 
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)*1//(4*M):
       # print(A[i])
        print('No')
        sys.exit()
print('Yes')

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] * 4 * M >= 1:
        count += 1

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

else:
    print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
num = []
vote = []
num = list(map(int,input().split()))
vote = list(map(int,input().split()))
N = num[0]
M = num[1]
j = int(sum(vote)/(4*M))
#print(j)

cnt = 0
for i in vote:
    if  i>=j:
        cnt += 1
    
if M<=cnt:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
num = []
vote = []
num = list(map(int,input().split()))
vote = list(map(int,input().split()))
N = num[0]
M = num[1]
j = int(sum(vote)/(4*M))
#print(j)

cnt = 0
for i in vote:
    if  i>=j:
        cnt += 1
    else:
        pass
#print(cnt)
if M<=cnt:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
num = []
vote = []
num = list(map(int,input().split()))
vote = list(map(int,input().split()))
N = num[0]
M = num[1]
j = int(sum(vote)/(4*M))
#print(j)

cnt = 0
for i in range(0,len(vote)):
    if  vote[i]>=j:
        cnt += 1
    else:
        pass
#print(cnt)
if M<=cnt:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
num = []
vote = []
num = list(map(int,input().split()))
vote = list(map(int,input().split()))
N = num[0]
M = num[1]
j = sum(vote)/(4*M)
print(j)

cnt = 0
for i in range(0,len(vote)):
    if  vote[i]>=j:
        cnt += 1
    else:
        pass
if M<=cnt:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
import math
import sys
N,M=map(int,input().split())
A=list(map(int,input().split()))
S=sum(A)
cnt=0
for i in range(N):
    if A[i] > 1/4/M*S:
        cnt+=1
if cnt>=M:
    print("Yes")
else:
    print("No")
#print(cnt)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
num = []
vote = []
num = list(map(int,input().split()))
vote = list(map(int,input().split()))
N = num[0]
M = num[1]
j = 0
j /= 4*M
cnt = 0
for i in range(0,len(vote)):
    if  vote[i]>=j:
        cnt += 1
    else:
        pass
if M<=cnt:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
num = []
vote = []
num = list(map(int,input().split()))
vote = list(map(int,input().split()))
N = num[0]
M = num[1]
j = 0
j /= 4*M
cnt = 0
for i in range(0,len(vote)-1):
    if  vote[i]>=j:
        cnt += 1
    else:
        pass
if M<=cnt:
    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
ans = 0
for i in range(N):
  sum += A[i]
print(sum)
for i in range(N):
  if A[i] >= sum*(1/(4*M)):
    ans += 1
print("Yes" if ans >= M else "No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if min(a)>n/4*m:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

count = 0
for a in A:
     if a >= 1 / 4*M:
         count += 1

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

Submission status: Wrong Answer

Solution code:
n = input().split(' ')
N = int(n[0])
M = int(n[1])
vote = input().split(' ')

vote_n = 0
for i in vote:
    vote_n += int(i)

ans = []
for j,k in zip(range(M),vote):
    if int(max(map(int,vote))) >= vote_n/(4*M):
        ans.append(max(map(int,vote)))
        vote.remove(str(max(map(int,vote))))

if int(len(ans)) >= M:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
n = input().split(' ')
N = int(n[0])
M = int(n[1])
vote = input().split(' ')

vote_n = 0
for i in vote:
    vote_n += int(i)

ans = []
for j,k in zip(range(M),vote):
    if int(max(map(int,vote))) >= vote_n/(4*M):
        ans.append(max(map(int,vote)))
        vote.remove(str(max(map(int,vote))))

print(ans)
if int(len(ans)) >= M:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
n,m = map(int, input().split())
nums = [int(i) for i in input().split()]
tot = 0
for i in nums:
  tot+= i
cons = m/(4*tot)
count = 0
for i in nums:
  if i>= cons:
    count+=1
if count>= m:
  print('Yes')
else:
  print("No")

Submission status: Wrong Answer

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

n, m = map(int, input().split())
A = list(map(int, input().split()))
sm = sum(A)
cnt = 0
for a in A:
    if 4 * m * a > sm:
        cnt += 1
can = "Yes" if cnt >= m else "No"
print(can)

Submission status: Wrong Answer

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

over=[]
for i in A:
    if i>=cutoff:
        over.append(i)

if len(over)>=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)
cutoff = total/(4*N)

over=[]
for i in A:
    if i>=cutoff:
        over.append(i)

if len(over)>=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)
cutoff = total/N

over=[]
for i in A:
    if i>=cutoff:
        over.append(i)

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

Submission status: Wrong Answer

Solution code:
data = input().split()

n = int(data[0])
m = int(data[1])

pro = [int(s) for s in input().split()]

vote = 0
for i in pro:
  vote += i

s_pro = sorted(pro, reverse=True)

if s_pro[m - 1] < 1 / (4 * vote):
  print("No")
else:
  print("Yes")

Submission status: Wrong Answer

Solution code:
data = input().split()

n = int(data[0])
m = int(data[1])

pro = [int(s) for s in input().split()]

vote = 0
for i in pro:
  vote += i

if pro[m - 1] < 1 / (4 * vote):
  print("No")
else:
  print("Yes")

Submission status: Wrong Answer

Solution code:
#!/usr/bin/python3

import sys
# input = sys.stdin.readline
sys.setrecursionlimit(100000)
INF = float('inf')
MOD = 10**9+7
EPS = 10**-7

#N = int(input())
#A = [int(x) for x in input().split()]
#V = [[0] * 100 for _ in range(100)]

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

s = sum(A)
cnt = 0
for a in A:
    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())
a=list(map(int,input().split()))

s=sum(a)

l=int(s/(4*m))

# print(a,s,l)
a.sort(reverse=True)
if(a[m-1]>=l):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
n,m = map(int, input().split())
box = list(map(int, input().split()))
if sum(box)/4/m > max(box):
  print("No")
else:
  print("Yes")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n,m = map(int,input().split())
lis = list(map(int,input().split()))
lis.sort()
t = sum(lis)
c=0
condition = 1/(4*m)
cost = t*condition
for i in range(len(lis)):
  if(lis[i]>cost):
    c+=1
if(c>=m):
  print("YES")
else:
  print("NO")

Submission status: Wrong Answer

Solution code:
n,m = map(int,input().split())
lis = list(map(int,input().split()))
lis.sort()
t = sum(lis)
c=0
condition = 1/(2*m)
cost = t*condition
for i in range(len(lis)):
  if(lis[i]>cost):
    c+=1
if(c>=m):
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
n,m = map(int,input().split())
lis = list(map(int,input().split()))
lis.sort()
t = sum(lis)
c=0
for i in range(len(lis)):
  if(lis[i]>(1/(2*m))):
    c+=1
if(c>=m):
  print("YES")
else:
  print("NO")

Submission status: Wrong Answer

Solution code:
n,m = map(int,input().split())
lis = list(map(int,input().split()))
lis.sort()
t = sum(lis)
c=0
for i in range(len(lis)):
  if(lis[i]>(1/(2*m))):
    c+=1
  else:
    break
if(c==m):
  print("YES")
else:
  print("NO")

Submission status: Wrong Answer

Solution code:
n,m = map(int,input().split())
lis = list(map(int,input().split()))
lis.sort()
t = sum(lis)
c=0
for i in range(m):
  if(lis[i]>(1/(2*m))):
    c+=1
  else:
    break
if(c==m):
  print("YES")
else:
  print("NO")

Submission status: Wrong Answer

Solution code:
n,m=map(int,input().split())
l=[int(i) for  i in input().split()]
x=sum(l)//(4*m)
for i in l:
  if i>=x:
    m-=1
    if m<1:
      print("Yes")
      break
else:
  print("No")

Submission status: Wrong Answer

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

sumBy4 = sumA/(4*m)

count = 0

for i in range(n):
    if(a[i] < sumBy4):
        continue

    else:
        count += 1

if(count == 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()))
sumA = sum(a)

sumBy4 = sumA/(4*m)

count = 0

for i in range(n):
    if(a[i] < sumBy4):
        continue

    else:
        count += 1

if(count == m):
    print("YES")

else:
    print("NO")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

sumBy4 = sumA/(4*m)

count = 0

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

if(count >= 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()))
sumA = sum(a)

sumBy4 = sumA/(4*m)

count = 0

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

if(count > 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()))
sumA = sum(a)

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

count = 0

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

if(count >= m):
    print("YES")

else:
    print("NO")

Submission status: Wrong Answer

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

arr.sort()
sum_arr = sum(arr)
flag = True

for i in range(m):
    if arr[i] < (sum_arr/(4*m)):
        flag = False
        break
if flag:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
import numpy as np
n_m = [int(i) for i in input().split()]
ai = np.array([int(i) for i in input().split()])
n = n_m[0]
m = n_m[1]
asum = ai.sum()
thread = asum / (4 * asum)
real_m = 0
for a in ai:
  if a < thread:
    continue
  else:
    real_m += 1
print("No") if real_m < m else print("Yes")

Submission status: Wrong Answer

Solution code:
import numpy as np
n_m = [int(i) for i in input().split()]
ai = np.array([int(i) for i in input().split()])
n = n_m[0]
m = n_m[1]
asum = ai.sum()
thread = asum / (4 * asum)
real_m = 0
for a in ai:
  if a < thread:
    continue
  else:
    real_m += 1
print("Yes") if real_m > m 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 >= (1/(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()))
cnt = 0
 
for i in a:
  if i >= (1/4*m):
    cnt += 1

if cnt < m or n < m:
  print("No")
else:
  print("Yes")

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 >= (1/4*m):
    cnt += 1

if cnt < m:
  print("No")
else:
  print("Yes")

Submission status: Wrong Answer

Solution code:
n, m = map(int, input().split())
a = list(map(int, input().split()))
cnt = 0
 
if sum(a) < (1/(4*m)) or n < m:
  print("No")
else:
  print("Yes")

Submission status: Wrong Answer

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

limit = sum(a)/(4*m)
canselect = True
for ae in a:
    if ae < limit:
        canselect = False

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