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:
top=0
sum=0
asp=0
n,m=list(map(int,input().split()))
a=list(map(int,input().split()))

for i in range(n):
    sum=sum+int(a[i-1])
    if a[i-1]<a[i] or i==1:
        top=int(a[i-1])

asp=1-(1/(4*m))
if top>sum*asp:
    print("No")
else:
    print("Yes")

Submission status: Wrong Answer

Solution code:
N, M = map(int, input().split())
A = list(set((map(int, input().split()))))
tvote = sum(A)
nc =(1/ (4*M)) * tvote
vote = []
for Ai in A:
    if Ai > nc:
        vote.append(Ai)
if len(vote) >= 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()))
a_list.sort(reverse = True)
a_total = sum(a_list)
count = 0
for voted in a_list[:M]:
  if count == M:
      print("Yes")
      break
  if voted >= (1/(4*M))*a_total:
      count +=1
else:
    print("No")

Submission status: Wrong Answer

Solution code:
x,y= list(map(int, input().split()))
i = list(map(int, input().split()))
i.sort(reverse=True)
k=sum(i)
flag=0
for j in range(y):
    if i[j]>=k/(4*(j+1)):
        flag+=1
if flag>y:
    print("No")
else:
    print("Yes")

Submission status: Wrong Answer

Solution code:
x, y = map(int,input().split())
ls = list(map(int, input().split()))

ls.sort()
total = sum(ls)
Yes = 0
No = 0

for i in range(y-1):
  a = ls[x-i-1]
  b =  total * (1/(4*x))
  if a > b:
    Yes += 1
  else:
    No += 1
if Yes == y:
  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)
for i in range(n):
  for j in range(n-1, i, -1):
    if a[j] > a[j-1]:
      temp = a[j]
      a[j] = a[j-1]
      a[j-1] = temp
waru = total / (4 * m)
if a[m - 1] <= waru:
  print("No")
else:
  print("Yes")

Submission status: Wrong Answer

Solution code:
items,select = input().split()
x = [int(items) for x in input().split()]
for u in x:
    if 1 <= int(select) <= int(items) <= 1000 and (1 <= u <= 1000 for u in x):
        if u > (1 / (4 * int(select))*sum(x)):
            print("No")
            break
        else:
            print("Yes")
            break

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))
if a_sum % (4*m) == 0:
    kijyun -= 1
for i in a_list:
    if i > kijyun:
        ok_num += 1
    else:
        break
    if ok_num == m:
        print('Yes')
        quit()
print('No')

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
N, M = map(int, input().split())
A = list(map(int, input().split()))

A_sum = sum([A[i] for i in range(len(A))])
Flag = A_sum / (4 * M)

A_fav = [i for i in A if i > Flag]
if len(A_fav) > M:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
i1 = input()
i1 = i1.split()
types = int(i1[0])
select = int(i1[1])

i2 = input()
i2 = [int(n) for n in i2.split()]
i2.sort(reverse=True)

summary = sum(i2)
threshold = int(summary / (types * 4))

if i2[select-1] > threshold :
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
i1 = input()
i1 = i1.split()
types = int(i1[0])
select = int(i1[1])

i2 = input()
i2 = [int(n) for n in i2.split()]
i2.sort(reverse=True)

summary = sum(i2)
threshold = summary / int(types * 4)

if i2[select-1] > threshold :
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
N, M = map(int, input().split())
blist=list(map(int,input().split()))
cset = set(blist)
while 1:
    if len(cset)!=N:
        break
    count = 0
    for i in blist:
        count += i
    M = count/(4*M)
    flag = 0
    for i in blist:
        if i>M:
            flag += 1
    if flag>1:
        print('Yes')
    else:
        print('No')
    break

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))
if a_sum % (4*m) == 0:
    kijyun += 1
for i in a_list:
    if i > kijyun:
        ok_num += 1
    else:
        break
    if ok_num == m:
        print('Yes')
        quit()
print('No')

Submission status: Wrong Answer

Solution code:
x, y = map(int,input().split())
ls = list(map(int, input().split()))

ls.sort()
total = sum(ls)
Yes = 0
No = 0

for i in range(y):
  a = ls[x-i-1]
  b =  total * (1/(4*x))
  if a > b:
    Yes += 1
  else:
    No += 1
if Yes == y:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
n,m=map(int,input().split())
a=list(map(int,input().split()))
t=sum(a)
a=list(filter(lambda x: t//(4*m) < x, a))
print('Yes' if m <= len(a) else 'No')

Submission status: Wrong Answer

Solution code:
import sys
import os
from fractions import Fraction

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    N, M = il()
    A = il()
    sm = sum(A)
    a = Fraction(1, M)
    mi = sm * 0.25 * a
    cnt = 0

    for a in A:
        if a > mi: cnt += 1

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


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
n, m = map(int, input().split())
a = list(map(int, input().split()))
if (n+m) % m == 0:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

a = len(m)
sum = 0
for i in range(a):
  sum += int(m[i])

ld = sorted(m, reverse=True)

item1 = []
for i in range(int(n[1])):
  item1.append(ld[i])
  
item2 = []
for i in range(int(n[1])):
  item2.append(int(item1[i]) / sum)

ans = 1 / (4 * int(n[1]))

item3 = []
for i in range(int(n[1])):
  if item2[i] >= ans:
    item3.append(item2[i])

if int(len(item2)) == int(len(item3)):
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

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

if __name__ == '__main__':

    NM = input().split()
    nums = input().split()

    numsl = []
    for _,a in enumerate(nums):
        numsl.append(int(a))

    N = NM[0]
    M = NM[1]
    sum = 0

    if int(N) > 100:
        print('No')
        sys.exit()
    if 0 > int(M):
        print('No')
        sys.exit()
    if int(M) > int(N):
        print('No')
        sys.exit()

    for i,a in enumerate(nums):
        sum = sum + int(a)

    numsr = sorted(numsl,reverse=True)

    y = 0
    for i,a in enumerate(nums):
        if int(a) >= int(numsr[int(M)-1]):
            if int(a) > int(sum)//(4*int(M)):
                y = y + 1

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n,b= map(int, input().split())
 
a= list(map(int, input().split()))
 
new_list = sorted(a, reverse=True)
sums = sum(a)

#print(new_list[b-1])
if new_list[b-1] > sums/(b*4):
    	print("Yes")
else:
    	print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n,m = map(int,input().split())
ai = list(map(int,input().split()))
s = sum(ai)
check = s/4/m
count = 0
for i in ai:
  if i > int(check)+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()]
b=sorted(a, reverse=True)
if b[1] >= sum(a)/(4*m):
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

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

ave = sum(A)/N

c = 0
for i in range(N):
    if A[i] >= ave:
        c += 1

if c >= M:
    print "Yes"
else:
    print "No"

Submission status: Wrong Answer

Solution code:
import math
n,m=map(int,input().split())
a=list(map(int,input().split()))
summ=sum(a)
count=0
f=0
c=math.floor(int((1/(4*m))*summ))
for i in range(len(a)):
    if a[i]>c :
        count+=1
    if count==m:
        print("Yes")
        f=1
        break

if f==0:
    print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N, M = map(int, input().split())
a_list =  list(map(int, input().split()))
a_list.sort(reverse = True)
a_total = sum(a_list)
count = 0
for voted in a_list:
  if count == M:
      print("Yes")
      break
  if voted >= (1/(4*M))*a_total:
      count +=1
else:
    print("No")

Submission status: Wrong Answer

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

if __name__ == '__main__':

    NM = input().split()
    nums = input().split()

    numsl = []
    for _,a in enumerate(nums):
        numsl.append(int(a))

    N = NM[0]
    M = NM[1]
    sum = 0

    if int(N) <= 100:
        print('No')
        sys.exit()
    if 1 <= int(M):
        print('No')
        sys.exit()
    if int(M) <= int(N):
        print('No')
        sys.exit()

    for i,a in enumerate(nums):
        sum = sum + int(a)

    numsr = sorted(numsl,reverse=True)

    y = 0
    for i,a in enumerate(nums):
        if int(a) >= int(numsr[int(M)-1]):
            if int(a) > int(sum)//(4*int(M)):
                y = y + 1

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

Submission status: Wrong Answer

Solution code:
N, M = map(int, input().split())
num= map(int, input().split())
list1=[]
for i in num:
    list1.append(i)
sumnum= sum(list1)
pall= 1/(4*M)
pindi=((100*list1[M-1])/sumnum)/100
if pindi<pall:
    print("No")
else:
    print("Yes")

Submission status: Wrong Answer

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

a = sorted(A, reverse=True, key=int)

b = a[M-1]
c = sum(a)
d = 4*M
e = c//d

if b>=e:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
import math
n,m=map(int,input().split())
a=list(map(int,input().split()))
summ=sum(a)
count=0
f=0
c=math.ceil(int((1/(4*m))*summ))
for i in range(len(a)):
    if a[i]>c :
        count+=1
    if count==m:
        print("Yes")
        f=1
        break

if f==0:
    print("No")

Submission status: Wrong Answer

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

t = 0
check=False
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]

for i in range(m):
  if(a[i] < int(t/(4*m))):
    check=False
    break    
  else:
    check = True 
    
if(check):
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

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

count = 0
for i in blist:
    count += i
M = count/(4*M)
flag = 0
for i in blist:
    if i>M:
        flag += 1
if flag>1:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

zenbu = sum(A)
waruno = 4 * M
joken = zenbu / waruno

ninki = sum( i > joken for i in A)

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

Submission status: Wrong Answer

Solution code:
import numpy as np
n, m = list(map(int,(input().split())))
a = np.array(list(map(int,(input().split()))))

all_b = sum(a)
t = 1/(4*m)*all_b
#all_t =a*t

ans = np.where(a>t)
#print(ans)
#print(all_b[all_b >t])
#print(all_b,t)
#print(len(ans[0]))
if len(ans[0]) >= 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()]

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

count = 0
for a in A:
    if a > point:
        count += 1

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

Submission status: Wrong Answer

Solution code:
nubers = [input() for i in range(2)]
NM = nubers[0].split()
As = nubers[1]
N = int(NM[0])
M = int(NM[1])
A = []
hhh,jjj = 0,0
AA =As.split()
for aa in AA:
  A.append(int(aa))
if len(A) == len(set(A)):
  for nn in A:
    if 1 <= nn and nn <=1000:
      jjj +=1
A.sort(reverse=True)
if jjj == len(A) and 1 <= M and M <= N and N <= 100:
  zen_A = sum(A)
  chk = zen_A*(1/(4*M))
  for oo in range(M):
    if chk < A[oo]:
      hhh += 1
  if hhh == M:
    print('Yes')
  elif hhh == 0:
    print('No')
  else:
    print('No')
else:
  print('No')

Submission status: Wrong Answer

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

t = 0
check=False
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]
print(a)

print(int(t/(4*m)))
for i in range(m):
  if(a[i] < int(t/(4*m))):
    check=False
    break    
  else:
    check = True 
    
if(check):
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
i1 = input()
i1 = i1.split()
types = int(i1[0])
select = int(i1[1])

i2 = input()
i2 = [int(n) for n in i2.split()]
i2.sort(reverse=True)

summary = sum(i2)
threshold = summary / int(types * 4)

if i2[select-1] >= threshold :
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

if f==0:
    print("No")

Submission status: Wrong Answer

Solution code:
a = input()
b = a.split()
m = int(b[1])
c = input()
d = c.split()
c = sorted(d, reverse=True)
c = [int(i) for i in c]
d = sum(c)/4
i = 0
z = []
while i < m:
    if c[i] > d:
        z.append(1)
    else:
        z.append(0)
        break
    i = i + 1
z = set(z)
if len(z) == 1:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
x, y = map(int,input().split())
ls = list(map(int, input().split()))

ls.sort()
total = sum(ls)
Yes = 0
No = 0

for i in range(y):
  a = ls[x-i-1]/total
  b =  1/(4*x)
  if a > b:
    Yes += 1
  else:
    No += 1
if Yes == y:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

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

aaa.sort(reverse=True)
result = [0]*b
for i in range(b):
    h = aaa[i]
    j = sum(aaa) / (4*b)

    if h > j:
        result[i] = 1
    else:
        result[i] = 0

if result.count(1) >= b:
    ans = "Yes"
else:
    ans = "No"

print(ans)

Submission status: Wrong Answer

Solution code:
N, M = map(int, input().split())
A = sorted(map(int, input().split()), reverse=True)
# print(A)
v_min = sum(A) / (4 * M)
# print(v_min)
cnt = 0
for item in A:
    if item > v_min:
        cnt += 1
    else:
        break
if cnt >= M:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

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

#print(count)

#print(N-n-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 = count + 1

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

Submission status: Wrong Answer

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

if __name__ == '__main__':

    NM = input().split()
    nums = input().split()

    numsl = []
    for _,a in enumerate(nums):
        numsl.append(int(a))

    N = NM[0]
    M = NM[1]
    sum = 0

    if int(N) <= 100:
        print('No')
        sys.exit(0)
    if 1 <= int(M):
        print('No')
        sys.exit(0)
    if int(M) <= int(N):
        print('No')
        sys.exit(0)

    for i,a in enumerate(nums):
        sum = sum + int(a)

    numsr = sorted(numsl,reverse=True)

    y = 0
    for i,a in enumerate(nums):
        if int(a) >= int(numsr[int(M)-1]):
            if int(a) > int(sum)//(4*int(M)):
                y = y + 1

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

Submission status: Wrong Answer

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

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

if c >= M:
    print "Yes"
else:
    print "No"

Submission status: Wrong Answer

Solution code:

if True:
    a = list(map(int,input().split()))
    b = list(map(int,input().split()))
    b.sort(reverse=True)
    s = (1/(4*a[1]))*(sum(b))
    c = 0
    done = False
    for i in b:
        if i>s and c<a[1]:
            c+=1
            continue
        break
        
    if c>=a[1]:
        print("Yes")
    else:
        print("No")

Submission status: Wrong Answer

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

#print(new_list[b-1])
if new_list[b-1] > b*4:
    	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 = count + 1
    if count > M:
        print("Yes")
        break
    else:
        print("No")
        continue

Submission status: Wrong Answer

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

cnt=0
for j in range(n):
    cnt+=a[j]

b=[]
for i in range(n):
    if a[i]>(cnt*(1/(4*m))):
        b.append(a[i])

if len(b) > m:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
N, M = map(int, input().split())
An   = list(map(int, input().strip().split()))
Limit = int(sum(An)/(4*M))

cnt = 0
i = 0
for i in range(N):
    if An[i] >= Limit:
        cnt = cnt+1
        
if M <= cnt:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

print(new_list[b-1])
if new_list[b-1] > b*4:
    	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)
cnt = 0
for i in range(0, N):
    if A[i] < (total//(4*M)):
        continue
    cnt += 1
if cnt >= M:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
#coding: utf-8
A = list(map(int, input().split()))
B =	list(map(int, input().split()))
num = A[0]
jud = A[1]
all = sum(B)
n = 0
C = 0
AN = 0

while n < num-1 :
	AN = B[n]
	n += 1
    
	if AN < all / (jud*4):
		continue
	
	else:
		C += 1
    
if C >= jud:
	print("Yes")
else:
	print("No")

Submission status: Wrong Answer

Solution code:
n,m=map(int,input().split())
a=list(map(int,input().split()))
t=sum(a)
a=list(filter(lambda x: t/(4*m) < x, a))
print('Yes' if m <= len(a) else 'No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

a = len(m)
sum = 0
for i in range(a):
  sum += int(m[i])

ld = sorted(m, reverse=True)

item1 = []
for i in range(int(n[1])):
  item1.append(ld[i])
  
item2 = []
for i in range(int(n[1])):
  item2.append(int(item1[i]) / sum)

ans = 1 / (4 * int(n[1]))

item3 = []
for i in range(int(n[1])):
  if item2[i] >= ans:
    item3.append(item2[i])

c = int(len(item3))

if int(n[1]) == c:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

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

A = []
kosuu = 0

tmp = input().split()
for i in range(N):
  A.append(int(tmp[i]))

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

for i in A:
  if i > tmp:
    kosuu += 1

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N, M = input().split()
N= int(N)
M = int(M)
itemList = list(map(int, input().split()))
itemList.sort()
index = -1
answer = True
for i in range(M):
  if itemList[index] <= (N*(1/(4*M))):
    answer = False
    break
  index -= 1
  
if answer:
  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 >= int(M):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

A = []
kosuu = 0

tmp = input().split()
for i in range(N):
  A.append(int(tmp[i]))

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

for i in A:
  if i > tmp:
    kosuu += 1

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x,y= list(map(int, input().split()))
i = list(map(int, input().split()))
i.sort(reverse=True)
k=sum(i)
flag=0
for j in range(x):
    if i[j]<(k/(4*(j+1))):
        pass
    else:
        flag+=1
if flag<y:
    print("No")
else:
    print("Yes")

Submission status: Wrong Answer

Solution code:
N, M = input().split()
N= int(N)
M = int(M)
itemList = list(map(int, input().split()))
itemList.sort()
index = -1
answer = True
for i in range(M):
  if itemList[index] < (N*(1/(4*M))):
    answer = False
    break
  index -= 1
  
if answer:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
N, M = map(int, input().split())
arrayA = input().split()
convertedArray = [int(ele) for ele in arrayA]
count = 0
total = sum(convertedArray)
con = int((1 / (4 * M)) * total)
for A in convertedArray:
    if A > con:
        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()))
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:

if True:
    a = list(map(int,input().split()))
    b = list(map(int,input().split()))
    s = (1/(4*a[1]))*(sum(b))
    c = 0
    done = False
    for i in b:
        if i>s:
            c+=1
        if c>=a[1]:
            done = True
            break
    if done:
        print("Yes")
    else:
        print("No")

Submission status: Wrong Answer

Solution code:
N, M = map(int, input().split())
a_list =  list(map(int, input().split()))
a_list.sort(reverse = True)
a_total = sum(a_list)
count = 0
for voted in a_list:
    if count >= M:
        print("Yes")
        break
    if voted < (1/(4*M))*a_total:
        pass
    else:
      count += 1
else:
    print("No")

Submission status: Wrong Answer

Solution code:
N, M = map(int, input().split())
A = list(map(int, input().split()))
total = sum(A)
cnt = 0
for a in A:
    if (total//(4*M)) < a:
        cnt += 1
if cnt >= M:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
n, m = map(int, input().split())
a_list = list(int(x) for x in input().split())
count = 0

for i in a_list:
    if i > sum(a_list)/(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()))
A.sort()
b=sum(A)/4*M
A.reverse()
ans="Yes"
for i in range(M):
    if A[i]<b:
        ans="No"
print(ans)

Submission status: Wrong Answer

Solution code:
n,m=map(int,input().split())
List=[int(i) for i in input().split()]
s=sum(List)
for i in range(m):
    a=max(List)    
    if a>s*(1/(4*m)):
        del List[List.index(a)]
        a=1
       
    else:
        
        a=0

print('Yes' if a==1 else 'No')

Submission status: Wrong Answer

Solution code:
n, m = [int(i) for i in input().split()]
a = sorted([int(i) for i in input().split()], reverse=True)

ans = 0
t = sum(a) / (4*m)
for i in a:
    if i <= t:
        break
    ans += 1

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
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)
count = 0
for i in range(N):
    if A[i] > limit:
        count +=1

#print(count)

#print(N-n-1)
if count >= M:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
x,y= list(map(int, input().split()))
i = list(map(int, input().split()))
i.sort(reverse=True)
k=sum(i)
flag=0
for j in range(y):
    if i[j]<(k/(4*(j+1))):
        pass
    else:
        flag+=1
if flag<y:
    print("No")
else:
    print("Yes")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N, M = map(int, input().split())
blist=list(map(int,input().split()))
count = 0
for i in blist:
    count += i
M = count/(4*M)
flag = 0
for i in blist:
    if i>M:
        flag = 1
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)
s = 0
for i in range(m):
    if a[i]*4*m > sum(a):
        s += 1
if s >= m:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:

def main():
    N, M = [int(_) for _ in input().split()]
    slist = list(map(int, input().split()))
    sort_list = sorted(slist)
    thr = sum(sort_list) / (4 * M)
    
    cnt = 0
    for i in sort_list:
        if i > thr:
            cnt += 1

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

main()

Submission status: Wrong Answer

Solution code:
items,select = input().split()
x = [int(items) for x in input().split()]
for u in x:
    if u > (1 / (4 * int(select))*sum(x)):
        print("No")
        break
    else:
        print("Yes")
        break

Submission status: Wrong Answer

Solution code:
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)
count = 0
for i in range(N):
    if A[i] > limit:
        count +=1

#print(count)

#print(N-n-1)
if count > M:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
import numpy as np
l_input = [int(e) for e in input().split()]
A = [int(e) for e in input().split()]
A = np.array(A)
N = l_input[0]
M = l_input[1]
A_dash = A-1/(4*M)*sum(A)
cnt = 0
for i in A_dash:
    if i >0:
        cnt += 1
if cnt >= M:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
N, M = map(int, input().split())
arrayA = input().split()
convertedArray = [int(ele) for ele in arrayA]
count = 0
total = sum(convertedArray)
con = int((1 / (4 * M)) * total)
print(con)
for A in convertedArray:
    if A > con:
        count += 1
if count >= M:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

import itertools

n, m = map(int, readline().split())
a = list(map(int, readline().split()))
sum_a = sum(a)
cumsum = list(itertools.accumulate(a))
ans = [0] * n
cnt = 0
memo = 1
if cumsum[m - 1] / sum_a >= 1 / (n * m):
    cnt += 1
    if n == m:
        print('Yes')
        exit()
for i in range(n):
    if (cumsum[m + memo - 1] - cumsum[memo - 1]) / sum_a >= 1 / (n * m):
        cnt += 1
        if memo - 1 == n - m + 1:
            print('Yes')
            exit()
    else:
        memo += m
    if memo - 1 == n - m + 1:
        break
if cnt >= m:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

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