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())
list_A = input().split()
list_A_int = [int(s) for s in list_A]

compare_num = 1/(4*M)

if list_A_int[M-1] < compare_num:
  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)
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

print(least)

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

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

Submission status: Wrong Answer

Solution code:
N, M = map(int, input().split())
listA = list(map(int, input().split()))
i = len(listA)
tokuhyousuu = sum(listA)
ninnkiList = [i for i in listA if i >= int(tokuhyousuu / (4 * M))]
ninnkisyouhinn = len(ninnkiList)
if ninnkisyouhinn < M:
    print('No')
else:
    print('Yes')

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/(N*M)):
        Bool_list.append("True")
        
if (len(Bool_list)) >= M:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
m,n=map(int,input().split())
a=sorted(list(map(int,input().split())))
s=0
for j in range(n):
  s+=a[j]

for i in range(n):
  if a[n-i-1] < s/(4*m):
    if i!=0:
      a=a[n-i:]
      break
    else:
      a=[]
      break

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

Submission status: Wrong Answer

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

total = sum(A)

ans = 0

for i in range(N):
    if A[i] >= total/(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 = 0
for i in range(n-1):
    if a[i]*4*m > sum(a):
        s += 1
if s >= 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 = list(map(int, input().split()))
scores = list(map(int, input().split()))
at_least = sum(scores) / (4*M)

if len([ s for s in scores if s > at_least]) >= M:
  print('Yes')
else:
  print('No')

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+1)//(4*m) <= a[i]:
            c += 1

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

Submission status: Wrong Answer

Solution code:
line = list(map(int, input().split()))
p_array = list(map(int, input().split()))

n,m = line[0],line[1]

sum_array = sum(p_array)
j_sum = int(sum_array / (4 * m))

tmp = []

for i in p_array:
    if i < j_sum:
        continue
    tmp.append(i)

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

Submission status: Wrong Answer

Solution code:
N, M = map(int, input().split())
A = list(set(list(map(int, input().split()))))
if 1 <= M <= N <= 1000 and (1 <= Ai <= 1000 for Ai in 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())
if m == 0:
  print("Yes")
else:
  a = list(map(int, input().split()))
  a_sort = sorted(a, reverse=True)
  if a_sort[m-1] >= sum(a) // (4*m):
    print("Yes")
  else:
    print("No")

Submission status: Wrong Answer

Solution code:
N,M= map(int, input().split())
A=list(map(int, input().split()))
A.sort()
A.reverse()
K=sum(A)
answer=0
for i in range(0,N):
    if  A[i]*M*4>=K:
        continue
    else:
        answer=i
        break
if answer>=M:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

flg = True

soutouhyou = int(sum(a) * (1 / (4 * M)))

count = 0

for num in list(range(M)):
    if a[num] >= soutouhyou:
        count += 1

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

Submission status: Wrong Answer

Solution code:
line1 = input()
line2 = input()
n, m = line1.split(" ")
a_list = line2.split(" ")
a_list = [int(a) for a in a_list]
a_list.sort(reverse=True)

total = 0
flag = 0

for a in a_list:
    total = total + a

for i in range(int(m)):
    if a_list[i] < int(total / (4*int(m))):
        flag = 1

if flag == 1:
    print("No")
else:
    print("Yes")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n,m=map(int,input().split())
a=list(map(int,input().split()))
ans=0
M=int((1/(m*4))*sum(a))
for i in a:
    if i>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()))
F = 0
trigger = 1 / (4 * M)

for i in range(len(A)):
    if A[i]/sum(A) > trigger:
        F = F + 1
        
if F > M:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
def calc(n,m,l):
    s=sum(l)
    q=0
    p=s//(4*m)
    for i in l:
        if(i>=1 and i<=1000):
            if (i >= p):
                q = q + 1
    if (q >= m):
            return "Yes"
    else:
            return "No"

n,m=input().split()
n=int(n)
m=int(m)
x=input().split()
p=set(x)
l=list(map(int,p))
if(n>=1 and n<=1000 and m>=1 and m<=1000):
    print(calc(n, m, l))

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=sum+a[i]
    
x= round((sum)/(4*m))
#print(x)
l=[]
for j in range(len(a)):
    if(a[j]>x):
        l.append(a[j])
#print(l)        
if(len(l)>=m):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

total=sum(N_list)
total=total/4
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 = 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())
a=list(map(int,input().split()))
counter=0
for i in a:
    if i > n/4/m:
        counter+=1
print('Yes' if counter>=m else 'No')

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:
inputs = input().split(' ')
inputs2 = input().split(' ')
inp1=[int(a) for a in inputs]
inp2=[int(a) for a in inputs2]

# inp1 = [12,3]
# inp2 = [4,56,78,901,2,345,67,890,123,45,6,789]


sums = sum(inp2)
rest = 1/(4*inp1[1])

inp2.sort()
inp2.reverse()

result = []

for i in range(inp1[1]):

	if inp2[i] > sums*rest:
		result.append(int(inp2[i]))



if len(result)>inp1[1] - 1:
	print("Yes")
else:
	print("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(m):
    if (list2[a]/total > 1/(4*m)):
        count += 1 

if count == 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 else 'Yes'

Submission status: Wrong Answer

Solution code:
a = input().split(' ')
b = input().split(' ')
a = [int(a) for a in a]
b = [int(b) for b in b]

b.sort(reverse=True)
v = sum(b)

ans = 'Yes'

if b[a[1]-1] / v < 1 / 4 * a[1]:
    ans = 'No'
            
print(ans)

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("No")
else:
    print("Yes")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
line1 = input()
line2 = input()
n, m = line1.split(" ")
a_list = line2.split(" ")
a_list = [int(a) for a in a_list]
a_list.sort(reverse=True)

total = 0
flag = 0

for a in a_list:
    total = total + a

for i in range(int(m)):
    print(a_list[i])
    if a_list[i] < int((total / (4*int(m)))+0.5):
        flag = 1

if flag == 1:
    print("No")
else:
    print("Yes")

Submission status: Wrong Answer

Solution code:
def main():
  
  n,m = map(int, input().split())
  A = sorted([int(x) for x in input().split()],reverse=True)
  
  asum = 0
  for a in A:
    asum += a
   
  if(A[m-1]>asum/(4*m)):
    print("Yes")
  else:
    print("No")
  return 0
 
if __name__ == "__main__":
  main()

Submission status: Wrong Answer

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

N = a[0]
M = a[1]

count = 0
b_sum = sum(b)

c = sorted(b,reverse = True)

for i in range(0,N-1):
    if c[i] >= (b_sum/(4*M)):
        count+=1
    else:
        break

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

Submission status: Wrong Answer

Solution code:
#161B
n, m = map(int, input().split())
a = list(map(int, input().split()))
cnt = 0
for i in range(n):
    if a[i] >= sum(a) // (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()))
sorted_A = sorted(A, reverse=True)
guard = sum(A) // (M * 4)
count = 0
for i in range(M):
    if sorted_A[i] > guard:
        count += 1

if M == count:
    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
B = A

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

if C[0]>=(1/(4*M))*(B[len(A)-1]):
    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(" ")]

cnt = 0
sum1 = sum(A)
p = 1/(4*M)

for i in range(len(A)):
    A[i] = A[i]/sum1

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


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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
m = int(input().split(' ')[1])
votes = input().split(' ')
votes = sorted(votes, reverse=True)
votes = list(map(int, votes))
total = sum(votes)
compare = total/(4*m)
if votes[m-1] >= compare:
	print('Yes')
else:
	print('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(m):
    if (list2[a]/total > 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()))

line = sum(A) // (4 * M)
ans = [i for i in A if i > line]
print("Yes") if len(ans) >= M else print("No")

Submission status: Wrong Answer

Solution code:
import math
n,m = list(map(int,input().split()))
a = list(map(int,input().split()))
t = sum(a)
c = 0
f = 0
for i in range(n):
	if a[i] >= t//(4*m):
		c += 1

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

Submission status: Wrong Answer

Solution code:
N, M = map(int, input().split())
listA = list(map(int, input().split()))
i = len(listA)
tokuhyousuu = sum(listA)
ninnkiList = [i for i in listA if i > int(tokuhyousuu / (4 * M))]
ninnkisyouhinn = len(ninnkiList)
if ninnkisyouhinn < M:
    print('No')
else:
    print('Yes')

Submission status: Wrong Answer

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

b.sort(reverse=True)
v = sum(b)

ans = 'Yes'

if b[a[1]-1] / v < 1 / 20:
    ans = 'No'
            
print(ans)

Submission status: Wrong Answer

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

YES = "Yes"  # type: str
NO = "No"  # type: str


def solve(N: int, M: int, A: "List[int]"):
    sum = 0
    count = 0
    for i in A:
        sum += i


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

    if count >= M:
        print(YES)
    else:
        print(NO)
    return


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    M = int(next(tokens))  # type: int
    A = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    solve(N, M, A)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
N,M=map(int,input().split())
List=[int(i) for i in input().split()]
count=0
for n in range(M) :
    if int(List[n]) > int(int(sum(List))/4*M) :
        count=count+1
if int(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()
A.reverse()
K=sum(A)
answer=0
for i in range(0,N):
    if  A[i]*M*4>=K:
        continue
    else:
        answer=i+1
        break
if answer>=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 = sorted(A, reverse=True)
guard = sum(A) // (M * 4)
count = 0
for i in range(M):
    if sorted_A[i] >= guard:
        count += 1

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

Submission status: Wrong Answer

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

flg = True

soutouhyou = int(sum(a) * (1 / (4 * M)))

count = 0

if soutouhyou > 0:
    for num in list(range(M)):
        if a[num] >= soutouhyou:
            count += 1

if count > N:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
def main():
  
  n,m = map(int, input().split())
  A = sorted([int(x) for x in input().split()],reverse=True)
  
  sum = 0
  for a in A:
    sum += a
   
  if(A[m-1]>=a/(4*m)):
    print("Yes")
  else:
    print("No")
  return 0
 
if __name__ == "__main__":
  main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
m = int(input().split(' ')[1])
votes = input().split(' ')
votes = sorted(votes, reverse=True)
votes = list(map(int, votes))
total = sum(votes)
compare = total/(4*m)
if votes[m-1] > compare:
	print('Yes')
else:
	print('No')

Submission status: Wrong Answer

Solution code:
line = list(map(int, input().split()))
p_array = list(map(int, input().split()))

n,m = line[0],line[1]

sum_array = sum(p_array)
j_sum = int(sum_array / (4 * m))

tmp = []

for i in p_array:
    if i >= j_sum:
        tmp.append(i)

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

Submission status: Wrong Answer

Solution code:
n,m = map(int, input().split())
l = list(map(int, input().split()))
limit = sum(l)//(4*m)
l.sort(reverse=True)
if l[m-1] < limit:
    print("No")
else:
    print("Yes")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n,m = map(int, input().split())
a = list(map(int, input().split()))
flag = False
allVote = sum(a)
a.sort(reverse=True)
counter = 0

for i in range(n):
  if allVote/4 < a[i]*m:
    counter +=1 
  else:
    break


if counter >= m:
  flag = True

if flag is False:
  print("No")
else:
  print("Yes")

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=sum+a[i]
    
x= (sum)//(4*m)
#print(x)
l=[]
for j in range(len(a)):
    if(a[j]>x):
        l.append(a[j])
#print(l)        
if(len(l)>=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("No")
else:
    print("Yes")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

print('Yes') if lst[m-1] >= sum(lst)/4*m else print('No')

Submission status: Wrong Answer

Solution code:
n, m = map(int, input().split())
# n, m = map(int, "4 1".split())
# inputText2 = "5 4 2 1"
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
for i in range(m):
    if sortList[i] < h:
        flg = True


if  flg:
    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())
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)
print('Yes' if all(True for i in range(b-1,len(l)-3) if sum(l[i:i+3])>t) else 'No')

Submission status: Wrong Answer

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

border = sum(A) // (4*M)
flag = 'Yes'

for i in range(M):
    if border > A[i]:
        flag = 'No'

print(flag)

Submission status: Wrong Answer

Solution code:
from bisect import bisect_left

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

#print(M)
A.sort()
#print(A)

limit = sum(A)/(4*M)
#print(limit)

n = bisect_left(A, limit)
#print(N-n-1)
if N-n-1 >= M:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a = input().split(' ')
b = input().split(' ')
a = [int(a) for a in a]
b = [int(b) for b in b]

b.sort(reverse=True)
v = sum(b)

ans = 'No'

if b[a[1]-1] / v >= 1 / 20:
    ans = 'Yes'
            
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N , M = input().split()
array = input().split()
flag = 0

N = int(N)
M = int(M)

iarray = []

for i in array:
    iarray.append(int(i))

total = sum(iarray)

for i in iarray:
    if i >= total/(4*M):
        flag += 1
if flag >= 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)<i for i in a])<m::2])

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 else 'Yes'

Submission status: Wrong Answer

Solution code:
n, m = map(int, input().split())
# n, m = map(int, "4 1".split())
# inputText2 = "5 4 2 1"
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
for i in range(m):
    if sortList[i] < h:
        flg = True


if  flg:
    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_sum =sum(A)

ans = 0
for i in range(N):
    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 = list(map(int, input().split()))
A = list(map(int,input().split()))
A = sorted(A,reverse=True)


ans = ""
compare = sum(A)//(4*m)
for i in range(m):
    if A[i] < compare:
        ans = "No"
        break
    else:
        ans ="Yes"


print(ans)

Submission status: Wrong Answer

Solution code:
N,M=map(int,input().split())
list_A=input().split()
for i in range(len(list_A)):
    list_A[i]=int(list_A[i])
A =int(sum(list_A)/(4*M))
if M<=len([i for i in list_A if i> A]):
    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=sum+a[i]
    
x= (sum)//(4*m)
#print(x)
l=[]
for j in range(len(a)):
    if(a[j]>=x):
        l.append(a[j])
#print(l)        
if(len(l)>m):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
def calc(n,m,l):
    s=sum(l)
    q=0
    p=s//(4*m)
    for i in l:
        if (i>=p):
            q=q+1
    if(q>=m):
        return "Yes"
    else:
        return "No"
n,m=input().split()
n=int(n)
m=int(m)
x=input().split()
p=set(x)
l=list(map(int,p))

print(calc(n,m,l))

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)
boder = 1/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())

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

a.sort(reverse=True)

b = 0
for i in a:
    b += i
c = b * (1 / (4 * m))
if m <= n:
    for j in range(m):
        if a[j] <= c:
            print('No')
            exit()
else:
    print('No')

print('Yes')

Submission status: Wrong Answer

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

sumOfA = sum(A)

condition = sumOfA//(4*M)


flag = 0
for i in A:
    if(i > condition):
        flag += 1 
    if(flag==M):
        print("Yes")
        break

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

Submission status: Wrong Answer

Solution code:
a=list(map(int, input().split()))
n=a[0]
m=a[1]
l=list(map(int, input().split()))
lm=sum(l)
l=sorted(l, reverse=True)
print(l)
for i in range(m):
    if l[i]*4*m<lm:
        print("No")
        exit()
print("Yes")

Submission status: Wrong Answer

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

sum_A = sum(A)
j = 0
for i in range(m):
    maxA = max(A)
    if maxA > sum_A/(4*m):
        j += 1
    A.remove(maxA)
if j == m:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:

N,M=input().split()
N=int(N)
M=int(M)
count=0
A=list(map(int,input().split())) 
for i in A:
    
    if i >=(1/(4*M)):
        
        count+=1
        
    
if count>=M:
    print("Yes")
    
else:
    print("No")

Submission status: Wrong Answer

Solution code:
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))

if __name__ == "__main__":
    N, M = map(int, input().split())
    A = sorted(LI(), reverse=True)
    sum = sum(A)
    if A[M-1] < sum//(4*M):
        print("No")
    else:
        print("Yes")

Submission status: Wrong Answer

Solution code:
a,b = map(int,input().split())
List=[int(i) for i in input().split()]
c = 1/(4*b)
d = 0
for i in range(a):
    if List[i] > c:
        d += 1
if d >= 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.sort()
s=0
b=True
for i in a:
  s+=i
  
for i in range(0,m):
  if a[i]>=s/4/m:
    b=True
  else:
    b=False
    break
    
if b:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
n,m=map(int,input().split())
a=list(map(int,input().split()))
num=len([x for x in a if x>=1/(4*m)])
if num >= 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()]
A.sort(reverse=True)

NGcount = 0
sumA = sum(A)
Z = sumA // (4 * M)

for x in range(M):
    if A[x] < Z:
        NGcount = NGcount + 1

if NGcount == 0:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

sumOfA = sum(A)

condition = sumOfA//(4*M)


flag = 0
for i in A:
    if(i >= condition):
        flag += 1 
    else:
        continue

    if(flag==M):
        print("Yes")
        break

if(flag < M):
    print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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