Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
import math

l = input().split()
N = float(l[0])
X = float(l[1])

a = []
for i in ragne(int(N)):
    a.append(float(intput()))
    
sum = 0
for n in a:
    sum += n

min = min(a)
b = int(math.floor((X - sum) / min))

print(int(N) + b)

Fixed submission:
import math

l = input().split()
N = float(l[0])
X = float(l[1])

a = []
for i in range(int(N)):
    a.append(float(input()))

sum = 0
for n in a:
    sum += n

min = min(a)
b = int(math.floor((X - sum) / min))

print(int(N) + b)
Buggy python submission (verdict: Runtime Error):
l = input().split()
A = int(l[0])
B = int(l[1])
AB = int(l[2])
a = int(l[3])
b = int(l[4])

sum = 0

if A+B < AB*2:
    if a < b:
        sum += a*AB
        sum += b*B
    else:
        sum += b*AB
        sum += a*A
else:
    sum += a*A + b*B

print sum


Fixed submission:
l = list(map(int, input().split()))

sum = 0
a = b = c = 0

if l[0] > l[2]*2 or l[1] > l[2]*2:
    c1 = c2 = 0
    if l[0] > l[2]*2:
        c1 = 2 * l[3]
    if l[1] > l[2]*2:
        c2 = 2 * l[4]
    c = max([c1, c2])
elif l[0]+l[1] > l[2]*2:
    c += min([l[3], l[4]])*2
else:
    a = l[3]
    b = l[4]


if a+c/2 < l[3]:
    a += l[3]-(c/2+a)
if b+c/2 < l[4]:
    b += l[4]-(c/2+b)

sum = a*l[0] + b*l[1] + c*l[2]

print(int(sum))
Buggy python submission (verdict: Runtime Error):
AB = input()
S = input()

A = int(AB.split(" ")[0])
B = int(AB.split(" ")[1])

ints = "0123456789"


flag = True

if len(S) != A + B + 1:
    flag = False

if flag:
    for i in range(len(S)):
        if i != A:
            if not(S[i] in ints):
                flag = False
                return
        else:
            if S[i] != "-":
                flag = False
                return

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


Fixed submission:
AB = input()
S = input()

A = int(AB.split(" ")[0])
B = int(AB.split(" ")[1])

ints = "0123456789"


flag = True

if len(S) != A + B + 1:
    flag = False

if flag:
    for i in range(len(S)):
        if i != A:
            if not(S[i] in ints):
                flag = False
        else:
            if S[i] != "-":
                flag = False

if flag:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
N,M=map(int,input().split())
a=list(map(int,input().split()))
S=sum(a)
a.sort()
print(S/4*M)
print(a)
if a[N-M+1] >= S/4*M:
  print('Yes')
else:
  print('No')

Fixed submission:
N,M=map(int,input().split())
a=list(map(int,input().split()))
S=sum(a)
a.sort()
if a[N-M] >= S/(4*M):
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
N=int(input())
c=[[0 in range(10)] in range(10)] #c[i][j]=1以上N以下の整数で先頭i末尾jとなる数字の個数
for i in range(1,11):
  for j in range(1,11):
    for k in range(1,N+1):
      k=str(k)
      if k[0]==i and k[-1]==j:
        c[i][j]=c[i][j]+1
S=0
for i in range(1,11):
  for j in range(1,11):
    S=S+c[i][j]*c[j][i]
print(S)

Fixed submission:
N=int(input())
c=[[0 for z in range(10)] for z in range(10)] #c[i][j]=1以上N以下の整数で先頭i末尾jとなる数字の個数
for i in range(1,10):
  for j in range(1,10):
    for k in range(1,N+1):
      k=str(k)
      if k[0]==str(i) and k[-1]==str(j):
        c[i][j]=c[i][j]+1
S=0
for i in range(1,10):
  for j in range(1,10):
    S=S+c[i][j]*c[j][i]
print(S)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
S=1
for i in range(1,N):
  p=str(i+1)
  l=0
  c=0
  for j in range(1,i+2):
    q=str(j)
    if p[0]==q[-1] and p[-1]==q[0]:
      if j==i+1:
        l=1
      else:
        c=c+1
  S=S+2*c+l
print(S)

Fixed submission:
N=int(input())
c=[[0 for z in range(10)] for z in range(10)] #c[i][j]=1以上N以下の整数で先頭i末尾jとなる数字の個数
for i in range(1,10):
  for j in range(1,10):
    for k in range(1,N+1):
      k=str(k)
      if k[0]==str(i) and k[-1]==str(j):
        c[i][j]=c[i][j]+1
S=0
for i in range(1,10):
  for j in range(1,10):
    S=S+c[i][j]*c[j][i]
print(S)
Buggy python submission (verdict: Runtime Error):
N,M=map(int,input().split())
T=[]
frag=[0 for y in range(N)]
p=[0 for y in range(N)]
a=0
for i in range(M):
  s=list(map(str,input().split()))
  T.append(s)
for i in range(M):
  if T[i][1]=='WA' and frag[int(T[i][0])-1]==0:
    p[i]=p[i]+1
  elif T[i][1]=='AC' and frag[int(T[i][0])-1]==0:
    a=a+1
    frag[int(T[i][0])-1]=1
for i in range(N):
  if frag[i]==0:
    p[i]=0
print(a,sum(p))

Fixed submission:
N,M=map(int,input().split())
T=[]
frag=[0 for y in range(N)]
p=[0 for y in range(N)]
a=0
for i in range(M):
  s=list(map(str,input().split()))
  T.append(s)
for i in range(M):
  if T[i][1]=='WA' and frag[int(T[i][0])-1]==0:
    p[int(T[i][0])-1]=p[int(T[i][0])-1]+1
  elif T[i][1]=='AC' and frag[int(T[i][0])-1]==0:
    a=a+1
    frag[int(T[i][0])-1]=1
for i in range(N):
  if frag[i]==0:
    p[i]=0
print(a,sum(p))
Buggy python submission (verdict: Runtime Error):
s=input()
c=0
for i in range(int(len(s)/2)):
  if s[i] != s[N-1-i]:
    c=c+1
print(c)

Fixed submission:
s=input()
c=0
for i in range(int(len(s)/2)):
  if s[i] != s[len(s)-1-i]:
    c=c+1
print(c)
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
L=list(map(int,input().split()))
c=0
for i in range(N-2):
  for j in range(i+1,N-1):
    for k in range(j+1,N):
      if L[i]<L[j]+L[k] and L[j]<L[i]+L[k] and L[k]<L[i]+L[j]:
        c=c+1
print(c)

Fixed submission:
N=int(input())
L=list(map(int,input().split()))
L.sort()
c=0
for i in range(N-2):
  k=i+2
  for j in range(i+1,N-1):
    s=L[i]+L[j]
    c=c+k-j-1
    while L[k]<s and k<=N-2:
      k=k+1
      c=c+1
    if k==j+1 and s<=L[k]:
      k=k+1
    if k==N-1 and L[k]<s:
      c=c+1
print(c)
Buggy python submission (verdict: Time Limit Exceeded):
a,b=map(int,input().split())
t=min(a,b)
s=max(a,b)
c=1
i=2
while t > 1:
  frag=0
  while t%i ==0:
    t=t/i
    if frag==0 and s%i ==0:
      c=c+1
    frag=1
  if i==2:
    i=3
  else:
    i= i+2
print(c)

Fixed submission:
a,b=map(int,input().split())
t=min(a,b)
t1=t
s=max(a,b)
c=1
i=2
while t > 1 and i <=int(t1**(0.5)+1):
  frag=0
  while t%i ==0:
    t=t/i
    if frag==0 and s%i ==0:
      c=c+1
    frag=1
  if i==2:
    i=3
  else:
    i= i+2
if s%t==0 and t > int(t1**(0.5)+1):
  c=c+1
print(c)

Buggy python submission (verdict: Time Limit Exceeded):
a,b=map(int,input().split())
t=min(a,b)
s=max(a,b)
c=1
i=2
while t > 1:
  frag=0
  while t%i ==0:
    t=t/i
    if frag==0 and s%i ==0:
      c=c+1
    frag=1
  i=i+1
print(c)

Fixed submission:
a,b=map(int,input().split())
t=min(a,b)
t1=t
s=max(a,b)
c=1
i=2
while t > 1 and i <=int(t1**(0.5)+1):
  frag=0
  while t%i ==0:
    t=t/i
    if frag==0 and s%i ==0:
      c=c+1
    frag=1
  if i==2:
    i=3
  else:
    i= i+2
if s%t==0 and t > int(t1**(0.5)+1):
  c=c+1
print(c)
Buggy python submission (verdict: Runtime Error):
s=list(map(str,input().split()))
t=list(map(str,input().split()))
c=0
for i in range(3):
  if s[i]==t[i]:
    c=c+1
print(c)

Fixed submission:
s=str(input())
t=str(input())
s=[i for i in s]
t=[i for i in t]
c=0
for i in range(3):
  if s[i]==t[i]:
    c=c+1
print(c)
Buggy python submission (verdict: Runtime Error):
N=int(input())
if 1<=N<=9:
  print(N)
elif 1<=N<=99:
  print(9)
elif 100<=N<=999:
  print(9+N-100+1)
elif 1000<=N<=9999:
  print(909)
elif 10000<=N<=99999:
  print(909+N-10000+1)
elif N=100000:
  print(90909)

Fixed submission:
N=int(input())
if 1<=N<=9:
  print(N)
elif 1<=N<=99:
  print(9)
elif 100<=N<=999:
  print(9+N-100+1)
elif 1000<=N<=9999:
  print(909)
elif 10000<=N<=99999:
  print(909+N-10000+1)
elif N==100000:
  print(90909)
Buggy python submission (verdict: Runtime Error):
L,R=map(int,input().split())
l1=L//2019
l2=L%2019
r1=R//2019
r2=R%2019
if l1!=r1 or l2==0:
  print(0)
else:
  a = [2020]
  for i in range(l2,r2):
    for j in range(i+1,r2+1):
      c = (i*j)%2019
      a.append(c)
print(min(a))

Fixed submission:
L,R=map(int,input().split())
l1=L//2019
l2=L%2019
r1=R//2019
r2=R%2019
if l1!=r1 or l2==0:
  print(0)
else:
  a = [2020]
  for i in range(l2,r2):
    for j in range(i+1,r2+1):
      c = (i*j)%2019
      a.append(c)
  print(min(a))
Buggy python submission (verdict: Runtime Error):
n = int(input())
d = list(map(int,input().split()))
d.sort()
print(d[int(N/2)]-d[int(N/2)-1])

Fixed submission:
N = int(input())
d = list(map(int,input().split()))
d.sort()
print(d[int(N/2)]-d[int(N/2)-1])
Buggy python submission (verdict: Time Limit Exceeded):
s = input().split()
s = list(map(int,s))
A = s[0]
B = s[1]
C = s[2]
D = s[3]
k = 0
for i in range(A,B+1):
  if i%C != 0 and i%D != 0:
    k = k + 1
print(k)

Fixed submission:
s = input().split()
s = list(map(int,s))
A = s[0]
B = s[1]
C = s[2]
D = s[3]
if A%C > 0:
  i = B//C - A//C
else:
  i = B//C - A//C + 1
if A%D > 0:
  j = B//D - A//D
else:
  j = B//D - A//D + 1
from fractions import gcd
p = (C*D)//(gcd(C,D))
if A%p > 0:
  k = B//p - A//p
else:
  k = B//p - A//p + 1
print(B-A+1-(i + j - k))

Buggy python submission (verdict: Time Limit Exceeded):
s = input().split()
s = list(map(int,s))
A = s[0]
B = s[1]
C = s[2]
D = s[3]
k = 0
for i in range(A,B+1):
  if i%C != 0 and i%D != 0:
    k = k + 1
print(k)

Fixed submission:
s = input().split()
s = list(map(int,s))
A = s[0]
B = s[1]
C = s[2]
D = s[3]
if A%C > 0:
  i = B//C - A//C
else:
  i = B//C - A//C + 1
if A%D > 0:
  j = B//D - A//D
else:
  j = B//D - A//D + 1
from fractions import gcd
p = (C*D)//(gcd(C,D))
if A%p > 0:
  k = B//p - A//p
else:
  k = B//p - A//p + 1
print(B-A+1-(i + j - k))

Buggy python submission (verdict: Runtime Error):
s = input().split()
A = s[0]
B = s[1]
C = s[2]
D = s[3]
k = 0
for i in range(A,B+1):
  if i%C != 0 and i%D != 0:
    k = k + 1
print(k)

Fixed submission:
s = input().split()
s = list(map(int,s))
A = s[0]
B = s[1]
C = s[2]
D = s[3]
if A%C > 0:
  i = B//C - A//C
else:
  i = B//C - A//C + 1
if A%D > 0:
  j = B//D - A//D
else:
  j = B//D - A//D + 1
from fractions import gcd
p = (C*D)//(gcd(C,D))
if A%p > 0:
  k = B//p - A//p
else:
  k = B//p - A//p + 1
print(B-A+1-(i + j - k))
Buggy python submission (verdict: Runtime Error):
N = int(input())
p = [[0,0]]*N
for i in range(N):
  p[i] = input().split()
  p[i] = list(map(int,p[i]))
p = sorted(p,key = lambda x:x=p[1])
s = [0]*N
s[0] = p[0][0]
for i in range(N-1):
  s[i+1] = s[i] + p[i+1][0]
k = 0
for i in range(N):
  if s[i] <= p[i][1]:
    k = k + 1
  else:
    print('No')
    break
if k == N:
  print('Yes')

Fixed submission:
N = int(input())
p = [[0,0]]*N
for i in range(N):
  p[i] = input().split()
  p[i] = list(map(int,p[i]))
p = sorted(p,key = lambda p:p[1])
s = [0]*N
s[0] = p[0][0]
for i in range(N-1):
  s[i+1] = s[i] + p[i+1][0]
k = 0
for i in range(N):
  if s[i] <= p[i][1]:
    k = k + 1
  else:
    print('No')
    break
if k == N:
  print('Yes')
Buggy python submission (verdict: Runtime Error):
n,x = map(int,input().split())
l = list(map(int,input().split()))
d = [0]*(n+1)
for i in range(n+1):
  d[i+1] = d[i] + l[i]
  if d[i+1] > x:
    print(i+1)
    break

Fixed submission:
n,x = map(int,input().split())
l = list(map(int,input().split()))
d = [0]*(n+1)
for i in range(n):
  d[i+1] = d[i] + l[i]
  if d[i+1] > x:
    print(i+1)
    d[n] = x + 1
    break
if d[n] <= x:
  print(n+1)
Buggy python submission (verdict: Time Limit Exceeded):
s = input()
t = input()
n = len(s)
p = n*(n-1)/2
i = 0
j = 1
k = 0
for _ in range(int(p)):
  if s[i] == s[j] and t[i] == t[j]:
    k = k + 1
  elif s[i] != s[j] and t[i] != t[j]:
    k = k + 1
  else:
    print('No')
    break
  j = j + 1
  if j == n:
    i = i + 1
    j = i + 1
if k == p:
  print('Yes')

Fixed submission:
S=input()
T=input()
a=[None]*26
b=[None]*26
k=1
for i in range(26):
    for j in range(len(S)):
        if S[j]==chr(97+i):
            if a[i]==None:
                a[i]=T[j]
            else:
                if T[j]!=a[i]:
                    k=0
                    break
for i in range(26):
    for j in range(len(S)):
        if T[j]==chr(97+i):
            if b[i]==None:
                b[i]=S[j]
            else:
                if S[j]!=b[i]:
                    k=0
                    break
if k==1:print("Yes")
else:print("No")
Buggy python submission (verdict: Runtime Error):
import sys
nCr = {}
def cmb(n, r):
    if r == 0 or r == n: return 1
    if r == 1: return n
    if (n,r) in nCr: return nCr[(n,r)]
    nCr[(n,r)] = cmb(n-1,r) + cmb(n-1,r-1)
    return nCr[(n,r)]
md=10**9+7

n,m=map(int,input().split())
s=[[0,0]]
if m==1:
  s.append([1,1])
for i in range(2,int(m**(0.5)+1)):
  k=0
  frag = 0
  if m%i!=0:
    frag = 1
  while m%i==0:
    m=int(m/i)
    k=k+1
  if frag == 0:
    s.append([i,k])
if m!=1:
  s.append([m,1])
q = [0]*(len(s)-1)
for i in range(1,len(s)):
  q[i-1] = s[i][1]

t = 1
for i in range(len(q)):
  c = cmb(n-1+q[i],q[i])
  t = t*(c%md)
  
print(t%md)

Fixed submission:
from operator import mul
from functools import reduce

def cmb(n,r):
    r = min(n-r,r)
    if r == 0: return 1
    elif n<r: return 0
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under
md=10**9+7

n,m=map(int,input().split())
s=[[0,0]]
for i in range(2,int(m**(0.5)+1)):
  k=0
  frag = 0
  if m%i!=0:
    frag = 1
  while m%i==0:
    m=int(m/i)
    k=k+1
  if frag == 0:
    s.append([i,k])
if m!=1:
  s.append([m,1])
q = [0]*(len(s)-1)
for i in range(1,len(s)):
  q[i-1] = s[i][1]

t = 1
for i in range(len(q)):
  c = cmb(n-1+q[i],q[i])
  t = t*(c%md)
  
print(t%md)
Buggy python submission (verdict: Runtime Error):
s = input().split()
a = int(s[0])
b = int(s[1])
if (a*b)%2 == 0:
  print(Even)
else:
  print(Odd)

Fixed submission:
s = input().split()
a = int(s[0])
b = int(s[1])
if (a*b)%2 == 0:
  print('Even')
else:
  print('Odd')

Buggy python submission (verdict: Runtime Error):
s = input().split()
a = int(s[0])
b = int(s[1])
c = (a*b)/2
if c =! int(c):
  print('Odd')
else:
  print('Even')

Fixed submission:
s = input().split()
a = int(s[0])
b = int(s[1])
if (a*b)%2 == 0:
  print('Even')
else:
  print('Odd')

Buggy python submission (verdict: Runtime Error):
s = input().split()
a = int(s[0])
b = int(s[1])
c = (a*b)/2
if c =! int(c):
  print(Odd)
else:
  print(Even)

Fixed submission:
s = input().split()
a = int(s[0])
b = int(s[1])
if (a*b)%2 == 0:
  print('Even')
else:
  print('Odd')

Buggy python submission (verdict: Runtime Error):
s = input().split()
a = int(s[0])
b = int(s[1])
c = (a*b)/2
if c != int(c):
  print(Odd)
else:
  print(Even)

Fixed submission:
s = input().split()
a = int(s[0])
b = int(s[1])
if (a*b)%2 == 0:
  print('Even')
else:
  print('Odd')

Buggy python submission (verdict: Runtime Error):
s = input().split()
a = float(s[0])
b = float(s[1])
if a/2 != int(a/2) and b/2 != int(b/2):
  print(Odd)
else:
  print(Even)

Fixed submission:
s = input().split()
a = int(s[0])
b = int(s[1])
if (a*b)%2 == 0:
  print('Even')
else:
  print('Odd')

Buggy python submission (verdict: Runtime Error):
s = input().split()
a = int(s[0])
b = int(s[1])
if a/2 != int(a/2) and b/2 != int(b/2):
  print(Odd)
else:
  print(Even)

Fixed submission:
s = input().split()
a = int(s[0])
b = int(s[1])
if (a*b)%2 == 0:
  print('Even')
else:
  print('Odd')
Buggy python submission (verdict: Runtime Error):
m = input().split()
N = int(m[0])
Y = int(m[1])
if Y > 10000*N:
  print(-1,-1,-1)
else:
  frag = 1
  for i in range(N+1):
    for j in range(N-i+1):
      if frag == 1 and 10000*i + 5000*j + 1000*(N-i-j) == Y:
        frag == 0
        print(i,j,k)
        break
  if frag == 1:
    print(-1,-1,-1)

Fixed submission:
m = input().split()
N = int(m[0])
Y = int(m[1])
if Y > 10000*N:
  print(-1,-1,-1)
else:
  frag = 0
  for i in range(N+1):
    for j in range(N-i+1):
      if frag == 0 and 10000*i + 5000*j + 1000*(N-i-j) == Y:
        frag = 1
        print(i,j,N-i-j)
        break
  if frag == 0:
    print(-1,-1,-1)

Buggy python submission (verdict: Runtime Error):
m = input().split()
N = int(m[0])
Y = int(m[1])
if Y > 10000*N:
  print(-1,-1,-1)
else:
  frag == 1
  for i in range(N+1):
    for j in range(N-i+1):
      if frag == 1 and 10000*i + 5000*j + 1000*(N-i-j) == Y:
        frag == 0
        print(i,j,k)
        break
  if frag == 1:
    print(-1,-1,-1)

Fixed submission:
m = input().split()
N = int(m[0])
Y = int(m[1])
if Y > 10000*N:
  print(-1,-1,-1)
else:
  frag = 0
  for i in range(N+1):
    for j in range(N-i+1):
      if frag == 0 and 10000*i + 5000*j + 1000*(N-i-j) == Y:
        frag = 1
        print(i,j,N-i-j)
        break
  if frag == 0:
    print(-1,-1,-1)
Buggy python submission (verdict: Runtime Error):
s = input().split()
N = int(s[0])
A = int(s[1])
B = int(s[2])
k = 0
for i in range(1,N+1):
  S = 0
  while l >= 1:
    l = i
    p = l%10
    l = l//10
    S = S + p
  if A <= S <= B:
    k = k + i
print(k)

Fixed submission:
s = input().split()
N = int(s[0])
A = int(s[1])
B = int(s[2])
k = 0
for i in range(1,N+1):
  S = 0
  p = str(i)
  q = [str(c) for c in p]
  q = list(map(int,q))
  for j in range(len(q)):
    S = S + q[j]
  if A <= S <= B:
    k = k + i
print(k)
Buggy python submission (verdict: Runtime Error):
s = input().split()
k = 0
for i in range(3):
  if s[i] == '1':
    k = k + 1
print(k)

Fixed submission:
s = (input())
p = [int(c) for c in s]
k = 0
for i in range(3):
  if p[i] == 1:
    k = k + 1
print(k)
Buggy python submission (verdict: Runtime Error):
N = input()
a = input().split()
a = list(map(int,a))
n = 0
p = N
while p == N:
  p = 0
  for i in range(N):
    if a[i]%2 == 0:
      p = p + 1
  if p == N:
    a = list(map(lambda x: x/2,a))
    n = n + 1
print(n)

Fixed submission:
N = int(input())
a = input().split()
a = list(map(int,a))
n = 0
p = N
while p == N:
  p = 0
  for i in range(N):
    if a[i]%2 == 0:
      p = p + 1
  if p == N:
    a = list(map(lambda x: x/2,a))
    n = n + 1
print(n)
Buggy python submission (verdict: Time Limit Exceeded):
S = input()
S = S[::-1]
t = ['maerd','remaerd','esare','resare']
i = 0
frag = 0
while i <= len(S)-1 and frag == 0:
  k = 0
  for j in range(4):
    d = t[j]
    if S[i:len(d)+i] == d:
      break
      i = i + len(d)
    else:
      k = k + 1
      if k == 4:
        frag = 1
        print('NO')
if i == len(S):
  print('YES')

Fixed submission:
S = input()
S = S[::-1]
t = ['maerd','remaerd','esare','resare']
i = 0
frag = 0
while i <= len(S)-1 and frag == 0:
  k = 0
  for j in range(4):
    d = t[j]
    if S[i:len(d)+i] == d:
      i = i + len(d)
    else:
      k = k + 1
      if k == 4:
        frag = 1
        print('NO')
if i == len(S):
  print('YES')
Buggy python submission (verdict: Runtime Error):
n, m = input().split()
n, m = int(n), int(m)
a = input().split()
a = [int(i) for i in a]
a.sort()
a.reverse()
for i in range(n):
  if a[i] < 1/4m:
    print("No")
    break
  if i == m-1:
    print("Yes")
    break


Fixed submission:
n, m = input().split()
n, m = int(n), int(m)
a = input().split()
a = [int(i) for i in a]
a.sort()
a.reverse()
s = 1/(4*m)*sum(i for i in a)
for i in range(n):
    if a[i] < s:
        print("No")
        break
    if i == m-1:
        print("Yes")
        break

Buggy python submission (verdict: Runtime Error):
n, m = input().split()
n, m = int(n), int(m)
a = input().split()
a = [int(i) for i in a]
a.sort()
a.reverse()
for i in range(n):
  if a[i] < 1/4m:
    print("No")
    break
  if i == m:
    print("Yes")
    break

Fixed submission:
n, m = input().split()
n, m = int(n), int(m)
a = input().split()
a = [int(i) for i in a]
a.sort()
a.reverse()
s = 1/(4*m)*sum(i for i in a)
for i in range(n):
    if a[i] < s:
        print("No")
        break
    if i == m-1:
        print("Yes")
        break
Buggy python submission (verdict: Runtime Error):
n, x, y = input().split()
n, x, y = int(n), int(x)-1, int(y)-1
d = [[abs(i-j) for i in range(n)] for j in range(n)]
for i in range(x+1):
    for j in range(y, n):
        d[i][j] -= y-x-1
    for j in range(y-1, x+(y-x)//2, -1):
        d[i][j] = d[i][j+1]+1
for i in range(x+1, x+(y-x)//2):
    for j in range(y, n):
        d[i][j] -= i-x
    for j in range(y-1, y-(y-x)//4+1, -1):
        d[i][j] = d[i][j+1]+1
apar = [0 for i in range(n)]
for i in range(n-1):
    for j in range(i+1, n):
        apar[d[i][j]] += 1
for i in range(1, n):
    print(apar[i])


Fixed submission:
n, x, y = input().split()
n, x, y = int(n), int(x)-1, int(y)-1
d = [[abs(i-j) for i in range(n)] for j in range(n)]
for i in range(x+1):
    for j in range(y, n):
        d[i][j] -= y-x-1
    for j in range(y-1, x+(y-x)//2, -1):
        d[i][j] = d[i][j+1]+1
for i in range(x+1, x+(y-x)//2):
    d[i][y] = d[i][x] + 1
    for j in range(y+1, n):
        d[i][j] = d[i][j-1]+1
    for j in range(y-1, x+(y-x)//2+(i-x), -1):
        d[i][j] = d[i][j+1]+1
apar = [0 for i in range(n)]
for i in range(n-1):
    for j in range(i+1, n):
        apar[d[i][j]] += 1
for i in range(1, n):
    print(apar[i])

Buggy python submission (verdict: Runtime Error):
n, x, y = input().split()
n, x, y = int(n), int(x)-1, int(y)-1
d = [[abs(i-j) for i in range(n)] for j in range(n)]
for i in range(x+1):
    for j in range(y, n):
        d[i][j] -= y-x-1
    for j in range(y-1, x+(y-x)//2, -1):
        d[i][j] = d[i][j+1]+1
for i in range(x+1, x+(y-x)//2):
    for j in range(y, n):
        d[i][j] -= i-x
    for j in range(y-1, x+3*(y-x)//4, -1):
        d[i][j] = d[i][j+1]+1
apar = [0 for i in range(n)]
for i in range(n-1):
    for j in range(i+1, n):
        apar[d[i][j]] += 1
for i in range(1, n):
    print(apar[i])


Fixed submission:
n, x, y = input().split()
n, x, y = int(n), int(x)-1, int(y)-1
d = [[abs(i-j) for i in range(n)] for j in range(n)]
for i in range(x+1):
    for j in range(y, n):
        d[i][j] -= y-x-1
    for j in range(y-1, x+(y-x)//2, -1):
        d[i][j] = d[i][j+1]+1
for i in range(x+1, x+(y-x)//2):
    d[i][y] = d[i][x] + 1
    for j in range(y+1, n):
        d[i][j] = d[i][j-1]+1
    for j in range(y-1, x+(y-x)//2+(i-x), -1):
        d[i][j] = d[i][j+1]+1
apar = [0 for i in range(n)]
for i in range(n-1):
    for j in range(i+1, n):
        apar[d[i][j]] += 1
for i in range(1, n):
    print(apar[i])
Buggy python submission (verdict: Runtime Error):
n, m = int(input()), int(input())
print(n*(n-1)//2+m*(m-1)//2)


Fixed submission:
n, m = [int(x) for x in input().split()]
print(n*(n-1)//2+m*(m-1)//2)
Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, input().split())
H = sorted(map(int, input().split()), reverse=True)

while K > 0 and len(H) > 0:
    H.pop(0)
    K -= 1

c = 0
for h in H:
    c += h

print(c)

Fixed submission:
N, K = map(int, input().split())
H = sorted(map(int, input().split()), reverse=True)

if K >= N:
    print(0)
else:
    sum = [0]
    for i in range(0, N):
        #print(sum, H[i], sum[i-1], i)
        sum.append(sum[i]+H[i])

    #print(sum)
    print(sum[N]- sum[K])
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
A = list(map(int, input().split(' ')))

c = 0
for i in range(n):
    can = True
    for j in range(0, i):
        if A[i] > A[j]:
            can = False
            break
    #if can: print(i)
    if can: c+=1

print(c)

Fixed submission:
n = int(input())
A = list(map(int, input().split(' ')))

mi = [A[0]]
for i in range(1, n):
    if mi[i-1] > A[i]:
        mi.append(A[i])
    else:
        mi.append(mi[i-1])

#print(mi)

c = 1
for i in range(1, n):
    if A[i] <= mi[i]: c+=1

print(c)