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: Runtime Error

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

s_vote = sum(vote)
st = 1 // 4 * s_vote
count = 0
for v in votes :
    if v >= st:
        count += 1
print("Yes" if count >= m else "No")

Submission status: Runtime Error

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

A = list(map(int, input().split()))
S = sum(A)
x = S/(4*m)

count = 0

for i in A:
    if i >= x:
        count += 1

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
#include <stdio.h>

int main(){
    int n,m;
    int a[n];
    scanf("%d %d",&n, &m);
    for(int i=0; i<n; i++)scanf("%d", &a[i]);
    int total = 0;
    for(int i=0; i < n; i++)total = total + a[i];
    int cnt=0;
    for(int i=0; i<n; i++)if(a[i] > total/(4*m))cnt++;
    if(cnt >= m)printf("Yes");
    else printf("No");

    return 0;
}

Submission status: Runtime Error

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

MAX_VOTE_NUM = 1000

x = [-1] * MAX_VOTE_NUM
total_vote_num = 0
for i in range(n):
  x[a[i] - 1] = i
  total_vote_num += a[i]

popular_num = 0
for i in range(MAX_VOTE_NUM):
  index = MAX_VOTE_NUM - 
  if x[index - 1] != -1 and (index * 4 * m) >= total_vote_num:
    popular_num += 1

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

Submission status: Runtime Error

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

a = list(map(int,input().strip().split()))[:n] 
  
number=0
total=0
for i in range(N):
  v=a[i]
  total=total+v
for i in range(N):
  v=a[i]
  if v < (1/(4*M))*total:
    number=number
  else:
    number = number+1
if number >= M:
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

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

number=0
for i in range(N):
  v=int(input())
  if v < 1/(4*M):
    number=number
  else:
    number = number+1
if number >= M:
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

Solution code:
N=int(input())
M=int(input())
number=0
for i in range(N):
  v=int(input())
  if v < 1/(4*M):
    number=number
  else:
    number = number+1
if number >= M:
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

Solution code:
N=input()
M=input()
number=0
for i in range(N):
  v=input()
  if v < 1/(4*M):
    number=number
  else:
    number = number+1
if number >= M:
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

Solution code:
def popularity(votes, N, M):
    
    total_votes = sum(votes)
    limit = total_votes / (4.0 * M)
    
    cnt = 0
    for vote in votes:
        if vote >= limit:
            cnt += 1
    	if cnt >= M:
			return "Yes"
    
    return "No"
  
N, M = [int (x) for x in input().split()]
votes = [int (x) for x in input().split()]
print(popularity(votes, N, M))

Submission status: Runtime Error

Solution code:
def popularity(votes, N, M):
    
    total_votes = sum(votes)
    limit = total_votes / (4.0 * M)
    
    cnt = 0
    for vote in votes:
        if vote >= limit:
            cnt += 1
    	if cnt >= M:
            return "Yes"
    
    return "No"
  
N, M = [int (x) for x in input().split()]
votes = [int (x) for x in input().split()]
print(popularity(votes, N, M))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import math
def I(): return(list(map(int,input().split())))
n,m=I()
a=I()
t=math.ceil((1/4m*sum(a)))
c=0
for i in a:
	if i>=t:c+=1
print(["NO"]["YES"][c==m])

Submission status: Runtime Error

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

total_votes_checker = lambda M, i, total_votes: (False if i <= (1 / (4 * M)) * total_votes else True)

A = list(filter(lambda i: total_votes_checker(M, i, total_votes), A))

print("Yes") if len(A) >= M else print("No")

Submission status: Runtime Error

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


total_votes_checker = lambda M, total_votes: (False 
                                        if total_votes <= 1 / (4 * M) 
                                        else True)

total_votes = sum(A)
A_iter = iter(A)

acceptable_A = list(filter(lambda A_item: total_votes_checker(A_item, total_votes), A))
    
print(acceptable_A)


# acceptable_A = list(filter(total_votes_checker(next(A_iter),total_votes), A))

#item_num_checker = lambda N, A: True if len(A) == N else False

print(max(A),A[M])
popular_checker = lambda A, M: True if A[M] == max(A) else False

print(popular_checker(acceptable_A,M))

TF = popular_checker(acceptable_A,M)

printer = lambda TF : print("Yes") if TF else print("No")

printer(TF)

Submission status: Runtime Error

Solution code:
import functools

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


total_votes_checker = lambda M, total_votes: (False 
                                        if total_votes < 1 / (4 * M) 
                                        else True)

total_votes = sum(A)
A_iter = iter(A)

is_acceptable = filter(total_votes_checker(next(A_iter)), total_votes)

#item_num_checker = lambda N, A: True if len(A) == N else False

popular_checker = lambda A, M: True if A[M] == max(A) else False

total_votes_checker(M, total_votes)
popular_checker(A,M)

TF = total_votes_checker(M, total_votes) and popular_checker(A,M)

printer = lambda TF : print("Yes") if True else print("No")

printer(TF)

Submission status: Runtime Error

Solution code:
import functools

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


total_votes_checker = lambda M, total_votes: (False 
                                        if total_votes < 1 / (4 * M) 
                                        else True)

total_votes = sum(A)

#item_num_checker = lambda N, A: True if len(A) == N else False

popular_checker = lambda A, M: True if A[M] == max(A) else False

total_votes_checker(M, total_votes)
popular_checker(A,M)

TF = total_votes_checker(M, total_votes) and popular_checker(A,M)

printer = lambda TF : print("yes") if True else print("No")

printer(TF)

Submission status: Runtime Error

Solution code:
import functools

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


total_votes_checker = lambda M, total_votes: (False 
                                        if total_votes < 1 / (4 * M) 
                                        else True)

total_votes = sum(A)

#item_num_checker = lambda N, A: True if len(A) == N else False

popular_checker = lambda A, M: True if A[M] == max(A) else False

total_votes_checker(M, total_votes)
popular_checker(A,M)

TF = total_votes_checker(M, total_votes) and popular_checker(A,M)

printer = lambda TF : print("yes") if True else print("No")

printer(TF)

Submission status: Runtime Error

Solution code:
import functools

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


total_votes_checker = lambda M, total_votes: (False 
                                        if total_votes < 1 / (4 * M) 
                                        else True)

total_votes = sum(A)

#item_num_checker = lambda N, A: True if len(A) == N else False

popular_checker = lambda A, M: True if A[M] == max(A) else False

total_votes_checker(M, total_votes)
popular_checker(A,M)

TF = total_votes_checker(M, total_votes) and popular_checker(A,M)

printer = lambda TF = print("yes") if True else print("No")

printer(TF)

Submission status: Runtime Error

Solution code:
n, m = map(int,input().split())
a = list(map(int,input().split()))
s = sum(a) #sにaの総投票数
a.sort(reserve=True)#aを降順にソート
if a[m-1] >= s*(1/4):
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
n, m = map(int,input().split())
a = list(map(int,input()split()))
s = sum(a) #sにaの総投票数
a.sort(reserve=True)#aを降順にソート
if a[m-1] >= s*(1/4):
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
from sys import stdin, stdout
n,m = map(int, stdin.readline().rstrip().split())
l = list(map(int, stdin.readline().rstrip().split()))
sum = sum(l)
k = sum/(4*m)
ans = "Yes"
l.sort(reverse = True)
for i in (0,m):
  if l[i]<k:
      ans="No"
      break
print(ans)

Submission status: Runtime Error

Solution code:
from sys import stdin, stdout
n,m = map(int, stdin.readline().rstrip().split(' '))
l = list(map(int, stdin.readline().rstrip().split(' ')))
sum = sum(l)
k = sum/(4*m)
ans = "Yes"
l.sort(reverse = True)
for i in (0,m):
  if l[i]<k:
      ans="No"
      break
print(ans)

Submission status: Runtime Error

Solution code:
from sys import stdin, stdout
n,m = map(int, stdin.readline().rstrip().split(' '))
l = list(map(int, stdin.readline().rstrip().split(' ')))
sum = sum(l)
k = sum/(4*m)
ans = "Yes"
l.sort(reverse = True)
for i in (0,m):
  if l[i]<k:
      ans="No"
print(ans)

Submission status: Runtime Error

Solution code:
n, m = map(int,input().strip().split())
lst = list(map(int, input().split()))
summ = 0
for i in lst:
    summ += i
# print(summ)
sol = 1/(m * 4)
# print(sol)
res = sol*summ
# print(res)
if lst[m] > res:
    print("YES")
else:
    print("NO")

Submission status: Runtime Error

Solution code:
2 = int(input())
num_list = [list(map(int, input().split())) for i in range(2)]

num_list[1].sort(reverse=True)
v = 1 / (4 * num_list[0][1]) * sum(num_list[1])

c = 1

for i in range(num_list[0][1]):
  if num_list[1][i] < v:
    c = 0
    
if c==1:
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

Solution code:
n = int(input())
num_list = [list(map(int, input().split())) for i in range(n)]

num_list[1].sort(reverse=True)
v = 1 / (4 * num_list[0][1]) * sum(num_list[1])

c = 1

for i in range(num_list[0][1]):
  if num_list[1][i] < v:
    c = 0
    
if c==1:
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

Solution code:
n = int(input())
num_list = [list(map(int, input().split())) for i in range(n)]

num_list[1].sort(reverse=True)
v = 1 / (4 * num_list[0][1]) * sum(num_list[1])

c = 1

for i in range(num_list[0][1]):
  if num_list[1][i] < v:
    c = 0
    
if bool(c):
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

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

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

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

Submission status: Runtime Error

Solution code:
num=input().rstrip().split(" ")
N=int(num[0])
M=int(num[1])
date=input().rstrip().split(" ")
sum=0
for i in range(N):
  sum+=int(date[N])
date=sorted(date,reverse=True)
if (sum/4)/M<=date[M-1]:
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

Solution code:
N, M = [int(i) for i in input().split()]
A = [int(i) for i in input().split()]
total_votes = sum(A)
minimum_votes = int(total_votes / (4 * M)))
eligible_products = 0

for vote in A:
    if vote >= minimum_votes:
        eligible_products += 1

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N, M = input().split()
vote = [input().split()]
vote.sort(reverse=True)
if (vote[i-1] >= 1 /(4*M)):
    print('Yes')
else:    
print('No')

Submission status: Runtime Error

Solution code:
x = input().split()
y = input().split()


a = [int(i) for i in x]
b = [int(i) for i in y]

M = a[1]
s = sum(b)
c = 0

for i in b:
    if i >= int((1/(4*M)*S):
        c += 1
    if c > 1:
        print("Yes")

print("No")

Submission status: Runtime Error

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

total = sum(a)
for vote in a:
  if vote < 1/(4*m) * total:
    print("No")
    
print("Yes")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N, M = input().split()
vote = []
for i in range(N):
  vote.append(int(input()))
vote.sort(reverse=True)
if (vote[i] >= 1 /(4*M)):
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N, M = input().split()
vote = []
for i in range(N):
  vote.append(int(input()))
vote.sort(reverse=True)
for i in range(M):
  if (vote[i] < 1 /(4*M)):
    print('No')
    break
print('Yes')

Submission status: Runtime Error

Solution code:
N, M = input().split()
vote = []
for i in range(N):
  vote.append(int(intput()))
vote.sort(reverse=True)
for i in range(M):
  if (vote[i] < 1 /(4*M)):
    print('No')
    break
print('Yes')

Submission status: Runtime Error

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

sum = 0
cnt = 0

for i in Ai:
	sum += i

sorted = Ai.sort(reverse=True)

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

Submission status: Runtime Error

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

for i in numList:
	sum += i

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

Submission status: Runtime Error

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

for i in numList:
	sum += i

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

Submission status: Runtime Error

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

y = 0
n = 0

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

Submission status: Runtime Error

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

y = 0
n = 0

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n,m=map(int,input().split(" "))
lis2=[]
for i in range(0,n):
	lis2.append(int(input()))
lis2=sorted(lis2,reverse=True)
sum1=sum(lis2)
count=0
for i in range(0,m):
  if(lis2[i]>=((1/(4*m))*sum1)):
    count=0
  else:
    count=1
    break
if(count==1):
  print("No")
else:
  print("Yes")

Submission status: Runtime Error

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

A.sort(reverse = True)

border=sum(A)/4/M

if A[M]>border:
  print(Yes)
else:
  print(No)

Submission status: Runtime Error

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

list.sort(A, reverse = True)

allsum=sum(A)

ok=A[M]

if ok>(sum(A))/4:
  print(Yes)
  
else:
  print(No)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
const ll oo = 1000000000000000000;
const ll mod = 1e9 + 7;
typedef pair <ll , ll> ii;
typedef vector<ii> vii;
typedef vector <ll> vi;
#define x first
#define y second

ll numsofnum , least , sum , cnt;
ll a[101];

int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);

    cin >> numsofnum >> least;

    for (int i = 1;i <= numsofnum;++i)
        cin >> a[i] , sum += a[i];

    sort(a + 1, a + numsofnum + 1 , greater <ll>());

    if (double(a[least]) >= double(sum / (4 * least)))
        cout << "Yes";
    else cout << "No";

    return 0;
}

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

vote = []

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

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

if len(vote) >= M:
    print("Yes")

else:
    print("No")

Submission status: Runtime Error

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

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

s = sum(a)

a.sort()

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

Submission status: Runtime Error

Solution code:
N = int(input().rstrip())
M = int(input(' '))
for i in range(N):
  int(input().rstrip())
  print(end = ' ')
if(M > N):
  print('No')
elif(N > M):
  print('Yes')

Submission status: Runtime Error

Solution code:
    def ans():
        n ,m = map(int, raw_input().split())
        A = list(map(int, raw_input().split()))
     
        divider = sum(A) / (4 * m + 1e-16)
     
        stack = 0
        for a in A:            
            if a >= divider:
                stack += 1
     
            if stack == m:
                return "Yes"
        return "No"        
     
     
    print ans()

Submission status: Runtime Error

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

Submission status: Runtime Error

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

A.sort(reverse=True)

total = A.sum()

if A[M]*4 < total:
  print('no')

else:
  print('yes')

Submission status: Runtime Error

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

def main():
    
    n,m = map(int,input().split())
    a = list(map(int,input().split()))
    t=sum(a)
    a.sort()
    a.reverse()
    print(a[m])
    
    if a[m-1]>=t/(4*m):
        print("Yes")
    else:
        print("No")

main()

Submission status: Runtime Error

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

def main():
    
    n,m = map(int,input().split())
    a = list(map(int,input().split()))
    t=sum(a)
    a.sort()
    a.reverse()

    if a[m]>t/(4*m):
        print("Yes")
    else:
        print("No")

main()

Submission status: Runtime Error

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

def main():
    
    n,m = map(int,input().split())
    a = list(map(int,input().split()))
    t=sum(a)
    a.sort()
    a.reverse()

    if a[m]>=t/(4*m):
        print("Yes")
    else:
        print("No")

main()

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n,m = list(map(int,input().split()))
a = list(map(int,input().split()))
a.sort(reverse = True)
f = "YES"
for i in range(m):
  a[i] < 1//m*4:
    f = "NO"
    break
print(f)

Submission status: Runtime Error

Solution code:
n,m = map(int,input().split())
a = list(map(int,input().split()))
a.sort(reverse=True)
sum_a = sum(a)
for i in range(n):
    if a[i] > sum_a/(4*m): 
        ans = i
# print(sum_a/(4*m))
if ans >=m:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

A = sum(a)
l = a.sort(reverse=True)

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

Submission status: Runtime Error

Solution code:
N,M=map(int,input().split())
A=list(map(int,input().split()))
x=sum(A)
if sum([i if a>=x/4/M else 0 for a in A])>=M:
  print('Yes')
else:
  print('No')

Submission status: Runtime Error

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

# リストaの総投票数をsに格納する
s = sum(a)

# リストaを降順にソートする
a.sort(reverse=True)

if a[m] >= s*(1/4/m):
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

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

s = a.sum()
min_num = s//(4*m)

res = "No"
count = 0
for x in a:
    if x >= min_num:
        count += 1
    if count >= m:
        res = "Yes"
        break
print(res)

Submission status: Runtime Error

Solution code:
n, m = map(int, input().split())
a = list(map(int, input().split()))
a = a.sort(reverse = True)
b = sum(a)
c = 0
d = "Yes"
l = 1 / (4 * m)
b = b * l
while c < m:
  if a[c] < b:
    d = "No"
  c += 1
print(d)

Submission status: Runtime Error

Solution code:
n, m = map(int, input().split())
a = list(map(int, input().split()))
a = sort(a)
b = sum(a)
c = 0
d = "Yes"
l = 1 / (4 * m)
b = b * l
while c < m:
  if a[c] < b:
    d = "No"
  c += 1
print(d)

Submission status: Runtime Error

Solution code:
def popularVote():
	n, m = list(map(int, input().split()))
    item_votes = list(map(int, input().split()))
    total = sum(item_votes)

    selected = []
    isSelected = False

    req = 1 / (4 * m)
    for item in item_votes:
        if item / total >= req:
            selected.append(item)

        if len(selected) == m:
            isSelected = True
            print("Yes")
            break

    if not isSelected:
        print("No")


popularVote()

Submission status: Runtime Error

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

    selected = []
    isSelected = False

    req = 1 / (4 * m)
    for item in item_votes:
        if item / total >= req:
            selected.append(item)

        if len(selected) == m:
            isSelected = True
            print("Yes")
            break

    if not isSelected:
        print("No")


popularVote()

Submission status: Runtime Error

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



total = sum(aList)
flag = "Yes"
for i in range(m):
    if aList[m] <= total/(4*m):
        flag = "No"
print(flag)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

total_item_votes = sum(item_votes)

item_vote_percentages = [item_votes/total_item_votes for item_votes in item_votes]

required_vote_percentage = 1/(4*m)

can_select = 0
for vote_percentage in item_vote_percentages:
  if vote_percentage > required_vote_percentage:
    can_select += 1

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

Submission status: Runtime Error

Solution code:
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n, m;
	cin >> n >> m;
	int arr[n];
	int sum = 0;
	for (int i = 0; i < n; i++)
	{
		cin >> arr[i];
		sum += arr[i];
	}
	sum = sum / (4 * m);
	sort(arr, arr + n);
	int counter = 0;
	for (int i = 0; i < n; i++)
	{
		if (arr[i] >= sum)
			counter++;
	}
	if (counter >= m)
		cout << "Yes" << endl;
	else
		cout << "No" << endl;
	return 0;
}

Submission status: Runtime Error

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

#総投票数を求める
sum_vote = sum(A)
#print(sum_vote)

#投票数が1/4Mを下回る物を削除していく つまり　新しいリストに代入
for i in range(len(A)):
    if A[i] => sum_vote * 1/(4 * M):
        B.append(A[i])
    else:
        pass

#最終判断
if len(B) >= M:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
#include<bits/stdc++.h>
#include<iomanip>
#define pb push_back 
#define lli long long int
#define block 700
#include<iostream>
#include<cmath>
using namespace std;
int main(void)
{
  	int n;
  	double m;
	   cin>>n>>m;
  	double ar[n+1];
  	int sum =0;
  	for(int i=0;i<n;i++)
  	{
  		cin>>ar[i];
  		sum += ar[i];
	}
	double v= (float)(1/(m*4));
	
	for(int i=0;i<n;i++)
	{
		double f1=(double)(ar[i]/sum);
		if(f1 >= v)
		{
			m--;
			
		}
		if(m <= 0)
		break;
	}
	if(m !=0)
	cout<<"No\n";
	else
	cout<<"Yes\n";
	return 0;
}

Submission status: Runtime Error

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

Submission status: Runtime Error

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

A.sort(reverse=True)
if A[M] < 1/(4*M):
  print('Yes')
else:
  print('No')

Submission status: Runtime Error

Solution code:
n,m=[int(x) for x in input().split()]
a = [int(x) for x in input().split()]
total = sum(a)
cnt = n
for i in range(0, n):
  if a[i] < int(total / (4 * m)):
    cnt -= 1
  if cnt < m:
    print("No")
    return
print("Yes")

Submission status: Runtime Error

Solution code:
nm=input().split()
vote=[int(i) in input().split()]
n=int(nm[0])
m=int(nm[1])
selectable=0
for v in vote:
	if v < 4*m:
		continue
	else:
		selectable+=1
if selectable>=m:
	print("Yes")
else:
	print("No")