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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
def main():
  n, m = map(int, input().split())
  l = list(map(int, input().split()))
  d = sum(l) / (4 * m)
  cnt = 0;
  for li in l:
    if li > d:
      cnt = cnt + 1
  if cnt > m :
    print ("Yes")
  else :
    print ("No")
  return

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

sorted(a, reverse=True)
if a[m-1] >= (sum(a)*(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()))

sorted(a, reverse=True)
if a[m-1] >= (sum(a)*(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()))

sorted(a, reverse=True)
if a[m-1] < (sum(a)*(1/(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()))

sorted(a, reverse=True)
if a[m-1] < sum(a)*(1/(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()))

sorted(a, reverse=True)
if a[m-1] < sum(a)*(1/(4*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)

A = A[:M]
ans = None

sm = sum(A)
# A[-1] < sm * (1/4M)
if 4 * M * A[-1] < sm:
    ans = False
else:
    ans = True

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

Submission status: Wrong Answer

Solution code:
#B
NM = input().split(' ')
N = int(NM[0]) ; M = int(NM[1])
Ai = input().split(' ')
all_A = 0
for k in Ai:
    all_A += int(k)
line = all_A / (4*M)
count = 0
for k in Ai:
    if int(k) <= line:
        count += 1
if count >= M:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
n, m = map(int, input().split())
A = list(map(int, input().split()))
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 = [int(w) for w in input().strip().split()]
arr = [int(w) for w in input().strip().split()]
 
ss = sum(arr)
frac = ss/(4*m)
flag = False
arr.sort(reverse=True)
for i in range(m):
  if arr[i] > frac:
    flag = True
  else:
    flag = False
    break
if flag:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
n, m = [int(w) for w in input().strip().split()]
arr = [int(w) for w in input().strip().split()]
 
ss = sum(arr)
frac = ss//(4*m)
flag = False
arr.sort(reverse=True)
for i in range(m):
  if arr[i] > frac:
    flag = True
  else:
    flag = False
    break
if flag:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n,m = map(int,input().split())
ai = list(map(int,input().split()))
s = sum(ai)
count = 0
for i in ai:
  if i > s/4/m:
    count += 1
if count >= m:
  print('Yes')
else:
  print('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 > round(check, 2):
    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()))

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

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

Submission status: Wrong Answer

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

if product_list[m-1] > sum(product_list)/(4*m):
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())
c=list(map(int,input().split()))
required=sum(c)/(4*b)
count=0
for d in ｃ:
    if d>=required:
        count+=1
    else:
        break
print("YNeos"[count<b::2])

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())
c=list(map(int,input().split()))
required=sum(c)/(4*b)
count=0
for d in sorted(c,reverse=True):
  if d>=required:
      count=+1
  else:
      break
print("YNeos"[count<b::2])

Submission status: Wrong Answer

Solution code:
n, m = [int(w) for w in input().strip().split()]
arr = [int(w) for w in input().strip().split()]

ss = sum(arr)
frac = ss//(4*m)
flag = False
arr.sort(reverse=True)
for i in range(m):
  if arr[i] > frac:
    flag = True
  else:
    flag = False
    break
if flag:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())
c=list(map(int,input().split()))
required=sum(c)/(4*b)
count=0
for d in c:
  if d>=required:
      count=+1
  else:
      break
print("YNeos"[count<b::2])

Submission status: Wrong Answer

Solution code:
n, m = [int(w) for w in input().strip().split()]
arr = [int(w) for w in input().strip().split()]

ss = sum(arr)
frac = ss//(4*m)
flag = False
arr.sort()
for i in range(m):
  if arr[i] > frac:
    flag = True
  else:
    flag = False
    break
if flag:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
n, m = [int(w) for w in input().strip().split()]
arr = [int(w) for w in input().strip().split()]

ss = sum(arr)
frac = ss//(4*m)

for i in arr:
  if i > frac:
    m -= 1
if m<=0:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
from collections import defaultdict, deque
import sys
import heapq
import bisect
import itertools
import queue
import copy
import time
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7

def inp(): return int(sys.stdin.readline())

def inpl(): return list(map(int, sys.stdin.readline().split()))

def inpl_str(): return list(sys.stdin.readline().split())

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

Submission status: Wrong Answer

Solution code:
from collections import defaultdict, deque
import sys
import heapq
import bisect
import itertools
import queue
import copy
import time
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7

def inp(): return int(sys.stdin.readline())

def inpl(): return list(map(int, sys.stdin.readline().split()))

def inpl_str(): return list(sys.stdin.readline().split())

n, m = inpl()
a = inpl()
s = sum(a)
cnt = 0
for i in a:
    if i > s/(4*m):
        cnt += 1
if cnt >= 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()]

print("Yes" if len([x for x in a if x>sum(a)/(4*m)])>=m else "No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from collections import defaultdict, deque
import sys
import heapq
import bisect
import itertools
import queue
import copy
import time
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7

def inp(): return int(sys.stdin.readline())

def inpl(): return list(map(int, sys.stdin.readline().split()))

def inpl_str(): return list(sys.stdin.readline().split())

n, m = inpl()
a = inpl()
s = sum(a)
cnt = 0
for i in a:
    if i > s/(4*m):
        cnt += 1
    if cnt == m:
        print('Yes')
        exit()
print('No')

Submission status: Wrong Answer

Solution code:
from collections import defaultdict, deque
import sys
import heapq
import bisect
import itertools
import queue
import copy
import time
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7

def inp(): return int(sys.stdin.readline())

def inpl(): return list(map(int, sys.stdin.readline().split()))

def inpl_str(): return list(sys.stdin.readline().split())

n, m = inpl()
a = inpl()
s = sum(a)
cnt = 0
print(s/(4*m))
for i in a:
    if i > s/(4*m):
        cnt += 1
    if cnt == m:
        print('Yes')
        exit()
print('No')

Submission status: Wrong Answer

Solution code:
N,M = (int(x) for x in input().split())
a = list(map(int,input().split()))
x = sum(a)*1/(4*M)

pick = 0
for (a_i) in a:
    if (a_i) > x:
        pick += 1

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

Submission status: Wrong Answer

Solution code:
N,M = (int(x) for x in input().split())
a = list(map(int,input().split()))
x = sum(a)*1/(4*M)

pick = 0
for (a_i) in a:
    if (a_i) > x:
        pick += 1

if pick >= 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("YNeos"[sum(a[i]>sum(a)/(4*m)for i in range(m))<m::2])

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


for i in range(len(A)):
    B += A[i]

for i in range(len(A)):
    if A[i] >= B / (4 * M):
        count += 1
if M >= count :
    print("No")
else:
    print("Yes")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def getInput():
    return [int(i) for i in input().rstrip().split(' ')]
N, M = getInput()
A = getInput()
_4M = int(sum(A) // int((4*M) + .9))
A.sort(reverse=True)
cnt = 0
for i in A:
    if i >= _4M:
        cnt += 1
print('Yes') if cnt >= M else print('No')

Submission status: Wrong Answer

Solution code:
N,M = map(int, input().split())
A = list(map(int, input().split()))
all=0
for i in range(N):
    all+=A[i]
all = int(all/(4*M)+0.5)

count=0
for j in range(N):
    if A[j] >= all:
        count+=1
if count < M:
    print('No')
else :
    print('Yes')

Submission status: Wrong Answer

Solution code:
n, m = map(int, input().split())
A = list(map(int, input().split()))
borderline = sum(A) / (4 * m)

print('Yes' if sorted(A, reverse=True)[m-1] > borderline else 'No')

Submission status: Wrong Answer

Solution code:
b, c = map(int, input().split())
a = list(map(int, input().split()))
d = sum(a)
new_a = list(reversed(sorted(a)))
e = 0
f = 0
g = 4*c
while new_a[e] >= d/g:
    e = e+1
    if e == b:
        break
    f = f+1
if f >= c:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
N,M = map(int, input().split())
A = list(map(int, input().split()))
all=0
for i in range(N):
    all+=A[i]
all = int(all/(4*M))

count=0
for j in range(N):
    if A[j] >= all:
        count+=1
if count < M:
    print('No')
else :
    print('Yes')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def getInput():
    return [int(i) for i in input().rstrip().split(' ')]

N, M = getInput()
A = getInput()
_4M = int(sum(A)/(4*M) + .9)
A.sort(reverse=True)
print('Yes') if A[M-1] >= _4M else print('No')

Submission status: Wrong Answer

Solution code:
n,m = map(int,input().split())
a = sorted(list(map(int,input().split())),reverse=1)
asum = sum(a)
if a[m-1] >= asum//(4*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("YNeos"[sum(a[i]<sum(a)/(4*m)for i in range(m))>=m::2])

Submission status: Wrong Answer

Solution code:
n,m = map(int,input().split())
a = sorted(list(map(int,input().split())),reverse=True)
print("YNeos"[sum([sum(a)/(4*m)>=a[i] for i in range(m)])==m::2])

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n,m=map(int,input().split())
a=list(map(int,input().split()))
res = 0
for x in a:
  if x >= sum(a)/(4*m):
  	res += x

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

Submission status: Wrong Answer

Solution code:
# your code goes here
N,M = map(int,input().split())
A = list(map(int,input().split()))
T = 0
C = 0
Y = "Yes"
E = "No"
for i in range(N):
    T += A[i]
for i in range(N):
    if (A[i]*4*M) > T:
        C += 1
    if C == M:
        print(Y)
        break
if C < M:
    print(E)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n, m = map(int, input().split())
ai = list(map(int, input().split()))
required = sum(ai) / (4 * m)
print(required)
count = 0
for a in sorted(ai, reverse=True):
    if a >= required:
        count += 1
    else:
        break
print("YNeos"[count < m::2])

Submission status: Wrong Answer

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

for i in range(N):
    if A[i] < a:
        b += 1
if M < b:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N, M = map(int, input().split())
A = list(map(int, input().split()))
ans = 0
for i in range(N):
    if A[i]*4*M > sum(A):
        ans += 1

if ans >= 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("YNeos"[sum([sum(a)/(4*m)>=a[i] for i in range(m)])<m::2])

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n, m = [int(x) for x in input().split()]
sousuu = 0
kakutoku = 0

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

sousuu = sum(x)

for k in x:
    if k > (sousuu/(4*m)):
        kakutoku += 1

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

Submission status: Wrong Answer

Solution code:
n, m = map(int, input().split())
ai = list(map(int, input().split()))
lowest_required = (1 / (4 * m)) * sum(ai)
count = 0
for a in ai:
    if a >= lowest_required:
        count += 1
    else:
        break

print("YNeos"[count >= m::2])

Submission status: Wrong Answer

Solution code:
n, m = [int(x) for x in input().split()]
sousuu = 0
kakutoku = 0
x = [0]*n

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

sousuu = sum(x)

for k in x:
    if k > (sousuu/(4*m)):
        kakutoku += 1

if kakutoku >= 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('Yes' if A[M -1] * 4 * M >sum(A) else 'No')

Submission status: Wrong Answer

Solution code:
n, m = map(int, input().split())
a_lst = []
a_lst = list(map(int, input().split()))
# print()
percent = sum(a_lst) / (4 * m)
cnt = 0
for i in range(n):
    print("a", a_lst[i])
    # 同値の場合を書いてなくて1WAあほまぬけ
    if a_lst[i] >= percent:
        cnt += 1
if cnt >= m:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
n, m = map(int, input().split())
ai = list(map(int, input().split()))
d = sum(ai)
ans = 0
for a in sorted(ai, reverse=True):
    if 1 / (4 * m) * d:
        ans += 1
print("YNeos"[ans <= m::2])

Submission status: Wrong Answer

Solution code:
n, m = map(int, input().split())
ai = list(map(int, input().split()))
d = sum(ai)
ans = 0
for a in sorted(ai, reverse=True):
    if 1 / (4 * m) * d:
        ans += 1
print("YNeos"[ans < m::2])

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('No' if ans < M else 'Yes')

Submission status: Wrong Answer

Solution code:
n, m = map(int, input().split())
ai = list(map(int, input().split()))
d = sum(ai)
ans = 0
for a in sorted(ai, reverse=True):
    if 1 / 4 * d:
        ans += 1
print("YNeos"[ans < m::2])

Submission status: Wrong Answer

Solution code:
n, m = map(int, input().split())
a = list(map(int, input().split()))
a.sort(reverse=True)
sum_ = 0
for i in a:
    sum_ +=i
if(a[m-1]>=(sum_/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 = sorted(A, reverse=True, key=int)

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

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

Submission status: Wrong Answer

Solution code:
N, M = map(int, input().split())
A = list(map(int, input().split()))
vote_sum = sum(A)
cnt = 0
y = "Yes"
n = "no"

for i in range(N):
	if (A[i]*4*M) >= vote_sum:
		cnt += 1

if cnt >= M:
	print(y)
else:
	print(n)

Submission status: Wrong Answer

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

new_a=sorted(a,reverse=False)
sums=sum(a)

if new_a[0]>=sums/(m*4):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
import math
N,M = map(int,input().split())
l = [int(i) for i in input().split()]
l.sort(reverse = True)
l_sum = sum(l)
d = (1/(4*M))*l_sum
cnt = 0
 
for i in range(N):
    if l[i] > d:
        cnt += 1
    else:
        break
 
if cnt >= M:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
import math
N,M = map(int,input().split())
l = [int(i) for i in input().split()]
l.sort(reverse = True)
l_sum = sum(l)
d = 4*M / l_sum
d = int(d)
cnt = 0
 
for i in range(N):
    if l[i] > d:
        cnt += 1
    else:
        break
 
if cnt >= M:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
n, m = (int(x) for x in input().split())
num_point = [int(x) for x in input().split()]
count = 0
 
for n in num_point:
    if n > (sum(num_point) / (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())))
ans = 0
for i in range(N):
    if A[i]*4*M > sum(A):
        ans += 1

print('No' if ans < M else 'Yes')

Submission status: Wrong Answer

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

for i in range(M):
  if A[i] < sum(A) * 1 / 4*M:
    print('No')
    exit()

print('Yes')

Submission status: Wrong Answer

Solution code:
n, m = [int(x) for x in input().split()]
sousuu = 0
kakutoku = 0
x = [0]*n

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

sousuu = sum(x)

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

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

Submission status: Wrong Answer

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

total = sum(A)

for i in range(len(A)):
    if (A[i] / total) < (1 / M):
        print('{}'.format('No'))
        exit()

print('{}'.format('Yes'))

Submission status: Wrong Answer

Solution code:
n, m = map(int, input().split())
a = list(map(int, input().split()))
a.sort(reverse=True)
sum_ = 0
for i in a:
    sum_ +=i
if(a[m-1]>(sum_/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()))

new_a=sorted(a)
sums=sum(a)

if new_a[0]>=sums/(m*4):
    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)

for i in range(M):
  if A[i] < 1 / 4*M:
    print('No')
    exit()

print('Yes')

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

new_a=sorted(a)
sums=sum(a)

if new_a[m-1]>=sums/(m*4):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
n, m = [int(x) for x in input().split()]
sousuu = 0
kakutoku = 0
x = [0]*n

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

sousuu = sum(x)

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

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

Submission status: Wrong Answer

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

vote = 0


for v in list :
    vote = vote + v

judge = vote // (4 * M)

pop = 0
for x in range(0, N) :
    if list[x] > judge :
        pop = pop + 1

if pop >= 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 = 0
for i in range(len(a)):
    sum += a[i]

min_hyou = sum/(4*m)

count = 0
for i in range(len(a)):
    if min_hyou < a[i]:
        count+=1
if count>=m:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
N,M = (int(x) for x in input().split())
A_list = [int(x) for x in input().split()]
A_sum = sum(A_list)
Bool_list = []
for A in A_list:
    if A >= int(A_sum/(4*M)):
        Bool_list.append("True")
        
if (len(Bool_list)) >= M:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

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

vote = 0


for v in list :
    vote = vote + v

judge = vote / (4 * M)

pop = 0
for x in range(0, N) :
    if list[x] > judge :
        pop = pop + 1

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

Submission status: Wrong Answer

Solution code:
n, m = [int(x) for x in input().split()]
sousuu = 0
kakutoku = 0
x = [0]*n

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

sousuu = sum(x)

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

if kakutoku >= 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 = 0
for i in range(len(a)):
    sum += a[i]

min_hyou = int((1/(4*m)) * sum)

count = 0
for i in range(len(a)):
    if min_hyou <= a[i]:
        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().strip().split()))[:n]
new_papa = sorted(a, reverse=True)
Sum=sum(a)
if(new_papa[m-1]>=Sum/(m*4)):
    print("YES")
else:
    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]
#print(A_fav, Flag)
if len(A_fav) >= M:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
n, m = [int(x) for x in input().split()]
sousuu = 0
kakutoku = 0
x = [0]*n

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

sousuu = sum(x)

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

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

Submission status: Wrong Answer

Solution code:
N, M = map(int, input().split())
A = list(map(int, input().split()))
counter = 0
for i in range(N):
  if A[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()))

b=sorted(a)
zyo=sum(b)/(4*m)

if b[m-1]>zyo:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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



def check(A,M):
    flag = 0
    condition = sum(A)/(4*M)
    if(M==1 and max(A)>condition):
        return "Yes"
    for i in A:
        if(i < condition):
            continue
        elif(i > condition):
            flag+=1
            if(flag==M):
                return "Yes"
    return "No"

print(check(A,M))

Submission status: Wrong Answer

Solution code:
n, m = map(int,input().split())
a = list(map(int,input().strip().split()))[:n]
a.sort(reverse=True)
count=0
Sum=sum(a)
if(a[m-1]>=Sum/(m*4)):
    print("YES")
else:
    print("No")

Submission status: Wrong Answer

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



def check(A,M):
    flag = 0
    condition = sum(A)/(4*M)
    if(M==1 and max(A)>condition):
        return "Yes"
    for i in A:
        if(i <= condition):
            continue
        else:
            flag+=1
    if(flag>=M):
        return "Yes"
    else:
        return "No"

print(check(A,M))

Submission status: Wrong Answer

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

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

if a[m-1]>sum:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

#s = sum(l)
s = 0
for i in l:
    s += i
    

l = sorted(l,reverse=True)



x = s * (1 / 4*m)
ans = 0


for i in range(m):
    if(l[i] >= x):
        ans = ans + 1

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

Submission status: Wrong Answer

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

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

print("Yes" if m <= ok_count else "No")

Submission status: Wrong Answer

Solution code:
import math
n,m=map(int,input().split())
a=list(map(int,input().split()))
t=sum(a)
a=list(filter(lambda x: math.ceil(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())
A = list(map(int, input().split()))
x = sum(A)/(4*m)
count = 0
for i in range(0, n-1):
    if A[i] >= x:
        count += 1
if count >= m:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
# your code goes here
N,M = map(int,input().split())
A = list(map(int,input().split()))
T = 0
C = 0
Y = "Yes"
E = "No"
for i in range(N):
    T += A[i]
for i in range(N):
    if C >= M:
        print(Y)
        break
    if (A[i]*4*M) > T:
        C += 1
if C < M:
    print(E)

Submission status: Wrong Answer

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

#s = sum(l)
s = 0
for i in l:
    s += i
    
print('s=%d' %s)

l = sorted(l,reverse=True)

print(l)

x = s * (1 / 4*m)
ans = 0

print('x = %d' %x)


for i in range(m):
    if(l[i] >= x):
        ans = ans + 1

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

Submission status: Wrong Answer

Solution code:
N,M = map(int,input().split())
A = list(set((map(int,input().split()))))
print(A)
vote=[]
for Ai in A:
    if Ai>=(1/(4*M)*sum(A)):
        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(set((map(int, input().split()))))
print(A)
vote = []
for Ai in A:
    if Ai >= (1 / (4 * M) * sum(A)):
        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(map(int, input().split()))
count=[i for i in A if i>=sum(A)*(1/4*M)]
if len(count)>=M:
    print("Yes")
elif len(count)<M:
    print("No")

Submission status: Wrong Answer

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

lmt = sum(P) / (4*m)

if lmt < P[-1*m]:
    print('Yes')
else:
    print('No')