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:
import os
import heapq
import sys
import math
from collections import defaultdict
from io import BytesIO, IOBase
def check_kth_power(n, k):
        while n%k == 0:
            n = n/k

        if n != 1:
            return False
        return True
def main():
    #for _ in range(int(input())):
    n,m=map(int,input().split())
    arr=[int(k) for k in input().split()]
    
    total=0
    for i in range(n):
        total+=arr[i]
    val=(1//4*m)*total
    counter=0
    ans="No"
    for i in range(n):
        if arr[i]>=val:
            counter+=1
        if counter==m:
            ans="Yes"
    print(ans)
        
BUFSIZE = 8192

class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)


class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")


sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
N,M=map(int,input().split())
A = list(map(int,input().split()))
cnt=0
total = sum(A)
min = total//(4*M)
for i in A:
  if i>=min:
    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()))

b = sum(a)
c = b / (4*m)

res = 0
for i in a:
  if i > c:
    res += 1

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

Submission status: Wrong Answer

Solution code:
# N：全種類数、M：今回種類数
N,M = map(int, input().split())
# 得票数
hyou = list(map(int, input().split()))

# 総得票数
total_hyou = 0
for i in hyou:
  total_hyou += i

# 得票数基準クリア数
count = 0
border = int(total_hyou/(4*M))
for j in hyou:
  if j >= border:
    count += 1
    
# 人気商品をM個選べるかどうか
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()
if a[n-m]>=int(sum(a)//(4*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()))
a.sort()
if n<m:
  print('No')
elif a[n-m]<math.ceil(sum(a)//(4*m)):
  print('No')
else:
  print('Yes')

Submission status: Wrong Answer

Solution code:
import math
n,m=map(int,input().split())
a=list(map(int,input().split()))
a.sort()
if a[n-m]<math.ceil(sum(a)//(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()))

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

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

Submission status: Wrong Answer

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

X = int(sum(Li) / (4*M))
Li.sort(reverse = True)

if Li[M - 1] >= X:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

X = int(sum(Li) / 4 / M)
Li.sort(reverse = True)

if Li[M - 1] >= X:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

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

l =[0] * N
for i in range(N):
  if mono[i] >= sum(mono)/4*M:
    l[i] = 1
    
if l.count(1) >= M:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
if __name__ == '__main__':
    n, m = map(int, input().split())
    a = [int(i) for i in input().split()]
    s = sum(a)
    a = sorted(a)[::-1]
    if a[m-1] >= (s / (4 * m)):
        print("yes")
    else:
        print("no")

Submission status: Wrong Answer

Solution code:
N, M = map(int, input().split())
As = list(map(int, input().split()))
s = sum(As)
bs = [A*4*M < s  for A in As]
if bs.count(True) >= M:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
import sys
#import numpy as np
import math
from fractions import Fraction
import itertools

input=sys.stdin.readline

n,m=map(int,input().split())
a=list(map(int ,input().split()))
s=sum(a)
s=int(s/(4*m))
c=0

for i in range(n):
    if a[i]>=s:
        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()))

count = 0

a.sort(reverse=True)
sum_a = sum(a)
thresh = sum_a * (1/(4*m))

for i in range(m):
    if a[i] > thresh:
        count += 1
    else:
        break

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

sums = sum(a)
count = 0

for i in a:
  #print(i, sum)
  if i > (sums / ( M * 4 )):
    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()))

sums = sum(a)

p = []

for i in a:
  #print(i, sum)
  if i > (sums / ( M * 4 )):
    p.append(i)

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

a.sort(reverse = True)
sum = sum(a)

p = []

for i in a:
  #print(i, sum)
  if i > (sum // ( M * 4 )):
    p.append(i)

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

a.sort(reverse = True)
sum = sum(a)

ans = 'No'
p = []

for i in a:
  #print(i, sum)
  if i > (sum / ( M * 4 )):
    p.append(i)
    if len(p) >= M:
      ans = "Yes"
      break
  else:
    break

print(ans)

Submission status: Wrong Answer

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

a.sort(reverse = True)
sum = sum(a)

ans = 'No'
p = []

for i in a:
  #print(i, sum)
  if i > (sum // ( M * 4 )):
    p.append(i)
    if len(p) >= M:
      ans = "Yes"
      break
  else:
    break

print(ans)

Submission status: Wrong Answer

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

a.sort(reverse = True)
sum = sum(a)

ans = 'Yes'
p = []

for i in a:
  #print(i, sum)
  if i > (sum // ( M * 4 )):
    p.append(i)
    if len(p) >= M:
      break
  else:
    ans = 'No'
    break

print(ans)

Submission status: Wrong Answer

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

X = int(sum(Li) / 4)
Li.sort(reverse=True)

if Li[M - 1] < X:
    print('No')
else:
    print('Yes')

Submission status: Wrong Answer

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

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

total = sum(A)

bodor = total / (4 * M)
cnt = 0

for i in A:
    if i > bodor:
        cnt += 1

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

Submission status: Wrong Answer

Solution code:
import sys

def ILI(): return list(map(int, sys.stdin.readline().rstrip().split()))
def ISI(): return map(int, sys.stdin.readline().rstrip().split())

n, m = ISI()
l = ILI()
cnt = 0
s = sum(l)
for a in l:
	if a > s/(4*m): cnt +=1
if cnt<m:print("No")
else:print("Yes")

Submission status: Wrong Answer

Solution code:
import sys

def ILI(): return list(map(int, sys.stdin.readline().rstrip().split()))
def ISI(): return map(int, sys.stdin.readline().rstrip().split())

n, m = ISI()
l = ILI()
cnt = 0
base = int(sum(l)/(4*m))
for a in l:
	if a > base: cnt +=1
if cnt<m:print("No")
else:print("Yes")

Submission status: Wrong Answer

Solution code:
import sys

def ILI(): return list(map(int, sys.stdin.readline().rstrip().split()))
def ISI(): return map(int, sys.stdin.readline().rstrip().split())
n, m = ISI()
l = ILI()
cnt = 0
base = sum(l)/(4*m)
for a in l:
	if a > base: cnt +=1
if cnt<m:print("No")
else:print("Yes")

Submission status: Wrong Answer

Solution code:
n,m=map(int,input().split())
ai=list(map(int,input().split()))
bi=[i for i in ai if i>=sum(ai)/(4*m)]
if len(ai)==len(bi):
    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) / 4 * M
A.sort(reverse = False)
if A[M-1] >= total:
  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)
if total * 1 / 4*M <= A[M - 1]:
  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)

if A_list[m-1]>=1/(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()))
C=int(sum(A)*1/(4*M))
count=0

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

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

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

S = (sum(A)*1.0) / (4 * M)

count = 0
for i in A:
  count += 1 if i >= S else 0

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

Submission status: Wrong Answer

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

N, M = map(int, input().rstrip().split())

votes = list(map(int, input().rstrip().split()))
ans = []

for i in range(len(votes)):
  if votes[i] > sum(votes) / (4*M):
    ans.append(votes[i])

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

Submission status: Wrong Answer

Solution code:
import numpy as np
n,m = map(int,input().split())
a = list(map(int,input().split()))
s = sum(a)
x = s*(1/(4*m))
aa = np.array(a)
if np.count_nonzero(aa >x) >= m:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
from sys import stdin, setrecursionlimit


def main():
    input = stdin.buffer.readline
    n, m = map(int, input().split())
    a = list(map(int, input().split()))
    limit = sum(a) / (4 * m)
    count = 0
    for i in range(n):
        if a[i] > limit:
            count += 1
    if count >= m:
        print('Yes')
    else:
        print('No')


if __name__ == "__main__":
    setrecursionlimit(10000)
    main()

Submission status: Wrong Answer

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

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

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

aa = (1/(4*M))
sm = int(sum(A)*aa)

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

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

Submission status: Wrong Answer

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

T = sum(l)
V = 1/(4*M) * T

S = len(list(filter(lambda x: x>=V, l))) > 0

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

Submission status: Wrong Answer

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

c = 0

for i in range(len(a)):
    if a[i] >= sum(a) / 4 * m:
        c += 1
    
if c >= 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()))

c = 0

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

sum = 0
for i in A:
    sum += int(i)

s = int(sum / 4 / m)
ans = 0
for i in A:
    if int(i) >= s:
        ans += 1

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

Submission status: Wrong Answer

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

sum = 0
for i in A:
    sum += int(i)

s = int(sum / 4 / m)
ans = 0
for i in A:
    if int(i) >= s:
        ans += 1

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

Submission status: Wrong Answer

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

sum = 0
for i in A:
    sum += int(i)

s = int(sum / 4 / m)
ans = 0
for i in A:
    if int(i) >= s:
        ans += 1

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

Submission status: Wrong Answer

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

l = input().split(" ")
s = 0
for  i in l:
  m = int(i)
  s = s + m
 
t = m/4/p

c = 0
for i in l:
  m = int(i)
  if m >= t:
    c = c + 1
if c >= p:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
n,p = map(int,input().split(" "))
 
l = input().split(" ")
s = 0
for  i in l:
  m = int(i)
  s = s + m
 
t = s/4*p
 
c = 0
for i in l:
  m = int(i)
  if m > t:
    c = c + 1
if c >= p:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
n,p = map(int,input().split(" "))
 
l = input().split(" ")
s = 0
for  i in l:
  m = int(i)
  s = s + m
 
t = (m/4)*p
 
c = 0
for i in l:
  m = int(i)
  if m >= t:
    c = c + 1
if c >= p:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

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

l = input().split(" ")
s = 0
for  i in l:
  m = int(i)
  s = s + m
 
t = m/4*p

c = 0
for i in l:
  m = int(i)
  if m > t:
    c = c + 1
if c >= p:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
import math
import time
from collections import defaultdict, deque
from sys import stdin, stdout
from bisect import bisect_left, bisect_right
n,m=map(int,stdin.readline().split())
a=list(map(int,stdin.readline().split()))
s=sum(a)
ans=0
for i in a:
    if(i<(s/(4*m))):
        continue
    ans+=1
if(ans>=m):
    print("yes")
else:
    print("no")

Submission status: Wrong Answer

Solution code:
import math
import time
from collections import defaultdict, deque
from sys import stdin, stdout
from bisect import bisect_left, bisect_right
n,m=map(int,stdin.readline().split())
a=list(map(int,stdin.readline().split()))
s=sum(a)
ans=0
for i in a:
    if(i<(n/(4*m))):
        continue
    ans+=1
if(ans>=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()))
s=sum(a)
t=math.floor(s/4/m)
a.sort()

cnt=0
for i in a:
  if i>=t:
    cnt+=1

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

Submission status: Wrong Answer

Solution code:
N, M = map(int, input().split())
score_list = list(map(int, input().split()))
s = sum(score_list)
print(s)
print(score_list)
for score in score_list:
    if score < (s / (4 * M)):
        score_list.remove(score)
print(score_list)
if len(score_list) >= M:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

A.sort(reverse=True)

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

Submission status: Wrong Answer

Solution code:
n, m = map(int, input().split(" "))
a = list(map(int, input().split(" ")))
a.sort(reverse=True)
print(a)
if a[m - 1] < sum(a) /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()))

A_sum = sum(A)
evo = A_sum/(4*M)

counter = 0
for vote in A:
    if vote > evo:
        counter += 1

if counter < M:
    print('No')
else:
    print('Yes')

Submission status: Wrong Answer

Solution code:
n, m = map(int, input().split())
a = list(map(int, input().split()))
total = sum(a)
ave = total / n
ans = 0
for i in a:
    if i >= ave:
        ans += 1

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

kei = sum(a)
ans = 0
line = kei / 4 / m
for i in a:
    if i > line:
        ans+= 1
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()))

lim = 1/(4*m)

ans = 0
for a in A:
  if a>=lim:
    ans += 1
    
if ans >= m:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

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

total_a = sum(A_i)

if len(list(filter(lambda x: x >= total_a / (4 * M), A_i))) > M:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

total = sum(A)
border = total // (2 * M)

for i in range(M):
    if A[i] < border:
        print('No')
        break
else:
    print('Yes')

Submission status: Wrong Answer

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

total = sum(A)
border = total // (2 * M)

products = [a for a in A if a >= border]

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

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!
#入力Nの全ての並べ方
#print(list(itertools.permutations([1, 2, 3])))
N,M = map(int,input().split())
A = list(map(int,input().split()))
total = sum(A)
count = 0
for i in range(N):
    if A[i] > total / 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()))

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

L = [i for i in A if i >= judge]
print(L)


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

Submission status: Wrong Answer

Solution code:
import heapq

N, M = map(int,input().split())
a = list(map(int,input().split()))
count = 0

for i in heapq.nlargest(M,a):
    if(1 / (4 * M) < i / sum(a)):
        count += 1

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

Submission status: Wrong Answer

Solution code:
import heapq

N, M = map(int,input().split())
a = list(map(int,input().split()))
count = 0

for i in heapq.nlargest(M,a):
    if(1 / (4 * M) < i / sum(a)):
        count += 1

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

Submission status: Wrong Answer

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

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

L = np.maximum(judge, A)
L = list(L)
while judge in L:
    L.remove(judge)

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

Submission status: Wrong Answer

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

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


L = np.maximum(judge, A)
L = list(L)
while judge in L:
    L.remove(judge)

if len(L) > M:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

judje = sum(A)/4*M

L = np.maximum(judje,A)
while 0 in L:
    L.remove(0)
if len(L)>M:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
#!usr/bin/env python3
from collections import defaultdict, deque
from heapq import heappush, heappop
from itertools import permutations, accumulate
import sys
import math
import bisect
def LI(): return [int(x) for x in sys.stdin.buffer.readline().split()]
def I(): return int(sys.stdin.buffer.readline())
def LS():return [list(x) for x in sys.stdin.readline().split()]
def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res
def IR(n):
    return [I() for i in range(n)]
def LIR(n):
    return [LI() for i in range(n)]
def SR(n):
    return [S() for i in range(n)]
def LSR(n):
    return [LS() for i in range(n)]
 
sys.setrecursionlimit(1000000)
mod = 1000000007
 
def solve():
  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")
  return
 
#Solve
if __name__ == "__main__":
    solve()

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(10**7)
input = lambda: sys.stdin.readline().strip()

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

main()

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(10**7)
input = lambda: sys.stdin.readline().strip()

def main():
    N,M = map(int,input().split())
    A_list = sorted(list(map(int,input().split())),reverse=True)
    print("Yes" if A_list[M-1]>A_list[0]*(1/(4*M)) else "No")

main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if sum(a) / 4 / m <= a[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()))
mini = n / (4 * m)
a.sort(reverse = True)
if a[m-1] < mini:
	print('No')
else:
	print('Yes')

Submission status: Wrong Answer

Solution code:
n, m = map(int, input().split())
a = list(map(int, input().split()))
sum_a = sum(a)
mini = n / (4 * m)
if a[m-1] < mini:
	print('No')
else:
	print('Yes')

Submission status: Wrong Answer

Solution code:
n, m = map(int, input().split())
a = list(map(int, input().split()))
sum_a = sum(a)
mini = n // (4 * m)
if a[m-1] < mini:
	print('No')
else:
	print('Yes')

Submission status: Wrong Answer

Solution code:
N,M = map(int, input().split())
A = list(map(int, input().split()))
vote = sum(A)
#print(vote)
count = 0
line = 4*M
line2 = vote/line
#print(line2)
ans = "No"

for i in A:
    if (i >= line2):
        count += 1

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


print(ans)

Submission status: Wrong Answer

Solution code:
N, M = map(int, input().split())
A = list(map(int, input().split()))
vote = sum(A)
#print(vote)
count = 0
line = 4*M
line2 = vote//line
ans = "No"

for i in A:
    if (i >= line2):
        count += 1

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


print(ans)

Submission status: Wrong Answer

Solution code:
N, M = map(int, input().split())
A = list(map(int, input().split()))
vote = sum(A)
#print(vote)
count = 0
line = 4*M
line2 = vote//line
ans = "No"

for i in A:
    if i >= line2:
        count += 1

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


print(ans)

Submission status: Wrong Answer

Solution code:
N, M = map(int, input().split())
A = list(map(int, input().split()))
vote = sum(A)
#print(vote)
count = 0
line = 4*M
line2 = vote//line
ans = "No"

for i in A:
    if i > line2:
        count += 1

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


print(ans)

Submission status: Wrong Answer

Solution code:
line1 = input().split()
n = int(line1[0])
m = int(line1[1])
line2 = input().split()
line2 = [int(i) for i in line2]
total = sum(line2)
line2 = sorted(line2)
if line2[m-1] > total / (4 * m):
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

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

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

b = input().split()

x = [int(i) for i in b]

s = sum(x)
lim =float( s / (m*4))


c = 0

for i in range(0,n):
    if(x[i] > lim):
      c = c + 1
    else:
      continue

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

Submission status: Wrong Answer

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

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

b = input().split()

x = [int(i) for i in b]

s = sum(x)
lim = s / (m*4) 

c = 0

for i in range(0,n):
    if(x[i] > lim):
      c = c + 1
    else:
      continue

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

Submission status: Wrong Answer

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

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

b = input().split()

x = [int(i) for i in b]

s = sum(x)
lim = s / (m*4) 

c = 0

for i in range(0,n):
    if(x[i] > lim):
      c = c + 1
    else:
      continue

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

Submission status: Wrong Answer

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

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

b = input().split()

x = [int(i) for i in b]

s = sum(x)
lim = s * (1/(m*4)) 

c = 0

for i in range(0,n):
    if(x[i] > lim):
      c = c + 1
    else:
      continue

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

Submission status: Wrong Answer

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

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

b = input().split()

x = [int(i) for i in b]

s = sum(x)
lim = s * (1/(m*4)) 

c = 0
print(lim)
for i in range(0,n):
    if(x[i] > lim):
      c = c + 1
    else:
      continue

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

Submission status: Wrong Answer

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

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

b = input().split()

x = [int(i) for i in b]

s = int(sum(x))
lim = s * (1/(m*4)) 

c = 0
'''
x.sort(reverse=True)
c = 0
y = x[:m]
'''
for i in range(0,n):
    if(x[i] > lim):
      c = c + 1
    else:
      continue

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

Submission status: Wrong Answer

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

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

b = input().split()

x = [int(i) for i in b]

s = int(sum(x))
lim = int(s * (1/(m*4))) 

c = 0
'''
x.sort(reverse=True)
c = 0
y = x[:m]
'''
for i in range(0,n):
    if(x[i] > lim):
      c = c + 1
    else:
      continue

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

Submission status: Wrong Answer

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

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

b = input().split()

x = [int(i) for i in b]

s = int(sum(x))
lim = int(s * (1/(m*4))) + 1

c = 0
'''
x.sort(reverse=True)
c = 0
y = x[:m]
'''
for i in range(0,n):
    if(x[i] > lim):
      c = c + 1
    else:
      continue

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

Submission status: Wrong Answer

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

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

b = input().split()

x = [int(i) for i in b]

s = int(sum(x))
lim = int(s * (1/(m*4))) + 1

c = 0
'''
x.sort(reverse=True)
c = 0
y = x[:m]
'''
for i in range(0,n):
    if(x[i] > lim):
      c = c + 1
    else:
      continue

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

Submission status: Wrong Answer

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

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

b = input().split()

x = [int(i) for i in b]

s = int(sum(x))
lim = int(s * (1/(m*4))) + 1

c = 0
'''
x.sort(reverse=True)
c = 0
y = x[:m]
'''
for i in range(0,n):
    if(x[i] > lim):
      c = c + 1
    else:
      continue
print(lim)
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()))

cnt = 0
for i in range(n):
  if a[i]>=int(sum(a)/(4*m)):
    cnt+=1

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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