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:
a,a1 = input().split()
b = input().split()
sum = 0
for _ in b:
    sum += int(_)
if int(b[int(a1)-1]) >= sum/(4*int(a)):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
a,a1 = input().split()
b = input().split()
sum = 0
for _ in b:
    sum += int(_)
if int(b[int(a1) - 1]) >= sum/(4*int(a1)):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
a,a1 = input().split()
b = input().split()
sum = 0
for _ in b:
    sum += int(_)
if int(b[int(a1) - 1]) < sum/4:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
a,a1 = input().split()
b = input().split()
sum = 0
for _ in b:
    sum += int(_)
if int(b[int(a1) - 1]) > sum/4:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
a,a1 = input().split()
b = input().split()
sum = 0
for _ in b:
    sum += int(_)
if int(b[int(a1) - 1]) > sum/4:
    print(True)
else:
    print(False)

Submission status: Wrong Answer

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

k = 0

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

if k >= 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 sorted(A,reverse=True)[M-1]>sum(A)/4/M:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
N, M = map(int, input().split())
lst = [int(x) for x in input().split()]
total = sum(lst)
ret = 0
for x in lst:
    if x > total / (4 * M):
        ret += 1

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

Submission status: Wrong Answer

Solution code:
N,M = input().split()
N = int(N)
M = int(M)
count = 0
import numpy as np
a = np.array(input().split()).astype(int)
count = len(a>=1/(4*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()))


Change=True
round=1
while Change:
    print("{}週目".format(round))
    Change=False
    for i in range(N-1):
        if A[i+1]>A[i]:
            print("A[{}]({})がA[{}]({})よりも大きいため、交換を行います".format(i+1,A[i+1],i,A[i]))
            temp=A[i+1]
            A[i+1]=A[i]
            A[i]=temp
            Change=True
            print(A)
    round+=1
print("for文終了後のChangeが{}なので、ソートを終了します".format(Change)) 
print(A)
popular=A[0:M]
print("投票数上位{0}個の商品を抽出しました。{0}個の商品の投票数は{1}です。".format(M,popular))
SUM=sum(A)
print("投票数の総和は{}です".format(SUM))

count=True
for j in range(M):
    if SUM*(1/(4*M))>popular[j]:
        print("popular[{0}]({1})は,総投票数の1/8未満({1}<{2})の為、回答はNoとなります".format(j,popular[j],SUM*(1/(4*M))))
        count=False

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

Submission status: Wrong Answer

Solution code:
N,M = map(int,input().split())
n = list(map(int,input().split()))
goukei = sum(n)
ans = 0
for i in n:
    if i >= 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()))
c=round(sum(a)/(4*m))
b=0
for i in a:
    if i>=c:
        b+=1
if b>=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=round(sum(a)/(4*m))
b=0
for i in a:
    if i>c:
        b+=1
if b>=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)//(4*m)
b=0
for i in a:
    if i>=c:
        b+=1
if b>=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)//(4*m)
b=0
for i in a:
    if i>c:
        b+=1
if b>=m:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

sum = 0
cnt = 0

for i in Ai:
	sum += i

for _ in Ai:
  if _ >= sum*(1/(4*m)):
    cnt +=1
  else:
    continue
    
if m >= cnt:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

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

sum = 0
cnt = 0

for i in Ai:
	sum += i

for _ in Ai:
  if _ >= sum*(1/(4*m)):
    cnt +=1
  else:
    continue
    
if m == cnt:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

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

sum = 0
cnt = 0

for i in numList:
	sum += i

for _ in numList:
  if _ > sum/(4*m):
    cnt +=1
  else:
    continue
    
if m >= cnt:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

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

sum = 0
cnt = 0

for i in numList:
	sum += i

for _ in numList:
  if _ > sum/(4*m):
    cnt +=1
  else:
    continue
    
if m == cnt:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

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

sum = 0
cnt = 0
for i in numList:
	sum += i

for _ in numList:
  if _ > sum/(4*m):
    cnt +=1
  else:
    continue
    
if m >= cnt:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

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

sum = 0
for i in numList:
	sum += i

for _ in numList:
  if _ > sum/(4*m):
    continue
  else:
    print("No")
    exit
    
print("Yes")

Submission status: Wrong Answer

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

sum = 0
for i in numList:
	sum += i

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

Submission status: Wrong Answer

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

y = 0
n = 0

for i in numList:
  if i > 1/(4*m):
    y +=1
  else:
    n +=1
    
if y > m:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

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

ct = 0
for i in v:
    if i>t:
        ct += 1
        
if ct >= m:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
n, m = map(int, input().split())
products = list(map(int, input().split()))
line = sum(products) / (4 * m)
bools = [1 if i > line else 0 for i in products]
if sum(bools) >= m:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
numbers = input()
numberVotes, numberItems = numbers.split(" ")

votes = input()
votes = votes.split(" ")
totalVotes = sum([int(x) for x in votes])
thrashold = int(totalVotes/(4 * int(numberItems)))
filtered = list(filter(lambda item: int(item) >= thrashold, votes))
x = "No"
if len(filtered) >= int(numberItems):
  x = "Yes"
print(x)

Submission status: Wrong Answer

Solution code:
import math
# お気楽ロジックが思い浮かばないので真っ当に解く
N, M = (int(x) for x in input().split(' '))
A = [int(x) for x in input().split(' ')]
# 基準となる閾値を求める
limen = math.floor(sum(A) / ( M * 4))
# 閾値越えの値を全探索
ans = 0
for row in A:
  if row >= limen:
    ans += 1
# 回答
print( 'Yes' if ans >= M else 'No' )

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

Solution code:
n, m = map(int, input().split())
syohin = []
syohin = sorted(input().split(), reverse = True)
b = 0
for a in syohin:
  b += int(a)
if int(syohin[m-1]) > b *  (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()))

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

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

Submission status: Wrong Answer

Solution code:
check=True
a,b=map(int,input().split())
l=list(map(int,input().split()))
l.sort()
l.reverse()
point=sum(l)//(4*b)
for i in range(b):
    if l[i]<point:
        check=False
        break
if check:
    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 x in A:
    if x > sum(A) / (4 * M):
        cnt += 1

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

Submission status: Wrong Answer

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

x = max(a)
s = 0
for i in a:
    s += i
y = [l for l in a if l >=s]
if len(y) >=m:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
N, M = map(int, input().split())
A = map(int, input().split())
m = sum(A)/(4*M)
n = sum(1 for i in A if i >= m)
print(["No", "Yes"][n >= M])

Submission status: Wrong Answer

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

votes = input().split()
votes = [int(i) for i in votes]
votes.sort(reverse=True)

total = sum(votes)

valid = True
for i in range(m):
    if votes[i] <= total/(4*m):
        valid = False
        break

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

Submission status: Wrong Answer

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

votes = input().split()
votes = [int(i) for i in votes]
votes.sort(reverse=True)

total = sum(votes)

valid = True
for i in range(m):
    if votes[i] <= total/(4*m):
        valid = False
        break

if valid:
    print('yes')
else:
    print('no')

Submission status: Wrong Answer

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

votes = input().split()
votes = [int(i) for i in votes]
votes.sort()

total = sum(votes)

valid = True
for i in range(m):
    if votes[i] <= total/(4*m):
        valid = False
        break

if valid:
    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]*4*(j+1)>=k:
        flag+=1
if flag<y:
    print("No")
else:
    print("Yes")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

item.sort(reverse=True)

s = sum(item)
res = 0
for i in range(n):
  if item[i] >= s / (4*m):
    res += 1
    if res >= m:
      print('Yes')
  else:
    print('No')

Submission status: Wrong Answer

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

item.sort(reverse=True)

s = sum(item)
res = 0
for i in range(n):
  if item[i] > s / (4*m):
    res += 1
    if res >= m:
      print('Yes')
  else:
    print('No')

Submission status: Wrong Answer

Solution code:
am,n = list(map(int,input().split()))
arr = list(map(int,input().split()))
got = 0
for i in range(am):
    if arr[i]>=1/(4*n):
        got+=1
if got >=n:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
am,n = list(map(int,input().split()))
arr = list(map(int,input().split()))
got = 0
for i in range(am):
    if arr[i]>=1/(4*am):
        got+=1
if got >=n:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
am,n = list(map(int,input().split()))
arr = list(map(int,input().split()))
got = 0
for i in range(am):
    if arr[i]>=1/(4*am):
        got+=1
if got >=n:
    print("YES")
else:
    print("NO")

Submission status: Wrong Answer

Solution code:
N,M = map(int,input().split())
items = list(map(int,input().split()))
threshold = sum(items) * (1/(4*M))

selected = [i for i in items if i > threshold]
print("Yes" if len(selected) >= M else "No")

Submission status: Wrong Answer

Solution code:
N,M = map(int,input().split())
items = list(map(int,input().split()))
threshold = sum(items)/4*M

selected = [i for i in items if i > threshold]
print("Yes" if len(selected) > M else "No")

Submission status: Wrong Answer

Solution code:
N,M = map(int,input().split())
items = list(map(int,input().split()))
threshold = sum(items) * (1/(4*M))

selected = [i for i in items if i >= threshold]
print("Yes" if len(selected) > M else "No")

Submission status: Wrong Answer

Solution code:
N,M = map(int,input().split())
items = list(map(int,input().split()))
threshold = sum(items) * (1/(4*M))

selected = [i for i in items if i > threshold]
print("Yes" if len(selected) >= M else "No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N, M = map(int, input().split())
A = list(map(int, input().split()))
A.sort(reverse = True)
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 = list(map(int, input().split()))
all = sum(A)
border = int(all / (4 * M))

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

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

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n,m=map(int, input().split())
a=list(map(float, input().split()))
A=sum(a)/(4*m)
N=sum(x>=A for x in a)
if N>=m:
    print("yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
n,m=map(int, input().split())
a=list(map(int, input().split()))
g=0
count=0
for i in a:
    g+=i
b = float(1/(4*m))
for i in a:
    t = float(i/g)
    if t>b:
        count+=1
    if count==m:
        print("Yes")
        exit()
if count < m:
    print("No")

Submission status: Wrong Answer

Solution code:
n,m=map(int, input().split())
a=list(map(int, input().split()))
g=0
count=0
for i in a:
    g+=i
b = float(1/(4*m))
for i in a:
    t = float(i/g)
    if t>b:
        count+=1
    if count==m:
        print("yes")
        exit()
if count < m:
    print("no")

Submission status: Wrong Answer

Solution code:
s=input()
nn=s.split()
n=int(nn[0])
m=int(nn[1])
s=input()
aa=s.split()
a=[]
tot=0
for i in range(0,len(aa)):
	a.append(int(aa[i]))
	tot+=a[i]
num=0
for i in a:
	if i>tot/(4*m) :
		num+=1
if num>=m :
	print('Yes')
else:
	print('No')

Submission status: Wrong Answer

Solution code:
n, m = map(int, input().split())
votes = list(map(int, input().split()))
total = sum(votes)
satisfied = [x for x in votes if x >= total * (1/(4*m))]
if len(satisfied) > m:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
N, M = map(int, input().split())
A = list(map(int, input().split()))
 
vote = []
all = 0
 
for j in range(N):
    all += A[j]
 
for i in range(N):
    if A[i] > all // (4 * M):
        vote.append(A[i])
 
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()))

vote = []
all = 0

for j in range(N):
    all += A[j]

for i in range(N):
    if A[i] >= all // (4 * M):
        vote.append(A[i])

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

vote = []
all = 0

for j in range(N):
    all += A[j]

for i in range(N):
    if A[i] > all // (4 * M):
        vote.append(A[i])

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

a.sort()


for i in range(m + 1):
    if a[i] > sum/(4*m):
        print("No")
        exit()
        
print("Yes")

Submission status: Wrong Answer

Solution code:
def ans():
    n ,m = map(int, raw_input().split())
    A = sorted(list(map(int, raw_input().split())), reverse = True)
    divider = sum(A) / (4 * m + 1e-16)
    for i in range(m):
        if A[i] <= int(divider):
            return 'No'
    return 'Yes'
print ans()

Submission status: Wrong Answer

Solution code:
def ans():
    n ,m = map(int, raw_input().split())
    A = sorted(list(map(int, raw_input().split())), reverse = True)
    divider = sum(A) / (4 * m + 1e-16)
    for i in range(m):
        if A[i] <= round(divider,0):
            return 'No'
    return 'Yes'
print ans()

Submission status: Wrong Answer

Solution code:
def ans():
    n ,m = map(int, raw_input().split())
    A = sorted(list(map(int, raw_input().split())), reverse = True)
    divider = sum(A) / (4 * m + 1e-16)
    for i in range(m):
        if A[i] <= divider:
            return 'No'
    return 'Yes'
print ans()

Submission status: Wrong Answer

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

x= list(map(int,input().strip().split()))
count =0 
sum=0
for i in range (0,len(x)):
    sum+=x[i]
    
for j in range (0,len(x)):
    if (x[j]>(sum/4*a[1])):
        count+=1 
    
if (count>=a[1]):
    print ("yes")
else:
    print ("no")

Submission status: Wrong Answer

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

x= list(map(int,input().strip().split()))
count =0 
sum=0
for i in range (0,len(x)):
    sum+=x[i]
    
for j in range (0,len(x)):
    if (x[j]>=(sum/4*a[1])):
        count+=1 
    
if (count>=a[1]):
    print ("yes")
else:
    print ("no")

Submission status: Wrong Answer

Solution code:
from math import floor
n, m = map(int, input().split())
a = list(map(int, input().split()))
c = floor(sum(a) / (4 * m))
d = 0
for e in a:
    if e >= c:
        d += 1
        if d == m:
            print('Yes')
            exit(0)
print('No')

Submission status: Wrong Answer

Solution code:
n ,m = map(int, raw_input().split())
A = sorted(list(map(int, raw_input().split())), reverse = True)
divider = sum(A) / (4 * m) 

stack = 0
for a in A:
    if a >= divider:
        stack += 1

if stack == 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) / (4 * m))
d = 0
for e in a:
    if e >= c:
        d += 1
        if d == m:
            print('Yes')
            exit(0)
print('No')

Submission status: Wrong Answer

Solution code:
n ,m = map(int, raw_input().split())
A = sorted(list(map(int, raw_input().split())), reverse = True)
divider = sum(A) / (4 * m) 

stack = 0
for i in range(m):
    if A[i] >= divider:
        stack += 1

if stack == 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) / (4 * n)
d = 0
for e in a:
    if e >= c:
        d += 1
        if d == m:
            print('Yes')
            exit(0)
print('No')

Submission status: Wrong Answer

Solution code:
N, M = map(int, input().split())
*a, = 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, = map(int, input().split())
ttl = sum(a) / (4*M)
a.sort(reverse=True)
if a[M-1] > (sum(a) / (4*M)):
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
def ans():
    n ,m = map(int, raw_input().split())
    A = sorted(list(map(int, raw_input().split())), reverse = True)
    divider = sum(A) / (4 * m) 

    for i in range(m):
        if A[i] < divider:
            return 'No'
    return 'Yes'

print ans()

Submission status: Wrong Answer

Solution code:
def ans():
    n ,m = map(int, raw_input().split())
    A = sorted(list(map(int, raw_input().split())), reverse = True)
    divider = (sum(A) / (4 * m + 1e-21))
    
    print sum(A), 4*m
    print divider
    print A

    for i in range(m):
        if A[i] < round(divider,0):
            return 'No'
    return 'Yes'

print ans()

Submission status: Wrong Answer

Solution code:
N, M = map(int, input().split())
*a, = map(int, input().split())
ttl = sum(a) // (4*M)
cnt = 0
for i in range(N):
    if a[i] < ttl:
        continue
    else:
        cnt += 1
        if cnt >= M:
            print('Yes')
            exit()
print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def ans():
    n ,m = map(int, raw_input().split())
    A = sorted(list(map(int, raw_input().split())), reverse = True)
    divider = float(sum(A) / (4 * m))

    for i in range(m):
        if A[i] < divider:
            return 'No'
    return 'Yes'

print ans()

Submission status: Wrong Answer

Solution code:
def ans():
    n ,m = map(int, raw_input().split())
    A = list(map(int, raw_input().split()))
    divider = float(sum(A) / (4 * m))

    A_copy = []
    for a in A:
        if a >= divider:
            A_copy.append(a)
    
    if len(A_copy) >= m:
        return 'Yes'
    else:
        return 'No'  


print ans()

Submission status: Wrong Answer

Solution code:
def ans():
    n ,m = map(int, raw_input().split())
    A = list(map(int, raw_input().split()))
    divider = float(sum(A) / (4 * m))

    stack = 0
    for a in A:
        if stack == m:
            return "Yes"
        
        if a >= divider:
            stack += 1

    return "No"        


print ans()

Submission status: Wrong Answer

Solution code:
def ans():
    n ,m = map(int, raw_input().split())
    A = list(map(int, raw_input().split()))

    divider = sum(A) / (4 * m + 1e-16)

    stack = 0
    for a in A:
        if stack == m:
            return "Yes"
        
        if a >= divider:
            stack += 1

    return "No"        


print ans()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

count = 0
sum_total = sum(A)

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


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

Submission status: Wrong Answer

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

count = 0
sum_total = sum(A)

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


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

Submission status: Wrong Answer

Solution code:
n,m=map(int,input().split())
c=0
v=list(map(int,input().split()))
s=sum(v)
v.sort(reverse=True)
val=s/(m*4)
if(v[m-1]>=val):
	print("YES")
else:
	print("NO")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n,m=map(int,input().split())
m=4*m
m1=m//4
c=0
v=list(map(int,input().split()))
s=sum(v)
val=s/m
for i in range(n):
	if(val<=v[i]):
		c=c+1
if(c>=m1):
	print("YES")
else:
	print("NO")

Submission status: Wrong Answer

Solution code:
from math import *
from copy import *
from string import *				# alpha = ascii_lowercase
from random import *
from sys import stdin
from sys import maxsize
from operator import *				# d = sorted(d.items(), key=itemgetter(1))
from itertools import *
from collections import Counter		# d = dict(Counter(l))



n,m=map(int,input().split())
m=4*m
m1=m//4
c=0
v=list(map(int,input().split()))
s=sum(v)
val=s//m
for i in range(n):
	if(val<=v[i]):
		c=c+1
if(c>=m1):
	print("YES")
else:
	print("NO")

Submission status: Wrong Answer

Solution code:
N,M=map(int,input().split())
arr=list(map(int,input().split()))
total=sum(arr)
arr2=[]
for i in (arr):
    if(i>=(total//(4*M)+1)):
        arr2.append(i)
if(len(arr2)>=M):
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

s = sum(a)
cnt = 0

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

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

Submission status: Wrong Answer

Solution code:
n,m = input().split()
N = int(n)
M = int(m)
a = [int(i) for i in input().split()]
a.sort(reverse=True)
k = sum(a)//(4*M)
if a[M-1] >= k:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
N,M=map(int,input().split())
arr=list(map(int,input().split()))
total=sum(arr)
arr2=[]
for i in (arr):
    if(i>=(total//(4*M))):
        arr2.append(i)
if(len(arr2)>=M):
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
def solve(n, m, a):
    return "Yes" if sorted(a)[-m] >= sum(a) // (4*m) else "No"

n, m = map(int, input().split())
a = list(map(int, input().split()))
print(solve(n, m, a))

Submission status: Wrong Answer

Solution code:
#ABC161B
import sys
N, M = map(int, sys.stdin.readline().split())
A = list(map(int, sys.stdin.readline().split()))
A.sort(reverse=True)
S = sum(A)
for a in A[:M+1]:
    if a/S - 1/(4*M) <0:
        print('No')
        break
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)
suma = sum(a)
if a[m - 1] >= suma * (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)
suma = sum(a)
if a[n - 1] >= suma * (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)
suma = sum(a)
if a[n - 1] * (4 * m) >= suma:
    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)
suma = sum(a)
if a[n - 1] <= suma*(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)
suma = sum(a)
if a[n - 1] * (4 * m) <= suma:
    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)
cnt = 0
for a in A:
  if a < x:
    continue
  cnt += 1
ans = 'Yes' if cnt >= m else 'No'
print(ans)

Submission status: Wrong Answer

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

a.sort(reverse=True)
serect = True
for i in range(m):
    if a[i] * (4 * m) <= sum(a):
        serect = False
if serect:
    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)
cnt = 0
for a in A:
  if a >= x:
    cnt += 1
ans = 'Yes' if cnt >= m else 'No'
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

counter = 0
for a in li_a:
    if a > (s / (4 * m)):
        counter += 1
if m <= counter:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

num = sum(A_list)/(4*M)

A2_list = [s for s in A_list if s >= int(num)+1]

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

total_votes = sum(a_list)

print(a_list[m-1])

if a_list[m-1] < total_votes / (4 * m):
    print('Yes')
else:
    print('No')