Harryxun/GPT-100-sft-dataset huggingface dataset:
Problem p03268 (python)

Fixed submission:
n,k=map(int,input().split())
if k%2:
  print((n//k)**3)
else:
  l=k//2
  print(((n+l)//k)**3+(n//k)**3)

Buggy submission (verdict: Runtime Error):
n,k=map(int,input())
if k%2:
  print((n//k)**3)
else:
  l=k//2
  if l%2:
    print(((n+l)//k)**3)
  else:
    print(((n+l)//k)**3 + (n//k)**3)
Problem p03302 (python)

Fixed submission:
a,b=map(int,input().split());print("x*+"[(a*b==15)+(a+b==15)*2])

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split());print("x*+"[(a*b==15)+(a+b==15)*2]
Problem p03309 (python)

Fixed submission:
n,*l=map(int,open(0).read().split())
a=sorted([l[i]-i-1for i in range(n)])
f=lambda x:sum(abs(l[i]-i-1-x)for i in range(n))
print(min(f(a[n//2]),f(a[n//2+(n>1)])))

Buggy submission (verdict: Runtime Error):
n,*l=map(int,open(0).read().split())
a=sorted([l[i]-i-1for i in range(n)])
f=lambda x:sum(abs(l[i]-i-1-x)for i in range(n))
print(min(f(a[n//2]),f(a[n//2+1])))
Problem p03420 (python)

Fixed submission:
n,k=map(int,input().split());print(sum(n//b*(b-k)+max(n%b-k+(k>0),0)for b in range(k+1,n+1)))

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split());print(sum(n//b*(b-k)+max(n%b-k+(k>0),0)for b in range(k,n+1)))
Problem p03428 (python)

Fixed submission:
from scipy.spatial import ConvexHull as CH
import numpy as np
norm=np.linalg.norm
n,*t=map(int,open(0).read().split())
a=np.reshape(t,(n,2))
try:
	h = CH(a).vertices
except:
	a=a-10**6
	if np.all(a[:,0]==a[0,0]):
		a=np.fliplr(a)
	b=a[:,0]
	M=np.argmax(b)
	m=np.argmin(b)
	for i in range(n):
		print(0.5*(i in (m,M)))
	exit()
l=len(h)
for i in range(n):
	if i in h:
		j=np.where(h==i)[0]
		f,s,t=a[h[j-1]],a[i],a[h[(j+1)%l]]
		print(np.arccos(np.inner(t-s,s-f)/(norm(t-s)*norm(s-f)))[0,0]/(2*np.pi))
	else:
		print(0.)

Buggy submission (verdict: Runtime Error):
from scipy.spatial import ConvexHull as CH
import numpy as np
norm=np.linalg.norm
n,*t=map(int,open(0).read().split())
a=np.reshape(t,(n,2))
h=CH(a).vertices
l=len(h)
for i in range(n):
	if i in h:
		j=np.where(h==i)[0]
		f,s,t=a[h[j-1]],a[i],a[h[(j+1)%l]]
		print(np.arccos(np.inner(t-s,s-f)/(norm(t-s)*norm(s-f)))[0,0]/(2*np.pi))
	else:
		print(0.)
Problem p03456 (python)

Fixed submission:
a=int(input().replace(" ",""))
print("No"if a**0.5%1 else "Yes")

Buggy submission (verdict: Runtime Error):
a=int(input().replace(" ",""))
print("YNeos"[(a**0.5)*2!=floor(a)::2])
Problem p03488 (python)

Fixed submission:
l = [len(c) for c in input().split("T")]
x, y = map(int, input().split())
bx = 1 << l.pop(0) + 8000
by = 1 << 8000
for i, d in enumerate(l):
	if i % 2:
		bx = (bx << d) | (bx >> d)
	else:
		by = (by << d) | (by >> d)
print("Yes" if bx & (1 << x + 8000) and by & (1 << y + 8000) else "No")

Buggy submission (verdict: Runtime Error):
f,*l=map(len,input().split("T"))
x,y=map(int,input().split())
z=8000;bx=1<<f+z;by=1<<z
for dy,dx in zip(*[iter(l)]*2):bx=bx<<dx|bx>>dx;by=by<<dy|by>>dy
print("Yes"*(bx&(1<<x+z) and by&(1<<y+z))or"No")
Problem p03564 (python)

Fixed submission:
n,k=map(int,open(0))
a=1
while a<k and n:a*=2;n-=1
print(a+k*n)

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
a=1
while a<k and n:a*=2;n-=1
print(a+k*n)
Problem p03635 (python)

Fixed submission:
n,m=map(int,input().split());print(~-m*~-n)

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
prnt((n-1)*(m-1))
Problem p03659 (python)

Fixed submission:
n,*a=map(int,open(0).read().split())
x=a[0]
y=sum(a[1:])
ans=abs(x-y)
for i in a[1:-1]:
  x+=i
  y-=i
  ans=min(ans,abs(x-y))
print(ans)

Buggy submission (verdict: Runtime Error):
n,*a=map(int,open(0).read().split())
x=a[0]
y=a[1:]
ans=abs(x-y)
for i in a[1:-1]:
  x+=i
  y-=i
  ans=min(ans,abs(x-y))
print(ans)
Problem p03679 (python)

Fixed submission:
x,a,b=map(int,input().split());print(("delicious","safe","dangerous")[(b-a>0)+(b-a>x)])

Buggy submission (verdict: Runtime Error):
x,a,b=map(int,input().split());print(("delicious,"safe","dangerous")[(b-a>0)+(b-a>x)])
Problem p03732 (python)

Fixed submission:
N,W,*L=map(int,open(0).read().split())
w1=L[0]
l=[[] for _ in range(4)]
for w,v in zip(*[iter(L)]*2):
	l[w-w1].append(v)
l=[sorted(t)[::-1] for t in l]
a,b,c,d=map(len,l)
ans=0
for h in range(a+1):
	for i in range(b+1):
		for j in range(c+1):
			for k in range(d+1):
				if w1*h+(w1+1)*i+(w1+2)*j+(w1+3)*k<=W:
					ans=max(ans,sum(l[0][:h]+l[1][:i]+l[2][:j]+l[3][:k]))
print(ans)

Buggy submission (verdict: Runtime Error):
N,W,*l = map(int,open(0).read().split())
wl = l[::2]
vl = l[1::2]
M = N*max(vl)
INF = float("inf")
dp = [[INF]*(M+1) for _ in range(N+1)]
dp[0][0] = 0

for i in range(N):
	w,v = wl[i],vl[i]
	for j in range(M+1):
		if j >= v:
			dp[i+1][j] = min(dp[i][j],dp[i][j-v]+w)
		else:
			dp[i+1][j] = dp[i][j]

ans=0
for val,wei in enumerate(dp[-1]):
	if wei <= W:
		ans = max(ans,val)
print(ans)
Problem p03797 (python)

Fixed submission:
s,c=map(int,input().split())
print(min(s,c//2)+max(0,c-s*2)//4)

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
print(min(s,c//2)+max(0,c-s*2)//4)
Problem p03808 (python)

Fixed submission:
n,*a=map(int,open(0).read().split())
d=[j-i for i,j in zip(a,a[1:]+[a[0]])]
M=max(d)
dd=[M-x for x in d]
if n==1:
	print("YES")
elif (n==2 and sum(a)%3) or any(x%n for x in dd) or sum(x//n for x in dd)!=M or sum(a)//M!=n*(n+1)//2:
	print("NO")
else:
	print("YES")

Buggy submission (verdict: Runtime Error):
n,*a=map(int,open(0).read().split())
d=[j-i for i,j in zip(a,a[1:]+[a[0]])]
M=max(d)
dd=[M-x for x in d]
if (n==2 and sum(a)%3) or any(x%n for x in dd) or sum(x//n for x in dd)!=M or sum(a)//M!=n*(n+1)//2:
	print("NO")
else:
	print("YES")

Buggy submission (verdict: Runtime Error):
n,*a=map(int,open(0).read().split())
d=[j-i for i,j in zip(a,a[1:]+[a[0]])]
M=max(d)
dd=[M-x for x in d]
if n==1 or (all(x%n==0 for x in dd) and sum(x//n for x in dd)==M and sum(a)//M==n*(n+1)//2):
	print("YES")
else:
	print("NO")

Buggy submission (verdict: Runtime Error):
n,*a=map(int,open(0).read().split())
d=[j-i for i,j in zip(a,a[1:]+[a[0]])]
M=max(d)
dd=[M-x for x in d]
if all(x%n==0 for x in dd) and sum(x//n for x in dd)==M and sum(a)//M==n*(n+1)//2:
	print("YES")
else:
	print("NO")
Problem p03813 (python)

Fixed submission:
print("ABC"*(int(input())<1200)or"ARC")

Buggy submission (verdict: Runtime Error):
print("ABC"*(int(input()<1200))or"ARC")
Problem p03957 (python)

Fixed submission:
import re
print("YNeos"[not re.match('.*C.*F',input())::2])

Buggy submission (verdict: Runtime Error):
import re
print("YNEOS"[1-re.match('.*C.*F',input())::2]
Problem p04013 (python)

Fixed submission:
n,*x=map(int,open(0).read().split())
y=[x[0]-i for i in x]
m=n*max(x)
dp=[[0]*(m*2+1) for _ in range(n+1)]
dp[0][0]=1
for i in range(1,n+1):
	for s in range(-m,m):
		dp[i][s]=dp[i-1][s]+dp[i-1][s-y[i]]
print(dp[n][0]-1)

Buggy submission (verdict: Runtime Error):
from collections import Counter

from operator import mul
from functools import reduce
def cmb(n,r):
	if n < r:return 0
	if r == 0 or n-r == 0:return 1
	r = min(n-r,r)
	u = reduce(mul, range(n, n-r, -1))
	d = reduce(mul, range(1,r+1))
	return u//d

n,a,*x = map(int,open(0).read().split())
dp = [[0]*(n*max(x)+1)for _ in range(n+1)]
dp[0][0] = 1
lim1 = lim2 = 1
for k,v in Counter(x).items():
	for i in range(1,v+1):
		c = cmb(v,i)
		for j in range(lim1)[::-1]:
			for s in range(lim2)[::-1]:
				dp[j+i][s+k*i] += dp[j][s]*c
	lim1 += v
	lim2 += k*v
cnt = 0
for i in range(1,n+1):
	cnt += dp[i][i*a]
print(cnt)
Problem p04015 (python)

Fixed submission:
n,a,*x=map(int,open(0).read().split());dp={0:1}
for i in x:
	for k,v in set(dp.items()):
		dp[i+k-a]=dp.get(i+k-a,0)+v
print(dp[0]-1)

Buggy submission (verdict: Runtime Error):
n,a,*x=map(int,open(0).read().split());dp={0:1}
for i in x:
	for k,v in dp.items():
		dp[i+k-a]=dp.get(i+k-a,0)+v
print(dp[0]-1)
Problem p04031 (python)

Fixed submission:
n,*A=map(int,open(0).read().split());print(min(sum((x-a)**2for a in A)for x in range(-100,101)))

Buggy submission (verdict: Runtime Error):
from scipy.optimize import*;n,a=open(0)
print(round(minimize(lambda x:sum((x-int(b))**2 for b in a.split()),0)["fun"]))
Problem p03260 (python)

Fixed submission:
a, b = map(int, input().split(' '))
if a*b % 2 == 0:
    print('No')
else:
    print('Yes')

Buggy submission (verdict: Runtime Error):
a, b = int(input())
if a*b % 2 == 0
    print('No')
else:
    print('Yes')
Problem p03262 (python)

Fixed submission:
import numpy as np
import math
from functools import reduce

def gcd(a, b):
    while b:
        a, b = b, a % b

    return a

def multi_gcd(*numbers):
    return reduce(gcd, numbers)

N, X = map(int, input().split(' '))
city = np.array(list(map(int, input().split(' '))))

city -= X
print(abs(multi_gcd(*city)))

Buggy submission (verdict: Runtime Error):
import numpy as np
import math
from functools import reduce

def gcd(*numbers):
    return reduce(math.gcd, numbers)

N, X = map(int, input().split(' '))
city = np.array(list(map(int, input().split(' '))))

city -= X
print(gcd(*city))
Problem p03353 (python)

Fixed submission:
if __name__ == '__main__':
    s = input()
    K = int(input())

    subs = []
    for i in range(len(s)):
      for j in range(K):
            try:
                subs.append(s[i:i+j+1])
            except:
                break
    subs = set(subs)
    print(sorted(list(subs))[K-1])

Buggy submission (verdict: Runtime Error):
if __name__ == '__main__':
    s = input()
    K = int(input())

    subs = []
    for i in range(len(s)):                                                                                                                                                   for j in range(K):
            try:
                subs.append(s[i:i+j+1])
            except:
                break
    subs = set(subs)
    print(sorted(list(subs))[K-1])
Problem p03423 (python)

Fixed submission:
if __name__ =='__main__':
    N = int(input())

    print(N // 3)

Buggy submission (verdict: Runtime Error):
if __name__ == '__main__':
    N = int(input())
    S = set(input().split(' '))

    if len(S) == 3:
        print('Three')
    else:
        print('Four')

Buggy submission (verdict: Runtime Error):
import java.util.*;

public class Main {
    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        int N = Integer.parseInt(sc.next());

        System.out.println(N / 3);
    }

}
Problem p03433 (python)

Fixed submission:
if __name__=='__main__':
    N = int(input())
    A = int(input())

    a = N//500 * 500

    if N-a <= A:
        print('Yes')
    else:
        print('No')

Buggy submission (verdict: Runtime Error):
import numpy as np

def solve(posi):
    INF = 100000000000
    d = np.zeros((H, W))
    for i in range(H):
        for j in range(W):
            d[i][j] = INF
    que = [posi]
    d[posi[0],posi[1]] = 0

    move = np.array([[1,0], [-1,0], [0,1], [0,-1]])
    while len(que):
        p = que.pop(0)
        if np.allclose(posi, np.array([H-1,W-1])):
            break

        for dir in move:
            new_p = p + dir
            if 0 <= new_p[0] and new_p[0] < H and 0 <= new_p[1] and new_p[1] < W:
                if d[new_p[0],new_p[1]] == INF and maze[new_p[0]][new_p[1]] != '#':
                    que.append(new_p)
                    d[new_p[0],new_p[1]] = d[p[0], p[1]] + 1

    if d[H-1][W-1] == INF:
        return -1
    return d[H-1][W-1]

if __name__=='__main__':
    H, W  = map(int, input().split(' '))
    maze = []
    for i in range(H):
        maze.append(list(input()))
    counter = 0
    for i in range(H):
        for j in range(W):
            if maze[i][j] == '.':
                counter += 1

    posi = np.array([0,0])
    print(int(counter - solve(posi) - 1))
Problem p02658 (python)

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
ans = 1
if 0 in a :
    ans = 0

else:
    for i in range(n):
        ans *= a[i]
        if ans >10**18:
            ans = -1
            break
            
print(ans)

Buggy submission (verdict: Runtime Error):
input()
a = eval(input().replace(' ','*'))
if a <= 10**18:
    print(a)
else:
    print(-1)

Buggy submission (verdict: Runtime Error):
input()
a = eval(input().replace(' ','*'))
print([a,-1][a>10**18])

Buggy submission (verdict: Runtime Error):
input()
a = eval(input().replace(' ','*'))
print([a,-1][a>=10**18])
Problem p03076 (python)

Fixed submission:
t = []
ans = 0
for i in range(5):
    a = int(input())
    if a%10 == 0:
        ans += a
        t.append(0)
    
    else:
        x = 10-a%10
        ans += a + x
        t.append(x)
    
ans -= max(t)
print(ans)

Buggy submission (verdict: Runtime Error):
t = []
ans = 0
for i in range(5):
    a = int(input())
    if a%10 == 0:
        ans += a
    
    else:
        x = 10-a%10
        ans += a + x
        t.append(x)
    
ans -= max(t)
print(ans)

Buggy submission (verdict: Runtime Error):
t = []
ans = 0
for i in range(5):
    a = int(input())
    if a%10 == 0:
        ans += a
    
    else:
         x = 10-a%10
         ans += a + (x)
         t.append(x)
    
ans -= max(t)
print(ans)

Buggy submission (verdict: Runtime Error):
t = []
ans = 0
for i in range(5):
    a = int(input())
    if a%10 == 0:
        ans += a
    
    else:
         x = 10-a%10
         ans += a + (x)
         t.append(x)
    
print(t)
ans -= max(t)
print(ans)
Problem p03455 (python)

Fixed submission:
a,b=map(int,input().split())

if a*b%2 == 0 :
  print("Even")
  
else :
  print("Odd")

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())

if a*b%2 == 0 :
  print(even)
  
else :
  print(odd)
Problem p03477 (python)

Fixed submission:
a,b,c,d = map(int,input().split())
if a+b > c+d:
    print('Left')
elif a+b == c+d:
    print('Balanced')
else:
    print('Right')

Buggy submission (verdict: Runtime Error):
N,A,B=map(int,input().split())

print(sum(i in i range(1,N+1) if A<=sum(map(int,str(i)))<=B))

Buggy submission (verdict: Runtime Error):
N,A,B=map(int,input().split())

print(sum(i in i range(1,N+1)
         if A<=sum(map(int,str(i))<=B))
Problem p03478 (python)

Fixed submission:
N,A,B=map(int,input().split())
print(sum(i for i in range(1,N+1) if A<=sum(map(int,str(i)))<=B))

Buggy submission (verdict: Runtime Error):
N,A,B=map(int,input().split())

print(sum(i in i range(1,N+1) if A<=sum(map(int,str(i)))<=B))

Buggy submission (verdict: Runtime Error):
N,A,B=map(int,input().split())

print(sum(i in i range(1,N+1)
         if A<=sum(map(int,str(i)))<=B))

Buggy submission (verdict: Runtime Error):
N,A,B=map(int,input().split())

print(sum(i in i range(1,N+1)
         if A<=sum(map(int,str(i)<=B)))
Problem p04043 (python)

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

if A.count(5) == 2 and A.count(7) == 1 :
  print("YES")
  
else :
  print("NO")

Buggy submission (verdict: Runtime Error):
input()
A = list(map(int,input().split()))

if A.count(5) == 2 and A.count(7) == 1 :
  print("YES")
  
else :
  print("NO")
Problem p02628 (python)

Fixed submission:
a = input().split(" ")
b = input().split(" ")
c = []
for i in b:
    c.append(int(i))

c.sort()
sum = 0
for i in c[0:int(a[1])]:
    sum += int(i)
print(sum)

Buggy submission (verdict: Runtime Error):
a = input().split(" ")
b = input().split(" ").sort()
sum = 0
for i in a[1]:
    sum += i
print(sum)
Problem p02724 (python)

Fixed submission:
import math
numeric = int(input())
result = math.floor(numeric / 500)*1000
intermediate = numeric - math.floor(numeric / 500)*500
result = result + math.floor(intermediate / 5)*5
print(result)

Buggy submission (verdict: Runtime Error):
import math
test = input()
five_hundred = math.floor(test / 500) * 1000
five_happy = math.floor((test - five_hundred*500)/5) * 5
print(five_hundred + five_happy)

Buggy submission (verdict: Runtime Error):
import math
test = input()
five_hundred = math.floor(test / 500) * 1000
five_happy = math.floor((test - five_hundred*500)/5) * 5
Problem p03147 (python)

Fixed submission:
n = input()
hs = list(map(int,input().split(" ")))

step = 0
while(True):
  
  if(sum(hs) == 0):
    break
  
  start = None
  stop = None
  
  for i,h in enumerate(hs):

    if(h>0 and start is None):
      start = i
    if(h==0 and start is not None and stop is None):
      stop = i
     	
  if(start is not None and stop is None):
    stop = len(hs)
    
  for i in range(start, stop):
    hs[i] -= 1
    
  step += 1
  
print(step)

Buggy submission (verdict: Runtime Error):
n = input()
hs = list(map(int,input().split(" ")))

step = 0
while(True):
  
  start = None
  stop = None
  
  for i,h in enumerate(hs):

    
    if(h>0 and start is None):
      start = i
    if(h==0 and start is not None and stop is None):
      stop = i
     	
  if(stop is None):
    stop =  len(hs)
    
  for i in range(start, stop):
    hs[i] -= 1
    
  step += 1
  
  if(sum(hs) == 0):
    break
    
print(step)
Problem p03435 (python)

Fixed submission:
c1 = list(map(int,input().split()))
c2 = list(map(int,input().split()))
c3 = list(map(int,input().split()))
 
d1 = [c2[i] - c1[i] for i in range(3)]
d2 = [c3[i] - c1[i] for i in range(3)]
 
if(d1[0] == d1[1] and d1[0] == d1[2] and d2[0] ==d2[1] and d2[0] == d2[2]):
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
c1 = map(int,input().split())
c2 = map(int,input().split())
c3 = map(int,input().split())

d1 = [c2[i] - c1[i] for i in range(3)]
d2 = [c3[i] - c1[i] for i in range(3)]

if(d1[0] == d1[1] and d1[0] == d1[2] and d2[0] ==d2[1] and d2[0] == d2[2]):
  print("Yes")
else:
  print("No")
Problem p02700 (python)

Fixed submission:
a, b, c, d = map(int, input().split())

num1 = (a-1)//d
num2 = (c-1)//b

print('Yes' if num1>=num2 else'No')

Buggy submission (verdict: Runtime Error):
a, b, c, d = map(int, input().split())

while (a>0) & (c>0):
  tmp1 = c-b
  tmp2 = a-d
  if temp1<=0: print('Yes')
  elif temp2<=0: print('No')
Problem p02705 (python)

Fixed submission:
import numpy as np

r = int(input())
print(2*r*np.pi)

Buggy submission (verdict: Runtime Error):
r =int(input())
print(r*pi)
Problem p02706 (python)

Fixed submission:
a, _ =map(int,input().split())
li = [int(x) for x in input().split()]
s = sum(li)
print(max(a-s, -1))

Buggy submission (verdict: Runtime Error):
a, _ =map(int,input().split())
li = [x for x in input().split()]
s = sum(li)
print(a-s)
Problem p02717 (python)

Fixed submission:
a, b, c = input().split()
print(c +' '+a+' '+b)

Buggy submission (verdict: Runtime Error):
a, b, c = map(int(), input().split())
print(a +' '+b+' '+c)

Buggy submission (verdict: Runtime Error):
a, b, c = map(int, input().split())
print(a +' '+b+' '+c)
Problem p02718 (python)

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

lim = 1/(4*m)

ans = 0
for a in A:
  a /= sum(A)
  if a>=lim:
    ans += 1
    
if ans >= m:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
n, m = map(int,input().split())
A = list(map(int,input().split()))

lim = 1/(4*m)
A = A/sum(A)
ans = 0
for a in A:
  if a>=lim:
    ans += 1
    
if ans >= m:
  print("Yes")
else:
  print("No")
Problem p02812 (python)

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

n = S.count('ABC')
print(n)

Buggy submission (verdict: Runtime Error):
N = input()
S = input()

n = str.count('ABC')
print(n)
Problem p02830 (python)

Fixed submission:
N = int(input())
s, t = input().split()

new = list()
for i in range(N):
  new.append(s[i])
  new.append(t[i])
  
print(*new, sep='')

Buggy submission (verdict: Runtime Error):
N = int(input())
s, t = input().split()

for i in range(N):
  print(s[i], t[i], seq = '')

Buggy submission (verdict: Runtime Error):
N = int(input())
s, t = map(input().split())

for i in range(N):
  print(s[i], t[i], seq = '')
Problem p02883 (python)

Fixed submission:
import numpy as np

def solve(n, k, aaa, fff):
  aaa = np.sort(aaa)
  fff = np.sort(fff)[::-1]
  
  l = 0
  r = 10**12
  while l<=r:
    m = (l+r)//2
    req = np.clip(aaa - m//fff, 0, None).sum()

    if req <= k:
      r = m-1
    else:
      l = m+1

  return l


N, K = map(int,input().split())
aaa = np.array(list(map(int,input().split())))
fff = np.array(list(map(int,input().split())))

print(solve(N, K, aaa, fff))

Buggy submission (verdict: Runtime Error):
import numpy as np

def solve(n, k, aaa, fff):
  aaa = np.sort(aaa)
  fff = np.sort(fff)[::-1]
  
  l = 0
  r = 10**12
  while l<=r:
    m = (l+r)//2
    req = np.clip(aaa - m//fff, 0, None).sum()

    if req < k:
      r = m-1
    else:
      l = m+1

  return l


N, K = map(int,input().split())
aaa = np.array(list(map(int,input().split())))
fff = np.array(list(map(int,input().split())))

print(solve(N, K, aaa, fff)

Buggy submission (verdict: Runtime Error):
import numpy as np

def solve(n, k, aaa, fff):
  aaa = np.sort(aaa)
  fff = np.sort(fff)[::-1]
  
  l = 0
  r = 10**12
  while l<=r:
    m = (l+r)//2
    req = np.clip(aaa - m//fff, 0, Nonw).sum()

    if req < k:
      r = m-1
    else:
      l = m+1

  return l


N, K = map(int,input().split())
aaa = np.array(list(map(int,input().split())))
fff = np.array(list(map(int,input().split())))

print(solve(N, K, aaa, fff)
Problem p02888 (python)

Fixed submission:
import bisect

N = int(input())
A = list(map(int,input().split()))
A.sort()
ans = 0

for i in range(N-1):
  k = A[i]
  for j in range(i+1, N):
    l = A[j]
    res = bisect.bisect_left(A, k+l)
    ans += res-j-1
    
print(ans)

Buggy submission (verdict: Runtime Error):
import bisect

N = int(input())
li = list(map(int, input().split()))
li.sort()

ans = 0
for i in range(N-1):
  k = li[i]
  for j in range(i+1, N):
    l = li[j]
    tmp = bisect_left(li, k+l)
    ans += tmp - j -1
    
    
print(ans)

Buggy submission (verdict: Runtime Error):
import bisect

N = int(input())
li = list(map(int, input().split()))

ans = 0
for i in range(N-1):
  k = li[i]
  for j in range(i+1, N):
    l = li[j]
    tmp = bisect_left(li, k+l)
    ans += tmp - i -1
    
    
print(ans)
Problem p02923 (python)

Fixed submission:
N = int(input())
li = list(map(int,input().split()))
li.reverse()

dp = [0]*N

for i in range(N-1):
  if li[i+1] >= li[i]:
    dp[i+1] = dp[i]+1
  else:
    dp[i+1] = 0
    
print(max(dp))

Buggy submission (verdict: Runtime Error):
N = int(input())
li = list(map(int,input().split())).reverse()

dp = [0]*N

for i in range(N-1):
  if li[i+1] >= li[i]:
    dp[i+1] = dp[i]+1
  else:
    dp[i+1] = 0
    
print(max(dp))
Problem p02927 (python)

Fixed submission:
M,D = map(int,input().split())
ans = 0

for i in range(1,M+1):
  for j in range(10,D+1):
    a,b = divmod(j,10)
    
    if a>=2 and b>=2:
      if i ==a*b:
        ans += 1
       
      
      
print(ans)

Buggy submission (verdict: Runtime Error):
M,D = map(int,input().split())
ans =0

if D <22:
  print("0")
  sys.exit()

for i in range(1,M+1):
  for r in range(22,D+1):
    d_tens,d_ones = divmod(r,10)
    
    if d_ones == 0 or d_ones == 1:
      continue
    elif i == d_tens*d_ones:
      ans+=1
    else:
      continue
      
print(ans)

Buggy submission (verdict: Runtime Error):
M,D = map(int,input().split())
ans =0

if D <10:
  print("0")
  sys.exit()

for i in range(1,M+1):
  for r in range(10,D+1):
    d_tens,d_ones = divmod(r,10)
    
    if d_ones == 0 or d_ones == 1:
      continue
    elif i == d_tens*d_ones:
      ans+=1
    else:
      continue
      
print(ans)

Buggy submission (verdict: Runtime Error):
M,D = map(int,input().split())
ans =0

if D <10:
  print("0")
  break

for i in range(1,M+1):
  for r in range(10,D+1):
    d_tens,d_ones = divmod(r,10)
    
    if i == d_tens*d_ones:
      ans+=1
    else:
      continue
      
print(ans)
Problem p02946 (python)

Fixed submission:
K , X = map (int , input().split())

min = X - K + 1
max = X + K 

for i in range(min , max ):
    print("{} ". format(i))

Buggy submission (verdict: Runtime Error):
K , X = map (int , input().split())

min = X - K + 1
max = X + K 

for i in range(min , max ):
    print("{} "). format(i)

Buggy submission (verdict: Runtime Error):
K , X = map (int , input().split())

min = X - K + 1
max = X + K - 1

for i in range(min , max + 1):
    print("{} "). format(i)