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())
arr = list(map(int,input().split()))
arr.sort()
M = sum(arr)//(2*m)
cnt = 0
for i in range(n):
  if cnt == m:
    break
  if arr[i] > M:
    cnt+=1
if cnt == m or cnt > m:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
NM=input().split()
M=int(NM[1])
a=input().split()
a_list=[]
for i in a :
  a_list.append(int(i))
a_list.sort(reverse=True)
sum1=sum(a_list)
 
flag=True
for i,youso in enumerate(a_list) :
  if(youso*4*M<sum1 and i+1<=M) :
    print(youso)
    flag=False
    break
    
if flag==True :
  print('Yes')
else :
  print('No')

Submission status: Wrong Answer

Solution code:
n, m   = map(int, input().split())
a =list(map(int, input().split()))
b = [i  for i in a if i > 1/(4*m)]

if len(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()))
ans = 0
total = 0
 
for i in range(len(A)):
    total += A[i]
print(total)
 
A = sorted(A, reverse=True)
print(A)
for i in range(M):
    if(A[i] >= total/(4*M)):
        ans += 1
        print("p")
    else:
        ans += 0
        print("s")
if(M == ans):
    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()]
threshold = float(sum(A) / (4 * M))
cnt=0
for i in A:
  if i > threshold:
    cnt += 1
if cnt >= M:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
n,m=map(int,raw_input().split())
a=sorted(map(int,raw_input().split()))
s=sum(a)//(4*m)
print 'No' if a[n-m]<s or m>n else 'Yes'

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):
            flag+=1
        if(flag==M):
            return "Yes"
    return "No"

print(check(A,M) if M<=N else "No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
m = input()
a = list(input())
x = int(0)

n, m = m.split()
n = int(n)
m = int(m)

list.sort(a)

for i in range(len(a)- 1, n, -1):
    x += int(a[i])

for i in range(len(a)- 1, len(a) - m -1, -1):
    if int(a[i]) // 4 * int(m) < 0:
        print('No')
        exit()

print('Yes')

Submission status: Wrong Answer

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

total=sum(N_list)
print(total)
total=total/4
print(total)
counter=0
for number in N_list:
  if number>total/4:
    counter+=1
    
if counter>=M:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

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

for i in a_list:
    if i > sum(a_list)/(4*m):
        b.append(i)

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

Submission status: Wrong Answer

Solution code:
a,b = map(int, input().split())
c = input().split()
m = 0
for i in range(len(c)):
    c[i] = int(c[i])
    m += c[i]
c.sort(reverse=True)
if c[b-1] >= m * (1 / (4*b)):
    print('Yes')
else:
    print('No')
print(m*(1/(4*b)))

Submission status: Wrong Answer

Solution code:
m = input()
a = list(input())
x = int(0)

n, m = m.split()
n = int(n)
m = int(m)

list.sort(a)

for i in range(len(a)- 1, n, -1):
    print(i)
    x += int(a[i])

for i in range(len(a)- 1, len(a) - m -1, -1):
    print(i)
    if int(a[i]) // 4 * int(m) < 0:
        print('No')
        exit()

print('Yes')

Submission status: Wrong Answer

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

A = []
kosuu = 0

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

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

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

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

Submission status: Wrong Answer

Solution code:
n,m = map(int,input().split())
arr = list(map(int,input().split()))
arr.sort()
M = sum(arr)//(2*m)
cnt = 0
for i in range(n):
  if cnt == m:
    break
  if arr[i] >= M:
    cnt+=1
if cnt == m or cnt > 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()))
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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N,M = map(int, input().split())
list_A = input().split()
list_A_int = [int(s) for s in list_A]
list_A_int_sort = sorted(list_A_int, reverse=True)

print(list_A_int_sort)

compare_num = 1/(4*M)

if list_A_int_sort[M-1] < compare_num:
  print("No")
else:
  print("Yes")

Submission status: Wrong Answer

Solution code:
N,M =  map(int,input().split())
L=  [int(x) for x in input().split()]
L.sort(reverse=True)
for x in range(M):
    if float(L[x]) < sum(L) // (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()))
counter=0
for i in a:
    if i > sum(a)/4/m:
        counter+=1
print('Yes' if counter>=m else 'No')

Submission status: Wrong Answer

Solution code:
p,q= input().split()
a,b =(int(p), int(q))
s = input().split()
total = 0
for i in range(b):
    total += int(s[i])
if total >= a:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

a = sorted(A, reverse=True)

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

if a[M-1]>e:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
cl1 = input().split()
cl2 = input().split()
n = int(cl1[0])
m = int(cl1[1])
cl1 = [int(s) for s in cl1]
cl2 = [int(s) for s in cl2]
sum= 0.0
for i in range(n):
    sum = cl2[i]+ sum
cl2 = sorted(cl2,reverse=True)
if(cl2[m-1] < sum//(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()))
cnt = 0
ans = 0

for i in range(N):
  cnt += A[i]

x = cnt // (4*M)

print(x)

for i in range(N):
  if x <= A[i]:
    ans += 1

print(ans)

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

Submission status: Wrong Answer

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

l=list(map(int,input().split()))
s=sum(l)
ans=0
t=s/(4*m)
for i in l:
    if i>=math.ceil(t):
        print(i,math.ceil(t))
        ans+=1
if ans>=m:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N, M = map(int, input().split())
N = input().split()
A = []
soutoku = 0
for i in N:
    soutoku += int(i)
N = sorted(N, reverse=True)
for i in range(M):
    A.append(N[i])

b = soutoku / (4*M)
if int(N[int(M-1)]) < int(b):
    print("No")
else:
    print("Yes")

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)
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()))
A.sort(reverse=True)

n = M - 1
K = sum(A)

if A[n] < K // (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.sort(reverse=True)
vote = sum(a)
for i in range(m):
    if a[i] < max(1, vote // (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()))

ans = "Yes"
sum_M = sum(A)
an = 0
for i in range(M):
    if A[i] >= sum_M/(4*M):
        an += 1
        
if an<M:
    ans = "No"

print(ans)

Submission status: Wrong Answer

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

list = input().split()

m = int(m)
list = [int(i) for i in list]
list.sort(reverse=True)

M = m
i = 0
while 1:
    if m == 0:
        break
    
    if list[i] >= sum(list)/(4*M):
        ans = "Yes"
    else:
        print("n")
        ans = "No"
        
    m-=1
    i+=1

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math

S =  list(map(int,input().split()))
N = S[0]
M = S[1]
A =  list(map(int,input().split()))

As = sorted(A,reverse=True)
r = []
s = sum(A)
for i in range(M):
    if As[i] > s*(1/4)*(1/M):
        r.append(As[i])
        if len(r) == M:
            print('Yes')
        
    else:
        print('No')

Submission status: Wrong Answer

Solution code:
import numpy as np
N, M = map(int, input().split())
al = list(map(int, input().split()))
sums = sum(al)
al.sort(reverse=True)
al = np.array(al)[:M]
al = np.sum(al>(sums/(4*M)))
if al == M:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
p,q= input().split()
a,b =(int(p), int(q))
s = input().split()
total = 0
for i in range(b):
    total += int(s[i])
if total >= a:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

A_sum =sum(A)

ans = 0
for i in range(N-1):
    if A[i] > int(A_sum//(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()))

#総投票数
s = sum(a)

a.sort(reverse=True)

b = 0

for i in range(m): 
  if a[i] < s/(4*m) :
    b += 1
    
if b == m :
  print("Yes")
else :
  print("No")

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())
l=list(map(int,input().split()))
t=sum(l)//(4*b)
ans = [True for i in range(b-1,len(l)-b) if sum(l[i:i+b])]
print('Yes' if ans and all(ans) else 'No')

Submission status: Wrong Answer

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

a = sorted(A, reverse=True)

b = sum(a)//4*M

if a[M-1]<b:
  print('No')
else:
  print('Yes')

Submission status: Wrong Answer

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

A = []
kosuu = 0

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

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

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

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

Submission status: Wrong Answer

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

N, M = getInput()
A = getInput()
_4M = int(sum(A)/(4*M) + .9)
print(_4M)
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:
cl1 = input().split()
cl2 = input().split()
n = int(cl1[0])
m = int(cl1[1])
cl1 = [int(s) for s in cl1]
cl2 = [int(s) for s in cl2]
sum= 0.0
for i in range(n):
    sum = cl2[i]+ sum
cl2 = sorted(cl2,reverse=True)
if(cl2[m-1] > sum//(4*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()]

for i in range(n):
    sousuu += int(x[i])

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

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

Submission status: Wrong Answer

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

if N==0:
    print(0)

N=min(N%K,K-N%K)
cand1=abs(N-K)
cand2=abs(cand1-K)
print(min(N,cand1,cand2))

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)/4*M)]
if len(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:
a,b=map(int,input().split())
l=list(map(int,input().split()))
t=sum(l)//(4*b)
ans = [True for i in range(b,len(l)-b) if sum(l[i:i+b])]
print('Yes' if ans and all(ans) else 'No')

Submission status: Wrong Answer

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

if N==0:
    print(0)

N=min(N%K,K-N%K)
cand1=abs(N-K)
cand2=abs(cand1-K)
print(N,cand1,cand2)

Submission status: Wrong Answer

Solution code:
i1 = input()
i2 = input()

# i1 = "4 1"
# i2 = "5 4 2 1"
list1 = [int(s) for s in i1.split()]
list2 = [int(s) for s in i2.split()]

n = list1[0]
m = list1[1]


total = sum(list2)

# 選べる
count = 0

for a in range(n):
    if (list2[a]/total >= 1/(4*m)):
        count += 1 

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

Submission status: Wrong Answer

Solution code:
import math
n, m = map(int, input().split())
a = sorted(list(map(int,input().split())))
suma = math.floor(sum(a) / (4 * m))
count = True
#print(a[n - 1])
for i in range(m):
    if a[n - 1 - i] < suma:
        count = False
print("Yes" if count == True else "No")

Submission status: Wrong Answer

Solution code:
N, M = map(int, input().split())
List = list(map(int, input().split()))
total = 0
for n in range(N):
    total += List[n]
limit = total/(4*M)
count = 0
for n in range(N):
    if List[n] >= limit:
        count += 1
if count >= M:
    print("yes")
else:
    print("no")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

c = sum(li) / (4*M)
res = 0
for l in li:
    if l >= c:
        res += 1
print(c)
print(res)
if res >= 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)
c=0

for i in A:
    if (1/(M*4))**10 < (i/S)**10:
        c+=1
print("Yes" if M<=c else "No")

Submission status: Wrong Answer

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

A = []
kosuu = 0

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

tmp = sum(A)//4*M

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:

NM = input("").split()
A = list(map(int, input().strip().split()))

N = int(NM[0])
M = int(NM[1])
ALL = sum(A)
k = 0
c = ALL/(4*M)

print(N, M, ALL, c)
for Ai in A:
    if Ai>=c:
        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()))



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

print(check(A,M))

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:
    n > sum(num_point) * 1 / (4 * m)
    count += 1

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

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())
l=list(map(int,input().split()))
t=sum(l)//(4*b)
ans = [True for i in range(len(l)-3) if sum(l[i:i+3])]
print('Yes' if ans and all(ans) else 'No')

Submission status: Wrong Answer

Solution code:
cl1 = input().split()
cl2 = input().split()
n = int(cl1[0])
m = int(cl1[1])
cl1 = [int(s) for s in cl1]
cl2 = [int(s) for s in cl2]

sum= 0.0
for i in range(n):
    sum = cl2[i]+ sum
cl2 = sorted(cl2,reverse=True)
if(cl2[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()))
popu = 0
p = sum(A) // (4*M)

for num in A:
    if num >= p:
        popu += 1

if popu >= 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()]

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

def cumsum(xs):
  result = [xs[0]]
  for x in xs[1:]:
    result.append(result[-1] + x)
  return result
C = A

C.sort()
C = C[-M:]

B = cumsum(A)

print(C)
print((1/(4*M))*(B[len(A)-1]))

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

Submission status: Wrong Answer

Solution code:
a = input()
numbers = a.split()
b = input()
votes = b.split()
total = 0
try:
    for j in range(len(numbers)):
        numbers[j] = int(numbers[j])
    for l in range(len(votes)):
        votes[l] = int(votes[l])
    for k in votes:
        total = total + int(k)
    check = total/(4*int(numbers[1]))
    items = 0
    for i in votes:
        if int(i)>check:
            items = items+1
    if items >= int(numbers[1]):
        print("Yes")
    else:
        print("No")
except ValueError:
    print("No")

Submission status: Wrong Answer

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

total_vote = sum(item_vote)
item_vote = sorted(item_vote, reverse=True)
boder = total_vote/4*M
print(item_vote, boder)
if item_vote[M-1] >= boder:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

top_vote_ls = []
selectable = (1/(4*m))*sum(vote_ls)

for i in range(0, m):  
  max = 0
  for j in range(len(vote_ls)):      
    if vote_ls[j] > max: 
      max = vote_ls[j]; 
  vote_ls.remove(max); 
  if max > selectable:
    top_vote_ls.append(max) 

if len(top_vote_ls) < m: 
  print("No")
else:
  print("Yes")

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())
l=list(map(int,input().split()))
t=sum(l)//(4*b)
ans = [True for i in range(b,len(l)-3) if sum(l[i:i+3])]
print('Yes' if ans and all(ans) else 'No')

Submission status: Wrong Answer

Solution code:
n, m = map(int, input().split())
# n, m = map(int, "12 3".split())
# inputText2 = "4 56 78 901 2 345 67 890 123 45 6 789"
inputText2 = input()
input2List = list(map(int,inputText2.split()))
sortList = sorted(input2List, reverse=True)
# print(sortList) #380 19 1000
total = sum(sortList)
# print(total)
h = (1/4*m) * total
# print(h)
flg = False
resultTotal = 0
for i in range(m):
    resultTotal += sortList[i]

if resultTotal < h:
    print("No")
else:
    print("Yes")

Submission status: Wrong Answer

Solution code:
N, M = map(int, input().split())
A = list(map(int, input().split()))
t = 0
S = 0
for Ai in A:
    S=S+Ai

for Ai in A:
    if Ai >= S/(4*M):
        t = t+1

if t >= M:
    print('yes')
else:
    print('no')

Submission status: Wrong Answer

Solution code:
input_d21 = list(map(int, input().split()))
input_d22 = list(map(int, input().split()))

N = input_d21[0]
M = input_d21[1]

A = input_d22

sohyo = sum(A)
zyoken = sohyo // (4 * M)


A = sorted(A, reverse=True)


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

Submission status: Wrong Answer

Solution code:
N, M = map(int, input().split())
N = input().split()
A = []
soutoku = 0
for i in N:
    soutoku += int(i)
N = sorted(N, reverse=True)
for i in range(M):
    A.append(N[i])

b = soutoku / 4 * M

if int(N[int(M-1)]) < int(b):
    print("No")
else:
    print("Yes")

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())
l=list(map(int,input().split()))
t=sum(l)//(4*b)
ans = [True for i in range(b-1,len(l)-3) if sum(l[i:i+3])]
print('Yes' if ans and all(ans) else 'No')

Submission status: Wrong Answer

Solution code:
i1 = input()
i2 = input()

# i1 = "4 1"
# i2 = "5 4 2 1"
list1 = [int(s) for s in i1.split()]
list2 = [int(s) for s in i2.split()]

n = list1[0]
m = list1[1]


total = sum(list2)

# 選べる
count = 0

for a in range(n):
    if (list2[a]/total > 1/(4*m)):
        count += 1 

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

Submission status: Wrong Answer

Solution code:
num1=input().split()
num2=input().split()

num2.sort(reverse=True)
N=int(num1[0])
M=int(num1[1])
A=int(num2[M-1])

if A<N/M/4:
    print('No')
else:
    print('Yes')

Submission status: Wrong Answer

Solution code:
N, M = map(int, input().split())
a_list =  list(map(int, input().split()))
a_list.sort(reverse = True)
count = 0
for voted in a_list:
    if count >= M:
        print("Yes")
        break
    if voted >=1/(4*M):
        count +=1
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()]

for i in range(n):
    sousuu += int(x[i])

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

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

Submission status: Wrong Answer

Solution code:
def main():
    N,M = map(int,input().split())
    A = list(map(int,input().split()))
    G = sum(A)
    list.sort(A, reverse=True)
    i = 0
    while i < M:
        if A[i] / G < 1 / 4 * M:
            return "No"
            break
        i += 1
    return "Yes"
print(main())

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

if len(c) > m:
        print('Yes')
else:
        print('No')

Submission status: Wrong Answer

Solution code:
# n, m = map(int, input().split())
n, m = map(int, "12 3".split())
inputText2 = "4 56 78 901 2 345 67 890 123 45 6 789"
# inputText2 = input()
input2List = list(map(int,inputText2.split()))
sortList = sorted(input2List, reverse=True)
# print(sortList) #380 19 1000
total = sum(sortList)
# print(total)
h = (1/4*m) * total
# print(h)
flg = False
resultTotal = 0
for i in range(m):
    resultTotal += sortList[i]

if resultTotal < h:
    print("No")
else:
    print("Yes")

Submission status: Wrong Answer

Solution code:
#python3
def main():
    n, m = map(int, input().split())
    a = [int(i) for i in input().split()]
    c = 0
    s = sum(a)

    for i in range(n):
        if s//(4*m) <= a[i]:
            c += 1

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

souwa = sum(A)
hyou = souwa/(4*m)
ninki = 0

for number in A:
  if number > hyou:
    ninki = ninki + 1

if m <= ninki:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
N, M = map(int, input().split())
A = list(map(int, input().split()))  # [1, 2, 3, 4] になる

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

def check(M,A,N,judge,vote):
    while 1:
        num = A.pop(A.index(max(A)))
        if num > vote:
            judge+=1
        else:
            return 'No'
        if judge == M:
            return 'Yes'

print(check(M,A,N,judge,vote))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

# 得票総数
Sum = sum(A)
# M位の商品の得票数
if A[int(M)-1] < Sum / 4 * int(M):
  print('No')
else:
  print('Yes')

Submission status: Wrong Answer

Solution code:
cl1 = input().split()
cl2 = input().split()
n = int(cl1[0])
m = int(cl1[1])
cl1 = [int(s) for s in cl1]
cl2 = [int(s) for s in cl2]

sum= 0.0
for i in range(n):
    sum = cl2[i]+ sum
print(sum)
cl2 = sorted(cl2,reverse=True)
if(cl2[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.sort(reverse=True)
total = sum(A)
ta = int(total / (4*M))

count = 0

for i in range(M):
    if A[i] >= ta:
        count += 1

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

Submission status: Wrong Answer

Solution code:
import math
num, m = map(int,input().split())
list = [int(x) for x in input().split()]

sorted(list, reverse = True)
least = math.floor(sum(list) * (1/(4*m)))
count = 0



for i in range(m):
    if list[i] < least:
        print("No")
        
        break
    else:
        count += 1

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

Submission status: Wrong Answer

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



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

print(check(A,M))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n, m = map(int, input().split())
a = list(map(int, input().split()))
pop = 0
d = 1 / (4 * m)

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

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

Submission status: Wrong Answer

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

total_vote = sum(item_vote)
item_vote = sorted(item_vote, reverse=True)
boder = total_vote/4*M
if item_vote[M-1] > boder:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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


th=sum(A)/(4*M)
#print('th='+ str(th))

A_th=[A_t for A_t in A if A_t>=th]
print('th='+ str(A_th))

if len(A_th)>=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)
count = 0
for voted in a_list:
    if count > M:
        print("Yes")
        break
    if voted >=1/(4*M):
        count +=1
else:
    print("No")

Submission status: Wrong Answer

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

sum_a = sum(a)
l = []
for i in range(n):
    if a[i] < sum_a // (4*m):
        continue
    else:
        l.append(a[i])
if len(l) >= m:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

cnt = 0
i = 0
for i in range(N):
    if An[i] > Limit:
        cnt = cnt+1

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

Submission status: Wrong Answer

Solution code:
def main():
    N,M = map(int,input().split())
    A = list(map(int,input().split()))
    G = sum(A)
    list.sort(A, reverse=True)
    i = 0
    while i < M:
        if A[i] / G > 1 / 4 * M:
            return "No"
            break
        i += 1
    return "Yes"
print(main())

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
num1=input().split()
num2=input().split()

num2.sort(reverse=True)
N=int(num1[0])
M=int(num1[1])
A=int(num2[M-1])

if A<N/M/4:
    print('Yes')
else:
    print('No')