Problem:


Score : 200 points

Problem Statement

We have held a popularity poll for N items on sale. Item i received A_i votes.

From these N items, we will select M as popular items. However, we cannot select an item with less than \dfrac{1}{4M} of the total number of votes.

If M popular items can be selected, print Yes; otherwise, print No.

Constraints

1 \leq M \leq N \leq 100

1 \leq A_i \leq 1000

A_i are distinct.

All values in input are integers.

Input

Input is given from Standard Input in the following format:

N M
A_1 ... A_N

Output

If M popular items can be selected, print Yes; otherwise, print No.

Sample Input 1

4 1
5 4 2 1

Sample Output 1

Yes

There were 12 votes in total. The most popular item received 5 votes, and we can select it.

Sample Input 2

3 2
380 19 1

Sample Output 2

No

There were 400 votes in total. The second and third most popular items received less than \dfrac{1}{4\times 2} of the total number of votes, so we cannot select them. Thus, we cannot select two popular items.

Sample Input 3

12 3
4 56 78 901 2 345 67 890 123 45 6 789

Sample Output 3

Yes



Sample input:
4 1
5 4 2 1


Sample output:
Yes

Submission status: Wrong Answer

Solution code:
import sys
import os

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    N, M = il()
    A = il()
    sm = sum(A)
    mi, mod = divmod(sm, 4*M)
    cnt = 0

    for a in A:
        if a >= mi: cnt += 1

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


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:

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)
count = 0
for i in range(N):
    if A[i] > limit:
        count +=1

print(count)

#print(N-n-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()))
x = sum(a)
v = x * 1// (4*m)
ans = [1 if i>=v else 0 for i in a]
print('Yes' if sum(ans) >= m else 'No')

Submission status: Wrong Answer

Solution code:
n, m = [int(i) for i in input().split()]
a = sorted([int(i) for i in input().split()], reverse=True)
ans = 0
t = sum(a) // (4*m)
for i in a:
    if i > t:
        ans += 1
    else:
        break

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

Submission status: Wrong Answer

Solution code:
from sys import stdin
N,M = map(int,input().split())
A=  [int(x) for x in stdin.readline().rstrip().split()]
m = min(A)
s = sum(A)
if ( s / (4 * M) > m) :
  print("No")
else:  
  print("Yes")

Submission status: Wrong Answer

Solution code:
items,select = input().split()
x = [int(items) for x in input().split()]
for u in x:
    if u > (1 / (4 * int(select))):
        print("No")
        break
    else:
        print("Yes")
        break

Submission status: Wrong Answer

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

a = sorted(A, reverse=True, key=int)

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

if b>e:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
N, M = map(int, input().split())
arrayA = input().split()
convertedArray = [int(ele) for ele in arrayA]
count = 0
total = sum(convertedArray)
con = int((1 / (4 * M)) * total)
for A in convertedArray:
    if A >= con:
        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()
A.reverse()
b=sum(A)/4
ans="Yes"
for i in range(M):
    if A[i]<b:
        ans="No"
print(ans)

Submission status: Wrong Answer

Solution code:
nubers = [input() for i in range(2)]
NM = nubers[0].split()
As = nubers[1]
N = int(NM[0])
M = int(NM[1])
A = []
hhh = 0
jjj = 0
AA =As.split()
#print(AA)
for aa in AA:
  A.append(int(aa))
if len(A) == len(set(A)):
  for nn in A:
    if 1 <= nn and nn <=1000:
      jjj +=1
#print(A)
A.sort(reverse=True)
#print(A)
if jjj == len(A) and 1 <= M and M <= N and N <= 100:
  zen_A = sum(A)
  chk = zen_A*(1/(4*M))
  #print(A)
  for oo in range(M):
    #print(oo)
    if chk < A[oo]:
      hhh +=1
  if hhh == M:
    print('Yes')
  else:
    print('No')

Submission status: Wrong Answer

Solution code:
N,M = list(map(int, input().split()))
A = [int(x) for x in input().split()]
 
total = sum(A)
count = 0 
 
for i in range(N):
    if A[i] > ((1 / (4 * M)) * total):
        count = count + 1
if count < M:
    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)
a_total = sum(a_list)
count = 0
for voted in a_list:
    if count >= M:
        print("Yes")
        break
    if voted > (1/(4*M))*a_total:
        count +=1
else:
    print("No")

Submission status: Wrong Answer

Solution code:
import sys
import os

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    N, M = il()
    A = il()
    sm = sum(A)
    mi, mod = divmod(sm, 4*M)
    cnt = 0

    for a in A:
        if a > mi: cnt += 1

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


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
N, M = map(int, input().split())
arrayA = input().split()
convertedArray = [int(ele) for ele in arrayA]
count = 0
total = sum(convertedArray)
con = int((1 / (4 * M)) * total)
print(con)
for A in convertedArray:
    if A >= con:
        count += 1
if count >= M:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
from sys import stdin
N,M = map(int,input().split())
A=  [int(x) for x in stdin.readline().rstrip().split()]
m = min(A)
s = sum(A)
if ( s / (4 * M) > m) :
  print("no")
else:  
  print("yes")

Submission status: Wrong Answer

Solution code:
i1 = input()
i1 = i1.split()
types = int(i1[0])
select = int(i1[1])

i2 = input()
i2 = [int(n) for n in i2.split()]
i2.sort(reverse=True)

summary = sum(i2)
threshold = summary / (types * 4)

if i2[select-1] >= threshold :
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
import sys
import os

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    N, M = il()
    A = il()
    sm = sum(A)
    mi, mod = divmod(sm, 4*M)
    if mod !=0: mi+=1
    cnt = 0

    for a in A:
        if a > mi: cnt += 1

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


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if __name__ == '__main__':
    NM = input().split()
    nums = input().split()

    numsl = []
    for _,a in enumerate(nums):
        numsl.append(int(a))

    N = NM[0]
    M = NM[1]
    sum = 0
    for i,a in enumerate(nums):
        sum = sum + int(a)

    numsr = sorted(numsl,reverse=True)

    y = 0
    for i,a in enumerate(nums):
        if int(a) >= int(numsr[int(M)-1]):
            if int(a) > int(sum)//(4*int(M)):
                y = y + 1

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

    sys.exit()

Submission status: Wrong Answer

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

for n in num_point:
    if n > (sum(num_point) / (4 * m)):
        count += 1

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys


def main(argv):
    n, m = [int(i) for i in sys.stdin.readline().rstrip("\n").split(" ")]
    a = [int(i) for i in sys.stdin.readline().rstrip("\n").split(" ")]
    s = sum(a)
    items = list(filter(lambda i: True if i > s / (4 * m) else False, a))
    print("Yes" if len(items) >= m else "No")
    return 0
    

if __name__ == "__main__":
    sys.exit(main(sys.argv))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N, M = map(int, input().split())
blist=list(map(int,input().split()))
M = 1/(4*M)
flag = 0
for i in blist:
    if i>M:
        flag = 1
if flag:
    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)
result = 0

for i in range(len(a)):
    if sum * (1 / (4 * m))  < a[i]:
        result += 1
        
if result >= m:
    print('YES')
else:
    print('NO')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N, M = map(int, input().split())
tokuten_list = list(map(int, input().split()))
soutokuten = sum(tokuten_list)
asikiri_line = int(soutokuten / (4 * M)) + 1
kekka = "No"
ninki_count = 0
for tokuten in tokuten_list:
    if tokuten >= asikiri_line:
        ninki_count += 1
        if ninki_count >= M:
            kekka = "Yes"
            break

print(kekka)

Submission status: Wrong Answer

Solution code:
import math

N, M = map(int, input().split())
arrayA = input().split()
convertedArray = [int(ele) for ele in arrayA]
count = 0
total = sum(convertedArray)
con = math.floor((1 / (4 * M)) * total)
for A in convertedArray:
    if A >= con:
        count += 1
if count >= M:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

import itertools

n, m = map(int, readline().split())
a = list(map(int, readline().split()))
sum_a = sum(a)
cumsum = list(itertools.accumulate(a))
ans = [0] * n
cnt = 0
if cumsum[m - 1] / sum_a >= 1 / (n * m):
    cnt += 1
    if n == m:
        print('Yes')
        exit()
for i in range(1, n - m + 1):
    if (cumsum[m + i - 1] - cumsum[i - 1]) / sum_a >= 1 / (n * m):
        cnt += 1
        if i - 1 == n - m + 1:
            print('Yes')
            exit()
    if cnt >= m:
        print('Yes')
        exit()
if cnt >= m:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
n=input().split()
N=int(n[0])
M=int(n[1])
a=input().split()
#print(a)
a = [int(i) for i in a] 
b=sum(a)/4*M
c=sorted(a)[N-M]
if b<=c :
     print("Yes")
else:
     print("No")

Submission status: Wrong Answer

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

a = sorted(A, reverse=True, key=int)

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

if b>e:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
from sys import stdin,stdout

input = stdin.readline
#print = stdout.readline

n,m = map(int,input().split())
arr = list(map(int,input().split()))
arr.sort()
M = sum(arr)//(4*m)
#print(M)
cnt = 0

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

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,raw_input().split())
a=map(int,raw_input().split())
c=0
s=sum(a)//(4*m)
for i in range(n):
    if a[i]>=s:
        c+=1
    if c==m:
        print 'Yes'
        quit()
print 'No'

Submission status: Wrong Answer

Solution code:
from sys import stdin
N,M = map(int,input().split())
A=  [int(x) for x in stdin.readline().rstrip().split()]
m = max(A)
s = sum(A)
if ( s / (4 * M) > m) :
  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 += a[i]

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

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

Submission status: Wrong Answer

Solution code:
n,m = map(int, input().split())
l = list(map(int, input().split()))
limit = sum(l)/(4*m)
l.sort(reverse=True)
print(l)
print(l[m-1])
print(sum(l))
print(limit)
if l[m-1] < limit:
    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 = -(-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:
N,M = map(int,input().split())
A = list(map(int,input().split()))

cut = int(sum(A)/(4*M))

count = 0

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

sum = 0
for i in range(len(a)):
    sum += a[i]

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

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

Submission status: Wrong Answer

Solution code:
N, M = map(int, input().split())
a_list =  list(map(int, input().split()))
a_list.sort(reverse = True)
a_total = sum(a_list)
count = 0
for voted in a_list:
    if count >= M:
        print("Yes")
        break
    if voted >= (1/(4*M))*a_total:
        count +=1
else:
    print("No")

Submission status: Wrong Answer

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

t = 0
check=False
for i in range(len(a)):
  t += a[i]

for i in reversed(range(len(a))):
  for j in range(i):
    if(a[j] < a[j+1]):
      a[j], a[j+1] = a[j+1],a[j]

for i in range(m):
  if(a[i] > int(t/(4*m))):
    check = True
  else:
    check=False
    break
    
    
if(check):
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
import math

N, M = map(int, input().split())
arrayA = input().split()
convertedArray = [int(ele) for ele in arrayA]
count = 0
total = sum(convertedArray)
con = math.floor((1 / (4 * M)) * total)
for A in convertedArray:
    if A > con:
        count += 1
if count > M:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
from sys import stdin
N,M = map(int,input().split())
A=  [int(x) for x in stdin.readline().rstrip().split()]
m = max(A)
s = sum(A)
if ( s / (4 * M) < 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)
if A[M-1] > sum(A) / (4 * M):
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
# split()で空白区切りでリスト化、その際map()でint型にキャストし変数に代入。
m, n = map(int, input().split())
all_vote=0;
a =list(map(int, input().split()))
for i in range(0, n):
    num=a.count(i)
    all_vote=all_vote+num

flag=True

for i in range(0,m):
    if a.count(i)<all_vote/4*m:
        flag=False

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

Submission status: Wrong Answer

Solution code:
from sys import stdin,stdout

input = stdin.readline
#print = stdout.readline

n,m = map(int,input().split())
arr = list(map(int,input().split()))
arr.sort()
M = sum(arr)//(4*m)
#print(M)
cnt = 0

for i in range(n):
  if arr[i] >= M:
    cnt+=1
    
    
if cnt == m or cnt > m:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
import sys
import os

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    N, M = il()
    A = il()
    sm = sum(A)
    mi = sm/(4*M)
    cnt = 0

    for a in A:
        if a > mi: cnt += 1

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


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import sys
import os

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    N, M = il()
    A = il()
    sm = sum(A)
    mi = sm/(4*2)
    cnt = 0

    for a in A:
        if a > mi: cnt += 1

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


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

if __name__ == '__main__':
    NM = input().split()
    nums = input().split()

    numsl = []
    for _,a in enumerate(nums):
        numsl.append(int(a))

    N = NM[0]
    M = NM[1]
    sum = 0
    for i,a in enumerate(nums):
        sum = sum + int(a)

    numsr = sorted(numsl,reverse=True)

    y = 0
    for i,a in enumerate(nums):
        if int(a) >= int(numsr[int(M)-1]):
            if int(a) >= int(sum)//(4*int(M)):
                y = y + 1

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

    sys.exit()

Submission status: Wrong Answer

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

S= sum(A)

count = 0
for i in range(n):
    if A[i]>=S/4*m:
        count+=1

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

Submission status: Wrong Answer

Solution code:
from sys import stdin
N,M = map(int,input().split())
A=  [int(x) for x in stdin.readline().rstrip().split()]
m = max(A)
s = sum(A)
if ( s / (4 * m) < M) :
  print("no")
else:  
  print("yes")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n,m = map(int, input().split())
a = list(map(int, input().split()))
nolma = 0
a.sort(reverse=True)
for i, c in enumerate(a):
    nolma = nolma + c
nolma = nolma / (4 * m)

for i, c in enumerate(a):
    if c < nolma:
        if i >= m:
            print('Yes')
        else:
            print('No')
        break

Submission status: Wrong Answer

Solution code:

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

input_list = [0] * n

input_list_str = input().split()
input_list = [int(s) for s in input_list_str]
input_list = sorted(input_list, reverse=True)

vote_sum = sum(input_list)
vote_standard = int(vote_sum / (4 * m))

flag = True
for i in range(m):
    if input_list[i] < vote_standard:
        flag = False
        break
    
if flag:
    print('Yes')
else:
    print('No')

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:
import math

N, M = map(int, input().split())
arrayA = input().split()
convertedArray = [int(ele) for ele in arrayA]
count = 0
total = sum(convertedArray)
con = math.floor((1 / (4 * M)) * total)
for A in convertedArray:
    if A > con:
        count += 1
if count < M:
    print('No')
else:
    print('Yes')

Submission status: Wrong Answer

Solution code:
from sys import stdin,stdout

input = stdin.readline
#print = stdout.readline

n,m = map(int,input().split())
arr = list(map(int,input().split()))
arr.sort()
M = round(sum(arr)/(4*m))
#print(M)
cnt = 0

for i in range(n):
  if arr[i] > M:
    cnt+=1
    
    
if cnt == m or cnt > m:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
items,select = input().split()
x = [int(items) for x in input().split()]
for u in x:
    if u > (1 / (4 * int(select)) * sum(x)):
        print("No")
        break
    else:
        print("Yes")
        break

Submission status: Wrong Answer

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

aaa.sort(reverse=True)
result = [0]*b
for i in range(b):
    h = aaa[i]
    j = sum(aaa) / (4*b)

    if h > j:
        result[i] = 1
    else:
        result[i] = 0

if result.count(1) >= b:
    ans = "yes"
else:
    ans = "no"

print(ans)

Submission status: Wrong Answer

Solution code:
n,m=map(int,input().split())
v=list(map(int,input().split()))
v.sort(reverse=True)
s=sum(v)/(4*m)
c=0
for x in v:
    if x>s:
        c+=1
if c>=m:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

n, m_size = map(int, input().split())
P = sorted(list(map(int, input().split())))
M =[]

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

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

Submission status: Wrong Answer

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

vote = 0


for v in list :
    if v in list :
        print("No")
        exit(0)
    vote = vote + v

judge = vote // 4 // M

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

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

Submission status: Wrong Answer

Solution code:
import math

N, M = map(int, input().split())
arrayA = input().split()
convertedArray = [int(ele) for ele in arrayA]
count = 0
total = sum(convertedArray)
con = math.floor((1 / (4 * M)) * total)
for A in convertedArray:
    if A > con:
        count += 1
if count >= M:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
from sys import stdin,stdout

input = stdin.readline
#print = stdout.readline

n,m = map(int,input().split())
arr = list(map(int,input().split()))
arr.sort()
M = sum(arr)//(4*m)

cnt = 0

for i in range(n):
  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=map(int,input().split())
v=list(map(int,input().split()))
v.sort(reverse=True)
s=sum(v)//(4*m)
c=0
for x in v:
    if x>=s:
        c+=1
if c>=m:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
n,m=map(int,input().split())
a=list(map(int,input().split()))
sum=0
for i in range(n):
    sum=sum+a[i]
    
x= round((sum)/(4*m))
#print(x)
l=[]
for j in range(n):
    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())
num_point = [int(x) for x in input().split()]
count = 0

for n in num_point:
    if n > (sum(num_point) / (4 * m)):
        count += 1

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

Submission status: Wrong Answer

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

if A[-M]/sum(A) < 1/(2*M) :
    print("No")
else:
    print("Yes")

Submission status: Wrong Answer

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

if __name__ == '__main__':
    NM = input().split()
    nums = input().split()

    numsl = []
    for _,a in enumerate(nums):
        numsl.append(int(a))

    N = NM[0]
    M = NM[1]
    sum = 0
    for i,a in enumerate(nums):
        sum = sum + int(a)

    numsr = sorted(numsl,reverse=True)

    y = 0
    for i,a in enumerate(nums):
        if int(a) >= int(numsr[int(M)-1]):
            if int(a) >= int(sum)//(4*int(M)):
                y = y + 1

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

    sys.exit()

Submission status: Wrong Answer

Solution code:
from sys import stdin,stdout

input = stdin.readline
#print = stdout.readline

n,m = map(int,input().split())
arr = list(map(int,input().split()))
arr.sort()
M = sum(arr)//(4*m)
print(M)
cnt = 0

for i in range(n):
  if arr[i] > M:
    cnt+=1
    
    
if cnt == m or cnt > m:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
def has_duplicates2(seq):
    seen = []
    unique_list = [x for x in seq if x not in seen and not seen.append(x)]
    return len(seq) != len(unique_list)

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 M > N:
    print('No')
elif has_duplicates2(A):
    print('No')
else:
    if NGcount == 0:
        print('Yes')
    else:
        print('No')

Submission status: Wrong Answer

Solution code:
n,m=map(int,input().split())
v=list(map(int,input().split()))
#v.sort(reverse=True)
s=sum(v)//(4*m)
c=0
for x in v:
    if x>s:

        c+=1
if c==m:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

print(A)

Asum = sum(A)

for i in range(M):
    Amax =  max(A)
    max_index = A.index(Amax)
    A.pop(max_index)
    

if Amax < Asum/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 ()))

votesum = (sum(A))
cutoff = int((votesum)/(4*M))
ascendingA = sorted(A)

print (ascendingA)

#the Mth popular product votes must be more than "cutoff" value
if ascendingA[-M] < cutoff :
    print ("No")
else:
    print ("Yes")

Submission status: Wrong Answer

Solution code:
arrayNM = list(map(int, input().split()))
array = list(map(int, input().split()))
soutoku = 0
for num in array:
  soutoku += num
tokuhyousuu = soutoku / (4 * float(array[1]))
ninnkiCounter = 0
for num in array:
  if (float(num) >= tokuhyousuu):
    ninnkiCounter += 1
    

if (arrayNM[1] < ninnkiCounter):
  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 = [i for i in l if i>t]
print('Yes' if len(ans)>b and len(ans[:b])>b else '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:
import math

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

Submission status: Wrong Answer

Solution code:
def resolve():
	N, M, *A = map(int, open(0).read().split())
	vote = sum(A) * (1 / (4*M))
	num = list(filter(lambda x: x > vote, A))
	num = len(num)
	if num >= M:
		print("Yes")
	else:
		print("No")
resolve()

Submission status: Wrong Answer

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

for n in num_point:
    if n > (sum(num_point)/(4*m)):
        count += 1

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

Submission status: Wrong Answer

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

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 = "Yes"
sumA = sum(A)
compare = sumA//(4*m)
for i in range(m):
    if A[i] < compare:
        ans = "No"

print(ans)

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

Submission status: Wrong Answer

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

result = [0]*a
for i in range(a):
    h = aaa[i]
    j = sum(aaa) / (4*b)

    if h > j:
        result[i] = 1
    else:
        result[i] = 0

if result.count(1) >= b:
    ans = "yes"
else:
    ans = "no"

print(ans)