qyliang/CodeNanoFix huggingface dataset:
Buggy code:
# -*- coding: utf-8 -*-
import sys
import copy
import collections
from bisect import bisect_left
	
def main():
	X = input().split(" ")
	X = [int(s) for s in X]
	
	dx = abs(X[0] - X[2])
	dy = abs(X[1] - X[3])
	
	ans = "{} {} {} {}".format(X[2]-dy, X[3]+dx, X[0]-dy, X[1]+dx)
	print(ans)
	
if __name__ == "__main__":
	main()


Fixed code:
# -*- coding: utf-8 -*-
import sys
import copy
import collections
from bisect import bisect_left
	
def main():
	X = input().split(" ")
	X = [int(s) for s in X]
	
	dx = X[2] - X[0]
	dy = X[3] - X[1]
	
	ans = "{} {} {} {}".format(X[2]-dy, X[3]+dx, X[0]-dy, X[1]+dx)
	print(ans)
	
if __name__ == "__main__":
	main()
Buggy code:
# input
x1, y1, x2, y2 = map(int, input().split())

x3 = y2 - y1 + x2
y3 = x1 - x2 + y2
x4 = y2 - y1 + x1
y4 = x1 - x2 + y1
print(x3, y3, x4, y4)

Fixed code:
# input
x1, y1, x2, y2 = map(int, input().split())

x3 = y1 - y2 + x2
y3 = x2 - x1 + y2
x4 = y1 - y2 + x1
y4 = x2 - x1 + y1
print(x3, y3, x4, y4)
Buggy code:
x1, y1, x2, y2 = map(int, input().split())

x3 = x2 + (y1 - y2)
y3 = y2 - (x1 - x2)
x4 = x3 + (x1 - x2)
y4 = y3 - (y1 - y2)

print(x3, y3, x4, y4)


Fixed code:
x1, y1, x2, y2 = map(int, input().split())
a = y2 - y1
b = x2 - x1
x3 = x2 - a
y3 = y2 + b
x4 = x1 - a
y4 = y1 + b
print(x3, y3, x4, y4)
Buggy code:
x1, y1, x2, y2 = map(int,input().split())

a = x1 - x2
b = y1 - y2
x3 = x2 + b
y3 = y2 - a
x4 = x1 + b
y4 = y1 - a
print('{}, {}, {}, {}'.format(x3,y3,x4,y4))

Fixed code:
x1,y1,x2,y2=map(int,input().split())
x3=x2-(y2-y1)
y3=y2+(x2-x1)
x4=x3-(x2-x1)
y4=y3-(y2-y1)
print("{} {} {} {}".format((x3),(y3),(x4),(y4)))
Buggy code:
x1,y1,x2,y2 = list(map(int,input().split()))
xdis = x2-x1
ydis = y2-y1
print(x2-ydis,y2+xdis,x1-xdis,y1+ydis)

Fixed code:
x1,y1,x2,y2 = list(map(int,input().split()))
xdis = x2-x1
ydis = y2-y1
print(x2-ydis,y2+xdis,x1-ydis,y1+xdis)
Buggy code:
x1,y1,x2,y2=map(int,input().split())

k1=x2-x1
k2=y2-y1

print(x2-k2,y2+k1,x3-k1,y3-k2)

Fixed code:
x1,y1,x2,y2=map(int,input().split())

k1=x2-x1
k2=y2-y1

x3=x2-k2
y3=y2+k1

x4=x3-k1
y4=y3-k2

print(x3,y3,x4,y4)
Buggy code:
x1,y1,x2,y2 = map(int, input().split())
print(x2-y2+y1, y2+x2-x1, x1-y2+y1, y1-x2-x1)

Fixed code:
x1,y1,x2,y2 = map(int,input().split())
print(x2+y1-y2,y2+x2-x1,x1+y1-y2,y1+x2-x1)
Buggy code:
n=list(map(int,input().split()))
ans_l=[n[2]+n[1]-n[3],n[3]-n[0]+n[2],n[0]+n[1]-n[3],n[1]-n[0]+n[2]]
print(ans_l)


Fixed code:
n=list(map(int,input().split()))
print(n[2]+n[1]-n[3],n[3]-n[0]+n[2],n[0]+n[1]-n[3],n[1]-n[0]+n[2])
Buggy code:
val = input().split()
val = [int(i) for i in val]

a, b, c, d = val

x1 = val[2] - val[0]
y1 = val[3] - val[1]

import numpy as np

if x1 * y1 >= 0:
    x2 = -1 * np.sign(x1) * abs(y1)
    y2 = np.sign(y1) * abs(x1)
    x3 = np.sign(x2) * abs(x1)
    y3 = -1 * np.sign(y2) * abs(y1)
else:
    x2 = np.sign(x1) * abs(y1)
    y2 = -1 * np.sign(y1) * abs(x1)
    x3 = -1 * np.sign(x2) * abs(x1)
    y3 = np.sign(y2) * abs(y1)

e = c + x2
f = d + y2
g = e + x3
h = f + y3

print(e, f, g, h)

Fixed code:
val = input().split()
val = [int(i) for i in val]

a, b, c, d = val

x1 = val[2] - val[0]
y1 = val[3] - val[1]

import numpy as np

if x1 * y1 > 0:
    x2 = -1 * np.sign(x1) * abs(y1)
    y2 = np.sign(y1) * abs(x1)
    x3 = np.sign(x2) * abs(x1)
    y3 = -1 * np.sign(y2) * abs(y1)
elif x1 == 0:
    x2 = -1 * y1
    y2 = 0
    x3 = 0
    y3 = x2
elif y1 == 0:
    x2 = 0
    y2 = x1
    x3 = -1 * x1
    y3 = 0
else:
    x2 = np.sign(x1) * abs(y1)
    y2 = -1 * np.sign(y1) * abs(x1)
    x3 = -1 * np.sign(x2) * abs(x1)
    y3 = np.sign(y2) * abs(y1)

e = c + x2
f = d + y2
g = e + x3
h = f + y3

print(e, f, g, h)
Buggy code:
x1, y1, x2, y2 = map( int, input().split() )

x3 = x2 - y2 - y1
y3 = y2 - x2 + x1
x4 = x1 - y2 - y1
y4 = y1 - x2 + x1

print(x3, y3, x4, y4)

Fixed code:
x1, y1, x2, y2 = map(int, input().split())

k = x2-x1
l = y2-y1

x3 = x2 - l
y3 = y2 + k
x4 = x1 - l
y4 = y1 + k

print(x3, y3, x4, y4)
Buggy code:
x1, y1, x2, y2 = map(int, input().split())

#x_diff = 2 3 6 6
#diff = abs(x1-x2) if x1!=x2 else abs(y1-y2)

def up(x_pre, y_pre, x_diff, y_diff):
  return x_pre-x_diff, y_pre+y_diff
def left(x_pre, y_pre, x_diff, y_diff):
  return x_pre-x_diff, y_pre-y_diff
def down(x_pre, y_pre, x_diff, y_diff):
  return x_pre+x_diff, y_pre-y_diff
def right(x_pre, y_pre, x_diff, y_diff):
  return x_pre+x_diff, y_pre+y_diff

x_diff_ = x2 - x1
y_diff_ = y2 - y1
print(x_diff_, y_diff_)
rotate = []
if y_diff_ >= 0:
  if x_diff_ >= 0:
    print(1)
    rotate = [up, left]
  else:
    print(2)
    rotate = [left, down]
else:
  if x_diff_ >= 0:
    print(3)
    rotate = [right, up]
  else:
    print(4)
    rotate = [down, right]
  
x3, y3 = rotate[0](x2, y2, abs(y2-y1), abs(x2-x1))
print(abs(y2-y1), abs(x2-x1))
x4, y4 = rotate[1](x3, y3, abs(y3-y2), abs(x3-x2))
print(abs(y3-y2), abs(x3-x2))
print(x3, y3, x4, y4)
  

Fixed code:
x1, y1, x2, y2 = map(int, input().split())

#x_diff = 2 3 6 6
#diff = abs(x1-x2) if x1!=x2 else abs(y1-y2)

def up(x_pre, y_pre, x_diff, y_diff):
  return x_pre-x_diff, y_pre+y_diff
def left(x_pre, y_pre, x_diff, y_diff):
  return x_pre-x_diff, y_pre-y_diff
def down(x_pre, y_pre, x_diff, y_diff):
  return x_pre+x_diff, y_pre-y_diff
def right(x_pre, y_pre, x_diff, y_diff):
  return x_pre+x_diff, y_pre+y_diff

x_diff_ = x2 - x1
y_diff_ = y2 - y1
#print(x_diff_, y_diff_)
rotate = []
if y_diff_ >= 0:
  if x_diff_ >= 0:
    #print(1)
    rotate = [up, left]
  else:
    #print(2)
    rotate = [left, down]
else:
  if x_diff_ >= 0:
    #print(3)
    rotate = [right, up]
  else:
    #print(4)
    rotate = [down, right]
  
x3, y3 = rotate[0](x2, y2, abs(y2-y1), abs(x2-x1))
#print(abs(y2-y1), abs(x2-x1))
x4, y4 = rotate[1](x3, y3, abs(y3-y2), abs(x3-x2))
#print(abs(y3-y2), abs(x3-x2))
print(x3, y3, x4, y4)
Buggy code:
A = list(map(int, input().split()))
L = len(A)
ans = [0, 0, 0, 0]
dx = A[2] - A[0]
dy = A[3] - A[1]
if(dx>0 and dy>0):
    dx = abs(dx)
    dy = abs(dy)
    x3 = A[2] - dy
    y3 = A[3] + dx
    x4 = x3 - dx
    y4 = y3 - dy
elif(dx>0 and dy<0):
    dx = abs(dx)
    dy = abs(dy)
    x3 = A[2] - dy
    y3 = A[3] - dx
    x4 = x3 - dx
    y4 = y3 + dy
elif(dx<0 and dy>0):
    dx = abs(dx)
    dy = abs(dy)
    x3 = A[2] + dy
    y3 = A[3] + dx
    x4 = x3 + dx
    y4 = y3 - dy
else:
    dx = abs(dx)
    dy = abs(dy)
    x3 = A[2] + dy
    y3 = A[3] - dx
    x4 = x3 + dx
    y4 = y3 + dy

ans[0] = str(x3)
ans[1] = str(y3)
ans[2] = str(x4)
ans[3] = str(y4)
ans = ' '.join(ans)
print(ans)

Fixed code:
A = list(map(int, input().split()))
L = len(A)
ans = [0, 0, 0, 0]
dx = A[2] - A[0]
dy = A[3] - A[1]
if(dx>=0 and dy>=0):
    dx = abs(dx)
    dy = abs(dy)
    x3 = A[2] - dy
    y3 = A[3] + dx
    x4 = x3 - dx
    y4 = y3 - dy
elif(dx>0 and dy<0):
    dx = abs(dx)
    dy = abs(dy)
    x3 = A[2] + dy
    y3 = A[3] + dx
    x4 = x3 - dx
    y4 = y3 + dy
elif(dx<=0 and dy<=0):
    dx = abs(dx)
    dy = abs(dy)
    x3 = A[2] + dy
    y3 = A[3] - dx
    x4 = x3 + dx
    y4 = y3 + dy
elif(dx<0 and dy>0):
    dx = abs(dx)
    dy = abs(dy)
    x3 = A[2] - dy
    y3 = A[3] - dx
    x4 = x3 + dx
    y4 = y3 - dy

ans[0] = str(x3)
ans[1] = str(y3)
ans[2] = str(x4)
ans[3] = str(y4)
ans = ' '.join(ans)
print(ans)
Buggy code:
x1,y1,x2,y2=map(int,input().split())
dx=x2-x1
dy=y2-y1
x3=x2-dy
y3=x2+dx
x4=x3-dx
y4=y3-dy
print(x3,y3,x4,y4)

Fixed code:
x1,y1,x2,y2=map(int, input().split())
x3=x2-y2+y1
y3=y2-x1+x2
x4=x3+x1-x2
y4=y3+y1-y2
print(x3,y3,x4,y4)
Buggy code:
x1, y1, x2, y2 = map(int, input().split())
x = x2 - x1
y = y2 - y1
print(x, y)
z = int((x**2 + y**2) ** (1/2))
x3 = x2 - y
y3 = y2 + x
x4 = x1 - y
y4 = y1 + x
print(x3, y3, x4, y4)


Fixed code:
x1, y1, x2, y2 = map(int, input().split())
x = x2 - x1
y = y2 - y1
z = int((x**2 + y**2) ** (1/2))
x3 = x2 - y
y3 = y2 + x
x4 = x1 - y
y4 = y1 + x
print(x3, y3, x4, y4)
Buggy code:
# ABC107 A - Train 
n,i = map(int,input().split())
print(n-1+1)

Fixed code:
# ABC107 A - Train 
n,i = map(int,input().split())
print(n-i+1)
Buggy code:
vdef main():
    n,i = map(int,input().split())

    print(n+1-i)

if __name__ == '__main__':
    main()


Fixed code:
def main():
    n,i = map(int,input().split())

    print(n+1-i)

if __name__ == '__main__':
    main()
Buggy code:
N, i = map(int.input().split(' '))
print(N-i+1)

Fixed code:
N, i = map(int,input().split(' '))
print(N-i+1)
Buggy code:
N,i=map(int,input().split())
print(N-1+1)

Fixed code:
N, i = map(int,input().split())
print(N - (i - 1))
Buggy code:
a, b = map(int, input().split())
print(a - b - 1)

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

print(a-b+1)
Buggy code:
n, i = map(int,input().split())
print (n+i-1)


Fixed code:
n,i = map(int,input().strip().split())
print(n-i+1)
Buggy code:
n, i = map(int,input().split())
print (N+i-1)

Fixed code:
N, i = map(int, input().split())
print(N+1-i)
Buggy code:
N,I=[int(a) for a in input().split(" ")]
print(N-i+1)

Fixed code:
N,I=[int(a) for a in input().split(" ")]
print(N-I+1)
Buggy code:
inp = input().split(" ")
print(int(inp[1]) - int(inp[0]))

Fixed code:
inp = input().split(" ")
print(int(inp[0]) - int(inp[1]) + 1)
Buggy code:
n,i =map(int,input().split())
ans=0
ans=n-i+1

Fixed code:
n,i =map(int,input().split())
ans=0
ans=n-i+1
print(ans)
Buggy code:
N, i = list(map(int,input().split()))
print(i+1 -N)


Fixed code:
N, i = list(map(int,input().split()))
print(N+1 -i)
Buggy code:
N, i = map(int, input().split())
print(i - N + 1)

Fixed code:
N, i = map(int, input().split(" "))
print(N+1-i)
Buggy code:
a, b=map(int, input().split())
print(a+b-1)

Fixed code:
a,b = map(int, input().split())
print(a-b+1)
Buggy code:
n,i = map(int,input().split())
print(i-n+1)

Fixed code:
n,i  =map(int,input().split())
print(n - i +1)
Buggy code:
N, i = map(int, input().split())
print(N-i+1))

Fixed code:
N, i = map(int, input().split())

print(N + 1 - i)
Buggy code:
line = input().split()
N = int(line[0])
i = int(line[1])

print(n-i+1)


Fixed code:
line = input().split()
N = int(line[0])
i = int(line[1])

print(N-i+1)
Buggy code:
n,i=map(int,input().split())
print(n-p+1)

Fixed code:
n, i = map(int,input().split())

print(n - i + 1)
Buggy code:
"""
author : halo2halo
date : 23, Jan, 2020
"""

import sys

# import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

N, i = map(int, readline())
print(N - i + 1)


Fixed code:
"""
author : halo2halo
date : 23, Jan, 2020
"""

import sys

# import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

N, i = map(int, readline().split())
print(N - i + 1)
Buggy code:
N,i = map(int,input().split())
print(N-2+1)

Fixed code:
N,i = map(int, input().split() )

print( N - i + 1 )
Buggy code:
N,i = map(int,input().split())
ans = N - i + 1-2
print(ans)


Fixed code:
N,i = map(int,input().split())
ans = N - i + 1
print(ans)
Buggy code:
n, i = map(int, input().split())
ans = (n-1) + 1
print(ans)

Fixed code:
n,i=map(int,input().split())

print(n-i+1)
Buggy code:
a, b = map(int, input().split())
print(a + b - 1)

Fixed code:
a,b = map(int, input().split())
c = a-b+1
print(c)
Buggy code:
N, i =int(input().split())
print(N-i+1)

Fixed code:
N,i = map(int,input().split())
print(N-i+1)
Buggy code:
a,b=input().split()
print(a-b+1)

Fixed code:
a, b = input().split()
print(int(a)-int(b)+1)
Buggy code:
a, b = list(map(int, input().strip().split(" ")))
print(b-a+1)

Fixed code:
a, b = list(map(int, input().strip().split(" ")))
print(a-b+1)
Buggy code:
import sys
 
stdin = sys.stdin
inf = 1 << 60
mod = 1000000007
 
ni = lambda: int(ns())
nin = lambda x: [ni() for _ in range(x)]
na = lambda: list(map(int, stdin.readline().split()))
nan = lambda x: [na() for _ in range(x)]
ns = lambda: stdin.readline().rstrip()
nsn = lambda x: [ns() for _ in range(x)]
nas = lambda: stdin.readline().split()

n = ni()
i = ni()

print(n - i + 1)

Fixed code:
import sys
 
stdin = sys.stdin
inf = 1 << 60
mod = 1000000007
 
ni = lambda: int(ns())
nin = lambda x: [ni() for _ in range(x)]
na = lambda: list(map(int, stdin.readline().split()))
nan = lambda x: [na() for _ in range(x)]
ns = lambda: stdin.readline().rstrip()
nsn = lambda x: [ns() for _ in range(x)]
nas = lambda: stdin.readline().split()

n, i = na()

print(n - i + 1)
Buggy code:
a,b = map(int,input().split())
print(a+b-1)

Fixed code:
a,b=map(int,input().split());print(a-b+1);
Buggy code:
n,i = map(int,input().split())

print(n-1+1)


Fixed code:
n, i = list(map(int, input().split()))

print(n-i+1)
Buggy code:
# coding: utf-8
# Your code here!

N,A=map(int,input()split())
print(N-A+1)

Fixed code:
# coding: utf-8
# Your code here!

N,A=map(int,input().split())
print(N-A+1)
Buggy code:
N,i =map(int(),input().split())
print(N-i+1)

Fixed code:
N, i = list(map(int, input().split()))
print(N - i + 1)
Buggy code:
import sys

def main():
  input = sys.stdin.readline
  n, i = map(int, input().split())
  print(N-i+1)


if __name__ == '__main__':
  main()

Fixed code:
import sys

def main():
  input = sys.stdin.readline
  n, i = map(int, input().split())
  print(n-i+1)


if __name__ == '__main__':
  main()
Buggy code:
N, i = int(input().split())
print(N-i+1)

Fixed code:
N, i = map(int, input().split())

print(N+1-i)
Buggy code:
rom sys import stdin

N, i = [int(x) for x in stdin.readline().rstrip().split()]

print(N + 1 - i)


Fixed code:
from sys import stdin
 
N, i = [int(x) for x in stdin.readline().rstrip().split()]
 
print(N + 1 - i)
Buggy code:
i = list(map(int,input(),split()))
print(i[0] - i[1] + 1)

Fixed code:
i = list(map(int,input().split()))
print(i[0] - i[1] + 1)
Buggy code:
n,i = list(map,int(input().split()))
print(n-i+1)

Fixed code:
n,i = map(int,input().split())

print(n+1-i)
Buggy code:
n i = map(int,input().split())
print(n - i + 1)

Fixed code:
n,i = map(int, input().split())
ans = n - i + 1
print(ans)
Buggy code:
N,i = map(int.input().split())

answer = N - i + 1

print(answer)

Fixed code:
N, i = map(int, input().split())

print(N - i + 1)
Buggy code:

n,i = map(int(input().split()))
print((n-i)+1)


Fixed code:
n, i = list(map(int, input().split()))
print(n - i + 1)
Buggy code:
a, b = map(int, input().split())
print(b - a + 1)

Fixed code:
a, b = map(int, input().split(' '))
print(a - b + 1)
Buggy code:
N i = map(int, input().split())
print(N-i+1)

Fixed code:
N, i = map(int, input().split())
print (N-i+1)
Buggy code:
N , i = list(map(int, input().split()))
print(n + 1 -i)

Fixed code:
n, i = list(map(int, input().split()))
print(n - i + 1 )
Buggy code:
n,i=map(int,input().split())
print(n-i-1)

Fixed code:
n, i = map(int, input().split())

print(n - i + 1)
Buggy code:
A = [int(i) for i in input().split(" ")]
ans = A[0] + A[1] -1

print(ans)

Fixed code:
A = [int(i) for i in input().split(" ")]
ans = A[0] - A[1] + 1

print(ans)
Buggy code:
a,b=int(input.split())
print(a-b+1)

Fixed code:
a,b=map(int,input().split())
print((a-b+1))
Buggy code:
N,i = list(map(int,input().split()))
print(N-1+1)

Fixed code:
N , i = map(int , input().split())

print(N-i+1)
Buggy code:
N,i=map(int,input.split())
print((N-i)+1)

Fixed code:

N, i = map(int, input().split(' '))
print(N - i+ 1)
Buggy code:
N, i = map(int, input().split())

print(N-i-1)


Fixed code:
N, i = map( int, input().split())
print(N-i+1)
Buggy code:
n,i=map(int,input(),split())
print(n-i+1)

Fixed code:
n,i = map(int, input().split())

print(n-i + 1)
Buggy code:
l = list(map(int, input().split()))
print((l[0] + l[1]) -1)


Fixed code:
l = list(map(int, input().split()))
print(l[0] + 1 - l[1])
Buggy code:
n,i=map(int,input().split())
print(n-1+1)

Fixed code:
n, i=map(int, input().split())
print(n+1-i)
Buggy code:
n.i=map(int,input().split())
print(n-i+1)

Fixed code:
n,i = map(int,input().split())
print(n-i+1)
Buggy code:
n, i = map(int,input.split())
print(n-i+1)

Fixed code:
n,i = map(int,input().split())
print((n+1) - i)
Buggy code:
N, i = map(int,input().split())

print(N + i - 1)

Fixed code:
N, i = map(int,input().split())

print(N + 1 - i)
Buggy code:
'''A - Train
https://atcoder.jp/contests/abc107/tasks/abc107_a

>>> main(4, 2)
3
>>> main(1, 1)
1
>>> main(15, 11)
5'''


def main(n, i):
    print(n - i + 1)


if __name__ == '__main__':
    main(map(int, input().split(' ')))


Fixed code:
'''A - Train
https://atcoder.jp/contests/abc107/tasks/abc107_a

>>> main(4, 2)
3
>>> main(1, 1)
1
>>> main(15, 11)
5'''


def main(n, i):
    print(n - i + 1)


if __name__ == '__main__':
    n, i = map(int, input().split(' '))
    main(n, i)
Buggy code:
N, i=list(map(int,input().split()))
print(N+1-K)


Fixed code:
N, i=list(map(int,input().split()))
print(N+1-i)
Buggy code:
n,i = map(int(),input().split())
print(n-i+1)

Fixed code:
n, i = map(int, input().split())
print(n + 1 -i)
Buggy code:
a=list(map(int(input().split()))
print(a[0]-a[1]+1)

Fixed code:
a=list(map(int,input().split()))
print(a[0]-a[1]+1)
Buggy code:
info = input()
info = info.split()
print(info)
backward = int(info[0]) - int(info[1]) + 1
print(backward)

Fixed code:
info = input()
info = info.split()
backward = int(info[0]) - int(info[1]) + 1
print(backward)
Buggy code:
N,i=map(int,input().split())
print(N-(i+1))

Fixed code:
N,i=map(int,input().split( ))

print(N+1-i)
Buggy code:
a = list(map(int,input().split()))
print(a - b + 1)

Fixed code:
a,b = map(int,input().split())
print(a- b + 1)
Buggy code:
a = input().split(" ")
print(int(a[1])-int(a[0])+1)

Fixed code:
a = input().split(" ")
print(int(a[0])-int(a[1])+1)
Buggy code:
N, i = map(input().split())
print(N - i + 1)

Fixed code:
N, i  = map(int, input().split())
print(N - i + 1)
Buggy code:
N, i = map(int, input().split())
print(N - i +　1)

Fixed code:
N, i = list(map(int, input().split()))
print(N-i+1)
Buggy code:

def main():
    # parse
    N, i = parse() 
    # compute
    result = compute(N, i)
    # show result
    print(result)

def compute(N, i):
    return N + 1 - i

def parse():
    vars = split_stdin(get_stdin())
    return vars[0], vars[1] 

def get_stdin():
    return input()

def split_stdin(stdin_val, delim = ' '):
    return [x for x in stdin_val.split(delim) if x != '']

if __name__ == "__main__":
    main()

Fixed code:
def main():
    # parse
    N, i = parse()
    # compute
    result = compute(N, i)
    # show result
    print(result)

def compute(N, i):
    return N + 1 - i

def parse():
    vars = split_stdin(get_stdin())
    return int(vars[0]), int(vars[1])

def get_stdin():
    return input()

def split_stdin(stdin_val, delim = ' '):
    return [x for x in stdin_val.split(delim) if x != '']

if __name__ == "__main__":
    main()
Buggy code:
a,b = map(int,input().split())
print(b-a+1)

Fixed code:
a,b=map(int,input().split())
print(a-b+1)
Buggy code:
def train(N: int, i: int)->int:
    return N - i - 1


if __name__ == "__main__":
    N, i = map(int, input().split())
    ans = train(N, i)
    print(ans)


Fixed code:
def train(N: int, i: int)->int:
    return N - i + 1


if __name__ == "__main__":
    N, i = map(int, input().split())
    ans = train(N, i)
    print(ans)
Buggy code:
    n, i = map(int, input().split())
    print(n - i + 1)

Fixed code:
n, i = map(int, input().split())

a = n - i + 1
print(a)
Buggy code:
na = lambda: list(map(int, stdin.readline().split()))
n, i = na()

print(n - i + 1)

Fixed code:
import sys
stdin = sys.stdin

na = lambda: list(map(int, stdin.readline().split()))
n, i = na()

print(n - i + 1)
Buggy code:
N, i = map(int, input().split())
if N == 1:
 	print(1)
else:
	print(N - (N - i) + 1)

Fixed code:
N, i = map(int, input().split())

if i == N:
  print("1")
else:
  print((N - i) + 1)
Buggy code:
N, i = map(int, input().split())
print(N - (N - i) + 1)

Fixed code:
N, i = map(int, input().split())
out = N-i+1
print(out)
Buggy code:
N, I=map(int, input(). split())
print(N-i+1)


Fixed code:
N, i=map(int, input(). split())
print(N-i+1)
Buggy code:
print(1 - eval(input().replace(" ", "-")))

Fixed code:
print(1 + eval(input().replace(" ", "-")))
Buggy code:
N.i=map(int,input().split())
print(N-i+1)

Fixed code:
N,i = map(int, input().split())

print(N - i + 1)
Buggy code:
n ,k = map(int(input().split()))

print(n-k+1)

Fixed code:
n ,k = map(int,input().split())

print(n-k+1)
Buggy code:
n,i=map(int,input.split())
print(n-i+1)

Fixed code:
n,i=map(int, input().split())

print(n+1-i)
Buggy code:
N, i = [int(x) for x in input().split()]
print(N+i-i)

Fixed code:
N, i = [int(x) for x in input().split()]
print(N+1-i)
Buggy code:
N,i = int(input().split())
print(N-i+1)


Fixed code:
N,i=map(int,input().split())

print(N-i+1)
Buggy code:
import sys

def ans(index, array, k):
    r = right(index, array, k)
    l =  left(index, array, k)
    return min(r, l)


def right(index, array, k):
    start = max(0, k-(index-1)) + index
    count = sys.maxsize
    for i in range(start, min(len(array), k+index)):
        tmp = array[i]
        tmp += array[i] - array[k -(i - index + 1)]
        count = count if count < tmp else tmp

    if len(array) > (index + k - 1):
        count = count if count < array[index + k - 1] else array[index + k - 1]
    
    return count

def left(index, array, k):
    n = len(array)
    start = min(0, n-index-k) + index-1
    count = sys.maxsize
    
    for i in range(max(0, start - k), start):
        tmp = -array[i]
        tmp += -array[i] + array[k + i - 1]
        count = count if count < tmp else tmp

    if index >= k:
        count = count if count < -array[index-k] else -array[index-k]
    
    return count

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

x = [int(i) for i in input().split()] 

index = n
for i in range(n):
    if x[i] >= 0:
        index = i
        break

print(ans(index, x, k))

Fixed code:
import sys

def ans(index, array, k):
    r = right(index, array, k)
    l =  left(index, array, k)
    return min(r, l)


def right(index, array, k):
    start = max(index, k-1)
    count = sys.maxsize
    for i in range(start, min(len(array), k+index)):
        tmp = array[i]
        j = index - (k - (i - index + 1))
        tmp += array[i] - array[j]
        count = count if count < tmp else tmp

    if len(array) > (index + k - 1):
        count = count if count < array[index + k - 1] else array[index + k - 1]
    
    return count

def left(index, array, k):
    n = len(array)
    start = min(index, n - k + 1)
    count = sys.maxsize
    
    for i in range(max(0, start - k), start):
        tmp = -array[i]
        j = k + i - 1
        tmp += -array[i] + array[j]
        count = count if count < tmp else tmp

    if index >= k:
        count = count if count < -array[index-k] else -array[index-k]
    
    return count

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

x = [int(i) for i in input().split()] 

index = n
for i in range(n):
    if x[i] >= 0:
        index = i
        break

print(ans(index, x, k))
Buggy code:
N, K = map(int, input().split())
a = list(map(int, input().split()))

min_time = 2 * 10 ** 8
for i in range(N):
    print(i)
    if i + K > N:
        break
    if a[i] > 0:
        min_time = min(min_time, abs(a[i + K - 1]))
        break
    
    if a[i + K - 1] < 0:
        if i + K <= N and a[i + K] > 0:
            min_time = min(min_time, abs(a[i]))
        continue
        
    min_time = min(min_time, 2 * abs(a[i]) + abs(a[i + K - 1]), abs(a[i]) + 2 * abs(a[i + K - 1]))

print(min_time)

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

min_time = 10 ** 12
for i in range(N):
    if i + K > N:
        break
    if a[i] > 0:
        min_time = min(min_time, abs(a[i + K - 1]))
        break
    
    if a[i + K - 1] < 0:
        if (i + K < N and a[i + K] > 0) or i + K == N:
            min_time = min(min_time, abs(a[i]))
        continue
        
    min_time = min(min_time, 2 * abs(a[i]) + abs(a[i + K - 1]), abs(a[i]) + 2 * abs(a[i + K - 1]))

print(min_time)