qyliang/CodeNanoFix huggingface dataset:
Buggy code:
inpl = lambda: list(map(int,input().split()))
def bisect_left_withkey(a, x, lo=0, hi=None, key=lambda x: x, keyvalue_x=False):
    left = lo
    right = len(a) if hi is None else hi
    kx = key(x) if keyvalue_x else x
    while left + 1 < right:
        new = (left + right)//2
        kn = key(a[new])
        if kx <= kn:
            right = new
        else:
            left = new
    return right

N, K = inpl()
A = inpl()
F = inpl()
A.sort()
F.sort(reverse=True)
score = [A[i]*F[i] for i in range(N)]

def achievable(m):
    k = 0
    for i in range(N):
        k += max(0, (score[i]-m-1)//F[i] + 1)
        if k > K:
            return False
    return True

M = max(score)
print(bisect_left_withkey(range(M+1), True, key=achievable))

Fixed code:
inpl = lambda: list(map(int,input().split()))
def bisect_left_withkey(a, x, lo=0, hi=None, key=lambda x: x, keyvalue_x=False):
    left = lo
    right = len(a) if hi is None else hi
    kx = key(x) if keyvalue_x else x
    while left + 1 < right:
        new = (left + right)//2
        kn = key(a[new])
        if kx <= kn:
            right = new
        else:
            left = new
    if key(a[left]) == kx:
        return left
    else:
        return right

N, K = inpl()
A = inpl()
F = inpl()
A.sort()
F.sort(reverse=True)
score = [A[i]*F[i] for i in range(N)]

def achievable(m):
    k = 0
    for i in range(N):
        k += max(0, (score[i]-m-1)//F[i] + 1)
        if k > K:
            return False
    return True

M = max(score)
print(bisect_left_withkey(range(M+1), True, key=achievable))
Buggy code:
import sys


def solve():
    input = sys.stdin.readline
    mod = 10 ** 9 + 7
    n, k = list(map(int, input().rstrip('\n').split()))
    a = list(map(int, input().rstrip('\n').split()))
    f = list(map(int, input().rstrip('\n').split()))
    a.sort()
    f.sort(reverse=True)
    left = a[0] * f[-1] - 1
    right = a[-1] * f[0] + 1
    print(a)
    print(f)
    while right - left > 1:
        mid = (left + right) // 2
        count = 0
        for av, fv in zip(a, f):
            count += max(0, av - (mid // fv))
        if count <= k:
            right = mid
        else:
            left = mid
    print(right)


if __name__ == '__main__':
    solve()


Fixed code:
import sys


def solve():
    input = sys.stdin.readline
    mod = 10 ** 9 + 7
    n, k = list(map(int, input().rstrip('\n').split()))
    a = list(map(int, input().rstrip('\n').split()))
    f = list(map(int, input().rstrip('\n').split()))
    a.sort()
    f.sort(reverse=True)
    left = -1
    right = 10 ** 13
    while right - left > 1:
        mid = (left + right) // 2
        count = 0
        for av, fv in zip(a, f):
            count += max(0, av - (mid // fv))
        if count <= k:
            right = mid
        else:
            left = mid
    print(right)


if __name__ == '__main__':
    solve()
Buggy code:
N, K = map(int, input().split())
A = sorted(list(map(int, input().split())))
F = sorted(list(map(int, input().split())), reverse=True)
 
def isEaten(x):
    temp = 0
    for i in range(N):
        t = x // F[i]
        if t < A[i]:
            temp += (A[i] - t)
    return temp <= K:
 
 
def bitSearch(r, l):
    m = (r+l) // 2
    if m == l:
        if isEaten(l):
            print(l)
        else:
            print(r)
        exit()
    elif isEaten(m):
        bitSearch(m, l)
    else:
        bitSearch(r, m)
 
 
target = max([A[i]*F[i] for i in range(N)])
bitSearch(target, 0)

Fixed code:
N, K = map(int, input().split())
A = sorted(list(map(int, input().split())))
F = sorted(list(map(int, input().split())), reverse=True)
 
def isEaten(x):
    temp = 0
    for i in range(N):
        t = x // F[i]
        if t < A[i]:
            temp += (A[i] - t)
    return temp <= K
 
 
def bitSearch(r, l):
    m = (r+l) // 2
    if m == l:
        if isEaten(l):
            print(l)
        else:
            print(r)
        exit()
    elif isEaten(m):
        bitSearch(m, l)
    else:
        bitSearch(r, m)
 
 
target = max([A[i]*F[i] for i in range(N)])
bitSearch(target, 0)
Buggy code:
#!/usr/bin/env python3
import sys
input = lambda: sys.stdin.readline()[:-1]
sys.setrecursionlimit(10**8)
inf = float('inf')
mod = 10**9+7

n,k=map(int,input().split())
A=list(map(int,input().split()))
F=list(map(int,input().split()))
A.sort()
F.sort(reverse=True)
left=1
right=10**12+1
while left<right:
    mid=(left+right)//2
    # print(mid)
    tmp=0
    for i in range(n):
        tmp+=max(0,A[i]-mid//F[i])
    if tmp>k:
        left=mid+1
    else:
        right=mid
print(mid)


Fixed code:
#!/usr/bin/env python3
import sys
input = lambda: sys.stdin.readline()[:-1]
sys.setrecursionlimit(10**8)
inf = float('inf')
mod = 10**9+7

n,k=map(int,input().split())
A=list(map(int,input().split()))
F=list(map(int,input().split()))
A.sort()
F.sort(reverse=True)
left=0
right=10**12+1
ok=inf
while left<right:
    mid=(left+right)//2
    # print(mid)
    tmp=0
    for i in range(n):
        tmp+=max(0,A[i]-mid//F[i])
    if tmp>k:
        left=mid+1
    else:
        right=mid
        ok=min(ok,mid)
print(ok)
Buggy code:
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)
import heapq

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

A = sorted(A)
F = sorted(F, reverse= True)
S = [(-A[i]*F[i], i) for i in range(N)]


def judge(s):
    global N, K
    ksum = 0
    for i in range(N):
        ksum += -(-(A[i] * F[i] - s) // F[i])
    if ksum <= K:
        return True
    else:
        return False

lb = 0
ub = 10**18
for i in range(100):
    mid = (lb + ub) // 2 + 1
    if judge(mid):
        ub = mid
    else:
        lb = mid

print(mid)


Fixed code:
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)
import heapq

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

A = sorted(A)
F = sorted(F, reverse= True)
S = [(-A[i]*F[i], i) for i in range(N)]


def judge(s):
    global N, K
    ksum = 0
    for i in range(N):
        ksum += max(0, -(-(A[i] * F[i] - s) // F[i]))
    if ksum <= K:
        return True
    else:
        return False

lb = -1
ub = 10**13
while lb + 1 < ub:
    mid = (lb + ub) // 2
    if judge(mid):
        ub = mid
    else:
        lb = mid

print(ub)
Buggy code:
from heapq import heappop, heappush
N, K = map(int, input().split())
A = list(map(int, input().split()))
F = list(map(int, input().split()))

def ok(x):
    cnt = 0
    for i in range(N):
        current = A[i] * F[i]
        if current > x:
            cnt += -(-(current - x) // F[i])
            
    return cnt <= K

A.sort()
F.sort(reverse=True)
lb = 0
ub = 10 ** 12 + 1

while ub - lb > 1:
    mid = (lb + ub) // 2
    
    if ok(mid):
        ub = mid
    else:
        lb = mid
        
print(ub)




Fixed code:
from heapq import heappop, heappush
N, K = map(int, input().split())
A = list(map(int, input().split()))
F = list(map(int, input().split()))

def ok(x):
    cnt = 0
    for i in range(N):
        current = A[i] * F[i]
        if current > x:
            cnt += -(-(current - x) // F[i])
            
    return cnt <= K

A.sort()
F.sort(reverse=True)
lb = 0
ub = 10 ** 12 + 1

while ub - lb > 1:
    mid = (lb + ub) // 2
    
    if ok(mid):
        ub = mid
    else:
        lb = mid
        
if sum(A) <= K:
    print(0)
else:
    print(ub)
Buggy code:
n,k = map(int,input().split())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
a.sort()
b.sort(reverse=True)
#print(a)
#print(b)
big = 42
stand = 2 ** big - 1
width = 2 ** (big-1)
while True:
  tmp = []
  for i in range(n):
    tmp.append(max(0,a[i]-stand//b[i]))
  if sum(tmp) <= k:
    stand -= width
    width //= 2
  else:
    stand += width
    width //= 2
  #print(stand,tmp)
  if width == 0:
    if sum(tmp) <= k:
      print(stand)
    else:
      print(stand+1)
    break

Fixed code:
n,k = map(int,input().split())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
a.sort()
b.sort(reverse=True)
#print(a)
#print(b)
big = 44
stand = 2 ** big
width = 2 ** (big-1)
if sum(a) <= k:
  print(0)
else:
  while True:
    tmp = []
    for i in range(n):
       tmp.append(max(0,a[i]-stand//b[i]))
    if width == 0:
      if sum(tmp) <= k:
        print(stand)
      else:
        print(stand+1)
      break
    if sum(tmp) <= k:
      stand -= width
      width //= 2
    else:
      stand += width
      width //= 2
    #print(stand,tmp)
Buggy code:

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

import copy
A.sort(reverse = True)
DA = copy.copy(A)
F.sort()

import sys
if (sum(A) <= K):
    print(0)
    sys.exit()

values = [0]*N
for i in range(N):
    values[i] = A[i]*F[i]

def judge(val):
    cnt = 0
    for i in range(N):
        if (values[i] > val):
            cnt += A[i]-val//F[i]
    
    return cnt<=K

s = 0
e = max(A)*max(F)
while (s<e):
    c = (s+e)//2
    if judge(c):
        e = c-1
        
    else:
        s = c+1

while(judge(c)):
    c-=1
print(c+1)
    

Fixed code:

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

import copy
A.sort(reverse = True)
DA = copy.copy(A)
F.sort()

import sys
if (sum(A) <= K):
    print(0)
    sys.exit()

values = [0]*N
for i in range(N):
    values[i] = A[i]*F[i]

def judge(val):
    cnt = 0
    for i in range(N):
        if (values[i] > val):
            cnt += A[i]-val//F[i]
    
    return cnt<=K

s = 0
e = max(A)*max(F)
while (s<e):
    c = (s+e)//2
    if judge(c):
        e = c-1
        
    else:
        s = c+1

while(judge(c)):
    c-=1
while (not(judge(c))):
    c+=1
print(c)
Buggy code:
        n,k=map(int,input().split())
        a=list(map(int,input().split()))
        f=list(map(int,input().split()))
        a.sort()
        f.sort(reverse=1)
        su=ok=ng=0
        for i in range(n):
          ok=max(ok,a[i]*f[i])
          su+=a[i]
        if su<=k:print(0);exit()
        while ng+1<ok:
          mid=(ok+ng)//2
          h=0
          for i in range(n):
            h+=a[i]-(f[i]/mid)
          if h<=k:ok=mid
          else:ng=mid
        print(ok)

Fixed code:
n,k=map(int,input().split())
a=list(map(int,input().split()))
f=list(map(int,input().split()))
a.sort()
f.sort(reverse=1)
su=ok=ng=0
for i in range(n):
  ok=max(ok,a[i]*f[i])
  su+=a[i]
if su<=k:print(0);exit()
while ng+1!=ok:
  mid=(ok+ng)//2
  b=[mid//i for i in f]
  b.sort()
  h=0
  for i in range(n):h+=max(0,a[i]-b[i])
  if h<=k:ok=mid
  else:ng=mid
print(ok)
Buggy code:
N, K = map(int, input().split())                                                As = list(map(int, input().split()))
Fs = list(map(int, input().split()))                                                                                                                            As.sort()
As.reverse()                                                                    Fs.sort()
arr = []                                                                        M = 0
for a, f in zip(As, Fs):
    af = a*f                                                                        arr.append((af, a, f))                                                          M = af if af > M else M                                                     
f = -1                                                                          t = M                                                                           while f + 1 < t:
    m = f + (t-f) // 2
    k = K
    for AF, A, F in arr:                                                                d = A - m // F                                                                  if d > k:
            f = m
            break
        k -= d
    else:
        t = m

print(t)

Fixed code:
import math
N, K = map(int, input().split())
As = list(map(int, input().split()))
Fs = list(map(int, input().split()))

As.sort()
As.reverse()
Fs.sort()
arr = []
M = 0
for a, f in zip(As, Fs):
    af = a*f
    arr.append((af, a, f))
    M = af if af > M else M

f = -1
t = M
while f + 1 < t:
    m = f + math.ceil((t-f) / 2)
    k = K
    for AF, A, F in arr:
        d = A - m // F
        d = d if d >= 0 else 0
        if d > k:
            f = m
            break
        k -= d
    else:
        t = m

print(t)
Buggy code:
import sys
import math

input = sys.stdin.readline

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

A.sort()
F.sort(reverse=True)

cost = []
for ai, fi in zip(A,F):
	cost.append([ai*fi,fi])
cost.sort(reverse=True)

thmin = -1
thmax = cost[0][0]+1

while thmax-thmin!=1:
	print(thmin,thmax)
	th = (thmin+thmax)//2
	ktmp = 0
	ind = 0
	judge = True
	while True:
		ci, fi = cost[ind]
		if ci<=th: break
		ktmp += math.ceil((ci-th)/fi)
		if ktmp>K:
			judge = False
			break
		ind += 1
		if ind==N: break
	if judge:
		thmax = th
	else:
		thmin = th

print(thmax)

Fixed code:
import sys
import math

input = sys.stdin.readline

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

A.sort()
F.sort(reverse=True)

cost = []
for ai, fi in zip(A,F):
	cost.append([ai*fi,fi])
cost.sort(reverse=True)

thmin = -1
thmax = cost[0][0]+1

while thmax-thmin!=1:
	# print(thmin,thmax)
	th = (thmin+thmax)//2
	ktmp = 0
	ind = 0
	judge = True
	while True:
		ci, fi = cost[ind]
		if ci<=th: break
		ktmp += math.ceil((ci-th)/fi)
		if ktmp>K:
			judge = False
			break
		ind += 1
		if ind==N: break
	if judge:
		thmax = th
	else:
		thmin = th

print(thmax)
Buggy code:
N, K = list(map(int, input().split()))
A = list(map(int, input().split()))
F = list(map(int, input().split()))

A.sort()
F.sort(reverse = True)

M = 0
for i in range(N):
  M += A[i] * F[i]

def nasu(n):
  ans = 0
  for i in range(N):
    ans += max(0, A[i] - (n // F[i]))
  if ans <= K:
    return True
  else:
    return False

def hersCode():
  ok = M
  ng = -1
  while abs(ok - ng) > 1:
    mid = abs(ok + ng) // 2
    if nasu(mid):
      ok = mid
    else:
      ng = mid
  return ok
print(A)
print(F)
print(hersCode())




Fixed code:
N, K = list(map(int, input().split()))
A = list(map(int, input().split()))
F = list(map(int, input().split()))

A.sort()
F.sort(reverse = True)

M = 0
for i in range(N):
  M += A[i] * F[i]

def nasu(n):
  ans = 0
  for i in range(N):
    ans += max(0, A[i] - (n // F[i]))
  if ans <= K:
    return True
  else:
    return False

def hersCode():
  ok = M
  ng = -1
  while abs(ok - ng) > 1:
    mid = abs(ok + ng) // 2
    if nasu(mid):
      ok = mid
    else:
      ng = mid
  return ok

print(hersCode())
Buggy code:
import numpy as np


def solve(n, k, aaa, fff):
    aaa = np.sort(aaa)
    fff = np.sort(fff)[::-1]

    l = 0
    r = 10 ** 12 + 1
    while l < r - 1:
        m = (l + r) // 2
        req = np.clip(aaa - m // fff, 0, None).sum()
        # print(aaa, m // fff, m, req)
        if req > k:
            l = m + 1
        else:
            r = m + 1
    return l


n, k = list(map(int, input().split()))
aaa = np.array(list(map(int, input().split())), dtype=np.int64)
fff = np.array(list(map(int, input().split())), dtype=np.int64)

print(solve(n, k, aaa, fff))


Fixed code:
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()
        # print(aaa, m // fff, m, req)
        if req > k:
            l = m + 1
        else:
            r = m - 1
    return l


n, k = list(map(int, input().split()))
aaa = np.array(list(map(int, input().split())), dtype=np.int64)
fff = np.array(list(map(int, input().split())), dtype=np.int64)

print(solve(n, k, aaa, fff))
Buggy code:
N,K = map(int,input().split())
A = list(map(int,input().split()))
F = list(map(int,input().split()))

A.sort()
F.sort(reverse=True)

sumA = sum(A)
if  K >= sumA:
    print(0)
    exit()

def isok(x):
    k = 0
    for a, f in zip(A, F):
        if a > x//f:
            k += a - (x//f)
            if k > K:
                return False
    return True

ng = -1
ok = 10**12+1

while ok - ng > 1:
    mid = (ok - ng)//2
    if isok(mid):
        ok = mid
    else:
        ng = mid
print(ok)

Fixed code:
N,K = map(int,input().split())
A = list(map(int,input().split()))
A.sort()
F = list(map(int,input().split()))
F.sort(reverse=True)

sa = sum(A)
if K >= sa:
    print(0)
    exit()

def isok(b):
    k = 0
    for a,f in zip(A,F):
        if a > b//f:
            k += a-(b//f)
            if k > K:
                return False
    return True

ok = 10**12+1
ng = 0

while ok-ng > 1:
    m = (ok+ng)//2
    if isok(m):
        ok = m
    else:
        ng = m
print(ok)
Buggy code:
A,B = map(int, input().sprit())
C = A - B * 2
if C<0:
  print(0)  
else:
  print(C)

Fixed code:
A,B = map(int, input().split())
C = A - B * 2
if C<0:
  print(0)  
else:
  print(C)
Buggy code:
a, b = map(int, input().split())
if a * 2 >= b:
  print(0)
else:
  print(b-a*2)

Fixed code:
a,b = map(int, input().split())
if(a - b * 2 > 0):
  print(a - b * 2)
else:
  print(0)
Buggy code:

def main():
    a, b = map(int, input().split())
    if a < b * 2:
        print(a - b * 2)
    else:
        print(0)


if __name__ == "__main__":
    main()


Fixed code:
def answer():    
    a, b = map(int,input().split())

    if a < (b * 2):
        print(0)
    else:
        print(a - (b * 2))
        
if __name__ == '__main__':
    answer()
Buggy code:
A, B = int(input().split())
if 2*B >= A:
  print(0)
else:
  print(A-(2*B))

Fixed code:
A, B = list(map(int, input().split())) 
if 2*B >= A:
  print(0)
else:
  print(A-(2*B))
Buggy code:
a,b=map(int,input().split())
if(a<=b):
  print(0)
else:
  print(a-(b*2))

Fixed code:
a,b=map(int, input().split())
if a-2*b>0:
  print(a-2*b)
else: 
  print(0)
Buggy code:
A, B=map(int, input().split())
ans=a-2*b if a-2*b>0 else 0
print(ans)

Fixed code:
a, b=map(int, input().split())
ans=a-2*b if a-2*b>0 else 0
print(ans)
Buggy code:
a,b = map(int,input().split())
if (a/2 - b) <= 0:
    print(0)
else:
    print(a - b*b)

Fixed code:
a,b = map(int,input().split())
if (a/2 - b) <= 0:
    print(0)
else:
    print(a - b*2)
Buggy code:
A. B = map(int,input().split())
if A <= B*2:
    print(0)
else:
    print(A-2*B)

Fixed code:
A, B = map(int, input().split())
if A-2*B < 0:
    print(0)
else:
    print(A-2*B )
Buggy code:
def LI():
  return [int(s) for s in input().split()]

A,B = LI()

print(A-2*B) if A > 2*B else 0 



Fixed code:
def LI():
  return [int(s) for s in input().split()]
 
A,B = LI()
 
print(int(A-2*B)) if A > 2*B else print(0)
Buggy code:
A,B=map(int,input().split())
if A>(2*B):
    print(A-(2*B)
else:
    print(0)

Fixed code:
A,B=map(int,input().split())
print(A-2*B) if A>2*B else print(0)
Buggy code:
a, b=map(int, input().split())
if a-2*b>=0:
    print(a-2b)
else:
  print(0)

Fixed code:
a, b = map(int, input().split())
if (a > b * 2):
    print(a-b*2)
else:
    print("0")
Buggy code:
a,b = map(int,input().split())
if b*2 - a <= 0:
  print(0)
else:
  print(b*2-a)

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

if a-b*2<0:
	print(0)
else:
	print(a-b*2)
Buggy code:
a,b = map(int,input().split())
print(max(0,(a-2)))

Fixed code:
a,b = map(int,input().split())
print(max(0,(a-2*b)))
Buggy code:
#coding:utf-8
a, b = map(int, input().split)
print(max(0, a - 2*b))

Fixed code:
#coding:utf-8
a, b = map(int, input().split())
print(max(0, a - 2*b))
Buggy code:
A, B=[int(i) for i in input().split()]

ans=2*B-A
if ans<0:
    print(0)
else:
    print(ans)

Fixed code:
A, B=[int(i) for i in input().split()]

ans=A-2*B
if ans<0:
    print(0)
else:
    print(ans)
Buggy code:
a, b = map(int, input().split(","))
if a > 2*b :
    print(a-2*b)
print(0)

Fixed code:
a, b = map(int, input().split(" "))
if a > 2*b :
    print(a-2*b)
else:
    print(0)
Buggy code:
a,b=map(int,input().split())

if 2*b-a<0:
  print(0)
else:
  print(2*b-a)

Fixed code:
a, b = list(map(int, input().split()))
if (a <= 2 * b):
  print(0)
else:
  print(a - 2 * b)
Buggy code:
a,b = map(int,input().split())
num = (b*2)-a
if num < 0:
  num = 0
print(num)

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

res = a - b*2
if res < 0:
  res = 0
print(res)
Buggy code:
A, B = map(int, input().split())
if A > 2 * B:
    print(A - 2 * B)
else:
    pritn(0)

Fixed code:
A,B = map(int,input().split())
if A>=2*B:
    print(A-2*B)
else:
    print(0)
Buggy code:
a, b = map(int, input().split())

print(max[a - 2 * b, 0])

Fixed code:
a, b = map(int, input().split())
n = max([a - 2 * b, 0])
print(n)
Buggy code:
tmp = input().split(" ")
A = int(tmp[0])
B = int(tmp[1])

import math
print(math.max(A - 2 * B, 0))

Fixed code:
tmp = input().split(" ")
A = int(tmp[0])
B = int(tmp[1])

print(max([A - 2 * B, 0]))
Buggy code:
a,b=int(input().split())
if a-2*b>0:
  print(a-2*b)
else:
  print(0)


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

if a > 2 * b:
  print(a - 2 * b)
else:
  print(0)
Buggy code:
A, B = [int(x) for x in innput().split()]
print(max(0, A - B*2))

Fixed code:
A, B = [int(x) for x in input().split()]
print(max(0, A - B*2))
Buggy code:
a,b = map(int,input().split())
if a <= b*2:
    print(0)
else:
    print(b*2 - a)

Fixed code:
a,b=map(int,input().split())
s = a - b * 2
if s < 0:
  print(0)
else:
  print(s)
Buggy code:
a, b = map(int, input().split)

cover_b = b * 2
if cover_b > a:
  print(0)

else:
  print(a - cover_b)


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

cover_b = b * 2
if cover_b > a:
  print(0)

else:
  print(a - cover_b)
Buggy code:
a, b = map(int, input().split())
curtain = b * 2
if a <= b:
    print(0)
else:
    print(a-curtain)

Fixed code:
a, b = map(int, input().split())
curtain = b * 2
if a <= curtain:
    print(0)
else:
    print(a-curtain)
Buggy code:
A,B=map(int,input().split())
if A>2B:
  print(A-2*B)
else:
  print(0)

Fixed code:
A, B = map(int, input().split())
ans = A-B*2
if ans > 0:
    print(ans)
else:
    print(0)
Buggy code:
base = input().split()
a = int(base[0])
b = int(base[1])
if a>b*2:
    print(a-b*2)
else:
    print(a)

Fixed code:
base = input().split()
a = int(base[0])
b = int(base[1])
if a>b*2:
    print(a-b*2)
else:
    print(0)
Buggy code:
a,b= map(int, input().split())

if(c=a-b*2 >=0):
    print(c)
else:
    print(0)


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

c = a - 2*b
ans = c if c>0 else 0

print(ans)
Buggy code:
a,b=map(lambda x:int(x),input().split())
x=max(a*2-b,0)
print(x)

Fixed code:
a,b=map(lambda x:int(x),input().split())
x=max(a-b*2,0)
print(x)
Buggy code:
A,B =map(int.input().split())

if(A>B*2):
  aaa=A*B
  print(aaa)
else:
  print(0)
  

Fixed code:
A,B =map(int,input().split())

if(A>B*2):
  aaa=A-B*2
  print(aaa)
else:
  print(0)
Buggy code:
a,b = map(int,input().split())
if a-2*b>0:
    print(a-2*b>0)
else:
    print(0)


Fixed code:
a,b = map(int,input().split())
diff = a - b*2
print(diff if diff > 0 else 0)
Buggy code:
import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
def IS(): return sys.stdin.readline()[:-1]
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LI1(): return list(map(int1, sys.stdin.readline().split()))
def LII(rows_number): return [II() for _ in range(rows_number)]
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def LLI1(rows_number): return [LI1() for _ in range(rows_number)]

def main():
	A,B = MI()
	if(A <= B*2):
		print(0):
	else:
		print(A-2*B)

main()

Fixed code:
import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
def IS(): return sys.stdin.readline()[:-1]
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LI1(): return list(map(int1, sys.stdin.readline().split()))
def LII(rows_number): return [II() for _ in range(rows_number)]
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def LLI1(rows_number): return [LI1() for _ in range(rows_number)]

def main():
	A,B = MI()
	if(A <= B*2):
		print(0)
	else:
		print(A-2*B)

main()
Buggy code:
N = input()
a,b = [int(x) for x in N.split()]
c = a-2*b
d = c if c > 0 else 0
print d

Fixed code:
N = input()
a,b = [int(x) for x in N.split()]
c = a-2*b
d = c if c > 0 else 0
print(d)