qyliang/CodeNanoFix huggingface dataset:
Buggy code:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
from collections import deque

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

DR = [1, -1, 0, 0]
DC = [0, 0, 1, -1]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
     
def main():
    x1, y1, x2, y2 = LI()
    d = max(abs(x1-x2), abs(y1-y2))
    if y1 == y2 and x1 < x2:
        x3 = x2
        x4 = x1
        y3 = y1+d
        y4 = y1+d
    elif x1 == x2 and y1 < y2:
        x3 = x1 -d
        x4 = x3
        y3 = y2
        y4 = y1
    elif y1 == y2 and x1 > x2:
        x3 = x2
        x4 = x1
        y3 = y1-d
        y4 = y1-d
    else:
        x3 = x1 + d
        x4 = x3
        y3 = y2
        y4 = y1
    print(x3, y3, x4, y4)



main()



Fixed code:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
from collections import deque

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

DR = [1, -1, 0, 0]
DC = [0, 0, 1, -1]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
     
def main():
    x1, y1, x2, y2 = LI()
    d = max(abs(x1-x2), abs(y1-y2))
    dx = abs(x1-x2)
    dy = abs(y1-y2)
    if x1 < x2 and y1 <= y2:
        x3 = x2 - dy
        x4 = x1 - dy
        y3 = y2 + dx
        y4 = y1 + dx
    elif x1 < x2 and y1 > y2:
        x3 = x2 + dy
        x4 = x1 + dy
        y3 = y2 + dx
        y4 = y1 + dx
    elif x1 >= x2 and y1 < y2:
        x3 = x2 - dy
        x4 = x1 - dy
        y3 = y2 - dx
        y4 = y1 - dx
    else:
        x3 = x2 + dy
        x4 = x1 + dy
        y3 = y2 - dx
        y4 = y1 - dx
    print(x3, y3, x4, y4)



main()
Buggy code:
# coding: utf-8
# Your code here!
x1,y1,x2,y2 = map(int,input().split())

print(x1,y1,x2,y2)
tx = y1-y2
ty = x2-x1

print(x2+tx,y2+ty,x1+tx,y1+ty)

Fixed code:
# coding: utf-8
# Your code here!
x1,y1,x2,y2 = map(int,input().split())

tx = y1-y2
ty = x2-x1

print(x2+tx,y2+ty,x1+tx,y1+ty)
Buggy code:
x1, y1, x2, y2 = map(int, input().split())
nx = x2
ny = y2
l = []
for i in range(2) :
    dx, dy = -dy, dx
    nx += dx
    ny += dy
    l.append(nx)
    l.append(ny)
print(l[0], l[1], l[2], l[3])


Fixed code:
x1, y1, x2, y2 = map(int, input().split())
dx = x2 - x1
dy = y2 - y1
nx = x2
ny = y2
l = []
for i in range(2) :
    dx, dy = -dy, dx
    nx += dx
    ny += dy
    l.append(nx)
    l.append(ny)
print(l[0], l[1], l[2], l[3])
Buggy code:
x1, y1, x2, y2 = map(int, input().split())
x3 = (y1 - y2) + x2
y3 = y2
x4 = x3
y4 = y1
print(x3, y3, x4, y4)

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

Fixed code:
a,b,c,d = map(int,input().split())
print(c-(d-b),d+(c-a),c-d+b-c+a,d+c-a-d+b)
Buggy code:
x1,y1,x2,y2 = map(int,int(input().split())
h = max(abs(x2-x1),abs(y2-y1))
v = min(abs(x2-x1),abs(y2-y1))
if x1 > x2:
  if y1 > y2: print(x2+h,y2-v,x1+h,y1-v)
  else:print(x2-v,y2-h,x1-v,y1-h)
else:
  if y1 > y2: print(x2+v,y2+h,x1+v,y1+h)
  else:print(x2-h,y2+v,x1-h,y1+v)

Fixed code:
x1,y1,x2,y2 = map(int,input().split())
h = abs(x2-x1)
v = abs(y2-y1)
if x1 > x2:
  if y1 > y2: print(x2+v,y2-h,x1+v,y1-h)
  else:         print(x2-v,y2-h,x1-v,y1-h)
else:
  if y2 > y1: print(x2-v,y2+h,x1-v,y1+h)
  else:         print(x2+v,y2+h,x1+v,y1+h)
Buggy code:
x1, y1, x2, y2 = list(map(int, input().split()))

dx, dy = abs(x1 - x2), abs(y1 - y2)

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

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

dx, dy = x2 - x1, y2 - y1

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

dx = x2-x1
dy = y2-y1

print(x2-dy,y2-x1,x1-dy,y1-dx)

Fixed code:
x1,y1,x2,y2 = map(int,input().split())
 
dx = x2-x1
dy = y2-y1
 
print(x2-dy,y2+dx,x1-dy,y1+dx)
Buggy code:
a,b,c,d=map(int,input().split());print(a+b-d,d,a+b-d,b)

Fixed code:
a,b,c,d=map(int,input().split());print(b+c-d,-a+c+d,a+b-d,-a+b+c)
Buggy code:
xy=input().split()
x1=int(hw[0])
y1=int(hw[1])
x2=int(hw[2])
y2=int(hw[3])
a=x2-x1
b=y2-y1
print(x2-b,y2+a,x1-b,y1+a)

Fixed code:
xy=input().split()
x1=int(xy[0])
y1=int(xy[1])
x2=int(xy[2])
y2=int(xy[3])
a=x2-x1
b=y2-y1
print(x2-b,y2+a,x1-b,y1+a)
Buggy code:
a,b,c,d = map(int,input().split())

x = abs(a-c)
y = abs(b-d)

print(c-y, d+x, a-y, b+x)


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

x = c-a
y = d-b

print(c-y, d+x, a-y, b+x)
Buggy code:
x1,y1,x2,y2 = (int(i) for i in 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 = (int(i) for i in input().split())
x3 = x2 + (y1-y2)
y3 = y2 + (x2-x1)
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

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 = y1 - y2
 
x3 = x2 + y
y3 = y2 + x
x4 = x3 - x
y4 = y3 + y

print(x3,y3,x4,y4)
Buggy code:
import numpy as np

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

a = np.array([[x1], [y1]])
b = np.array([[x2], [y2]])

rot = np.array([[0, -1], [1, 0]])
ab = b - a
bc = np.dot(rot, ab)

c = b + bc
d = a + bc

# print(a, b)
# print(c, d)

print(*c.flatten()+' '+*d.flatten())

Fixed code:
import numpy as np

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

a = np.array([[x1], [y1]])
b = np.array([[x2], [y2]])

rot = np.array([[0, -1], [1, 0]])
ab = b - a
bc = np.dot(rot, ab)

c = b + bc
d = a + bc

# print(a, b)
# print(c, d)

print(*c.flatten(), end=" ")
print(*d.flatten())
Buggy code:
a,b,c,d=map(int,input().split())
l=[0]*4
l[0]=c+b-d
l[1]=d-(a-c)
l[2]=l[0]+a-c
l[3]=l[1]-(b-d) 
for i in range(3):
    print(l[i],end=' ')
print(l[3])

Fixed code:
a,b,c,d=map(int,input().split())
l=[0]*4
l[0]=c+b-d
l[1]=d-(a-c)
l[2]=l[0]+a-c
l[3]=l[1]+(b-d) 
for i in range(3):
    print(l[i],end=' ')
print(l[3])
Buggy code:
a,b,c,d=map(int,input(),split())
e=(d-b)
f=(c-a)
print(c-e,d+f,a-e,b+f)

Fixed code:
a,b,c,d=map(int,input().split())
e=(d-b)
f=(c-a)
print(c-e,d+f,a-e,b+f)
Buggy code:
# coding:utf-8

INF = float('inf')


def inpl(): return list(map(int, input().split()))


x1, y1, x2, y2 = inpl()

diff_y = y2 - y1
diff_x = x2 - x1
ans1 = [x2 - diff_y, y2 + diff_x]
ans2 = [ans1[0] - diff_x, ans1[1] - diff_y]
ans = ans1 + ans2
print(' '.join(map(str, ans))

Fixed code:
# coding:utf-8

INF = float('inf')


def inpl(): return list(map(int, input().split()))


x1, y1, x2, y2 = inpl()

diff_y = y2 - y1
diff_x = x2 - x1
ans1 = [x2 - diff_y, y2 + diff_x]
ans2 = [ans1[0] - diff_x, ans1[1] - diff_y]
ans = ans1 + ans2
ans = ' '.join(map(str, ans))
print(ans)
Buggy code:
sal
x1, y1, x2, y2 = map(int, input().split())
x3 = x2 + y1 - y2
y3 = y2 + x2 - x1
x4 = x3 + y2 - y3
y4 = y3 + x3 - x2
print(x3, y3, x4, y4)


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

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

print(x3,y3,x4,y4)
Buggy code:
A = [int(x) for x in input().split()]
a=A[2]-A[0]
b=A[3]-A[1]
print(A[2]-b,A[3]+a,A[0]-b,A[0]+a)


Fixed code:
A = [int(x) for x in input().split()]
a=A[2]-A[0]
b=A[3]-A[1]
print(A[2]-b,A[3]+a,A[0]-b,A[1]+a)
Buggy code:
l = list(map(int, input().split()))
print(l[1] + l[2] - l[3], end=' '),
print(l[3] + l[1] - l[0], end=' '),
print(l[2] - l[3] + l[0], end=' '),
print(l[1] - l[0] + l[2], end=' ')

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

Fixed code:
x1, y1, x2, y2 = map(int, input().split())
print(x2-y2+y1, y2+x2-x1, x1+y1-y2, y1-x1+x2)
Buggy code:
x1,y1,x2,y2=map(int,input().split())
x=x1-x2;y=y1-y2
print(x2+y,y2-x,x1-y,y1+x)

Fixed code:
x1,y1,x2,y2=map(int,input().split())
x=x1-x2;y=y1-y2
print(x2+y,y2-x,x1+y,y1-x)
Buggy code:
x1,y1,x2,y2=[int(s) for s in input().split()]
(dx,dy)=(x2-x1,y2-y1)
print(x2-dy,y2-dx,x1-dy,y1-dx)

Fixed code:
x1,y1,x2,y2=[int(s) for s in input().split()]
(dx,dy)=(x2-x1,y2-y1)
print(x2-dy,y2+dx,x1-dy,y1+dx)
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:
import math
x1,y1,x2,y2=map(int,input().split())

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

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

Fixed code:
x1,y1,x2,y2=map(int,input().split())
print(-1*(y2-y1)+x2,(x2-x1)+y2,(y1-y2)+x1,-1*(x1-x2)+y1)
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())

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

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

x3, y3 = x1 + dx - dy, y1 + dy - dx
x4, y4 = x1 - dy, y1 + dx

print(x3, y3, x4, y4)

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

diff_x = x2 - x1
diff_y = y2 - x2

x3 = x1 - diff_y
y3 = y1 + diff_x

x4 = x2 - diff_y
y4 = y2 + diff_x

print("{} {} {} {}".format(x3, y3, x4, y4))

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

diff_x = x2 - x1
diff_y = y2 - y1

x4 = x1 - diff_y
y4 = y1 + diff_x

x3 = x2 - diff_y
y3 = y2 + diff_x

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

if x1 > x2 and y1 == y2:
    Z = abs(x1-x2)
    x3 = x2
    y3 = y2-Z
    x4 = x1
    y4 = y3
    
elif x2 > x1 and y1 == y2:
    Z = abs(x2-x1)
    x3 = x2
    y3 = y2 + Z
    x4 = x1
    y4 = y3
elif y1 < y2 and x1 == x2:
    Z = abs(y1-y2)
    x3 = x2 - Z
    y3 = y2
    x4 = x3
    y4 = y1
else :
    Z= abs(y2-y1)
    x3 = x1 + Z
    y3 = y2
    x4 = x3
    y4 = y1





print('{} {} {} {}'.format(x3,y3,x4,y4))


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

if x1 >= x2 and y1 >= y2:
    x3 = x2 + (y1 - y2)
    y3 = y2 - (x1 - x2)
    x4 = x3 + (x1 - x2)
    y4 = y3 + (y1 - y2)
elif x1 >= x2 and y1 < y2:
    x3 = x2 - (y2 - y1)
    y3 = y2 - (x1 - x2)
    x4 = x3 + (x1 - x2)
    y4 = y3 - (y2 - y1)
elif x1 < x2 and y1 >= y2:
    x3 = x2 + (y1 - y2)
    y3 = y2 + (x2 - x1)
    x4 = x3 - (x2 - x1)
    y4 = y3 + (y1 - y2)
else:
    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 = map(int, input().split())
x3 = x2 - y1 + y2
y3 = y2 - x1 + x2
x4 = x3 + y2 - y3
x4 = y3 - x2 + x3
print(' '.join( list(map(str, [x3, y3, x4, y4])) ))

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

print(a[2]-y,a[3]-x,a[0]-y,a[1]-x)

Fixed code:
a = list(map(int,input().split()))
x = a[2]-a[0]
y = a[3]-a[1]

print(a[2]-y,a[3]+x,a[0]-y,a[1]+x)
Buggy code:
import sys, os, math, bisect, itertools, collections, heapq, queue
# from scipy.sparse.csgraph import csgraph_from_dense, floyd_warshall
from decimal import Decimal
from collections import defaultdict, deque

sys.setrecursionlimit(10000000)

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

lcm = lambda x, y: (x * y) // math.gcd(x, y)

MOD = 10 ** 9 + 7
MAX = float('inf')


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

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


if __name__ == '__main__':
    main()


Fixed code:
import sys, os, math, bisect, itertools, collections, heapq, queue
# from scipy.sparse.csgraph import csgraph_from_dense, floyd_warshall
from decimal import Decimal
from collections import defaultdict, deque

sys.setrecursionlimit(10000000)

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

lcm = lambda x, y: (x * y) // math.gcd(x, y)

MOD = 10 ** 9 + 7
MAX = float('inf')


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

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


if __name__ == '__main__':
    main()
Buggy code:
def main():
    x1, y1, x2, y2 = map(int, input().split())

    ans = editorial(x1, y1, x2, y2)
    assert ans == twi(x1, y1, x2, y2)
    print(*ans)


def twi(x1, y1, x2, y2):
    """
    https://twitter.com/akensho/status/1035924165205716992
    https://twitter.com/hogeover30/status/1035903937830764545
    """
    import math
    cos90 = int(math.cos(math.pi / 2))
    sin90 = int(math.cos(math.pi / 2))

    x = x2 - x1
    y = y2 - y1
    x4 = x * cos90 - y * sin90 + x1
    y4 = x * sin90 + y * cos90 + y1

    x = x1 - x4
    y = y1 - y4
    x3 = x * cos90 - y * sin90 + x4
    y3 = x * sin90 + y * cos90 + y4

    return x3, y3, x4, y4


def editorial(x1, y1, x2, y2):
    x = x2 - x1
    y = y2 - y1

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

    return x3, y3, x4, y4


if __name__ == '__main__':
    main()


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

    ans = editorial(x1, y1, x2, y2)
    # assert ans == twi(x1, y1, x2, y2)
    print(*ans)


def twi(x1, y1, x2, y2):
    """
    https://twitter.com/akensho/status/1035924165205716992
    https://twitter.com/hogeover30/status/1035903937830764545
    """
    import math
    cos90 = int(math.cos(math.pi / 2))
    sin90 = int(math.cos(math.pi / 2))

    x = x2 - x1
    y = y2 - y1
    x4 = x * cos90 - y * sin90 + x1
    y4 = x * sin90 + y * cos90 + y1

    x = x1 - x4
    y = y1 - y4
    x3 = x * cos90 - y * sin90 + x4
    y3 = x * sin90 + y * cos90 + y4

    return x3, y3, x4, y4


def editorial(x1, y1, x2, y2):
    x = x2 - x1
    y = y2 - y1

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

    return x3, y3, x4, y4


if __name__ == '__main__':
    main()
Buggy code:
x1,y1,x2,y2 = map(int,input().split())
diffy = x2-x1
diffx = y2-y1
print(diffy,diffx)
print(x2-diffx,y2+diffy,x1-diffx,y1+diffy)

Fixed code:
x1,y1,x2,y2 = map(int,input().split())
diffy = x2-x1
diffx = y2-y1
#print(diffy,diffx)
print(x2-diffx,y2+diffy,x1-diffx,y1+diffy)
Buggy code:
def test():
    x1,y1,x2,y2 = map(int,input().split())
    x = abs(x2-x1)
    y = abs(y2-y1)
    print(x2-y,y2+x,x1-y,y1+x)


if __name__ == "__main__":
    test()


Fixed code:
def test():
    x1,y1,x2,y2 = map(int,input().split())
    x = x2-x1
    y = y2-y1
    print(x2-y,y2+x,x1-y,y1+x)


if __name__ == "__main__":
    test()
Buggy code:
def answer(in0):
    nums = sorted([int(n) for n in in0.split(" ")])
    x1 = int(nums[0])
    y1 = int(nums[1])
    x2 = int(nums[2])
    y2 = int(nums[3])

    width = (x2 - x1)
    height = (y2 - y1)

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

    print(x3, y3, x4, y4)

answer(input())

Fixed code:
def answer(in0):
    nums = [int(n) for n in in0.split(" ")]
    x1 = int(nums[0])
    y1 = int(nums[1])
    x2 = int(nums[2])
    y2 = int(nums[3])

    width = (x2 - x1)
    height = (y2 - y1)

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

    print(x3, y3, x4, y4)

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

Fixed code:
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:
import sys
readline = sys.stdin.buffer.readline
def main():
    x1, y1, x2, y2 = map(int, readline().split())
    A = complex(x1, y1)
    B = complex(x2, y2)
    routate = 1j
    C = (B-A) * routate + B
    D = (B-A) * routate + A
    print(C.real, C.imag, D.real, D.imag)
if __name__ == '__main__':
    main()

Fixed code:
import sys
readline = sys.stdin.buffer.readline
def main():
    x1, y1, x2, y2 = map(int, readline().split())
    A = complex(x1, y1)
    B = complex(x2, y2)
    routate = 1j
    C = (B-A) * routate + B
    D = (B-A) * routate + A
    print(int(C.real), int(C.imag), int(D.real), int(D.imag))
if __name__ == '__main__':
    main()
Buggy code:
x1, y1, x2, y2 = map(int, input().split())
dx = abs(x1 - x2)
dy = abs(y1 - y2)

x3 = x2 - dy
y3 = y2 - dx
x4 = x3 + dx
y4 = y3 - dy

print(x3, y3, x4, y4)

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

x3 = x2 - dy
y3 = y2 + dx
x4 = x3 - dx
y4 = y3 - dy

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

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

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

print(x3,y3,x4,y4)
Buggy code:
n = list(map(int,input().split()))

p1 = (int(n[0]) + int(n[1]) * 1j)
p2 = (int(n[2]) + int(n[3]) * 1j)

p3 = (p1 - p2) * 1j + p2
p4 = p3 + (p1 - p2)

print(p3.real, p3.imag, p4.real, p4.imag)

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

p1 = (int(n[0]) + int(n[1]) * 1j)
p2 = (int(n[2]) + int(n[3]) * 1j)

p3 = (p2 - p1) * 1j + p2
p4 = p3 + (p1 - p2)

print(int(p3.real), int(p3.imag), int(p4.real), int(p4.imag))
Buggy code:
import numpy as np

x_1, y_1, x_2, y_2 = map(int, input().split())

P_1 = np.array([x_1, y_1])
P_2 = np.array([x_2, y_2])
vec_12 = P_2 - P_1
vec_13 = np.array([-vec_12[1], vec_12[0]])
P_3 = P_1 + vec_13
P_4 = P_2 + vec_13
print(P_3[0], P_3[1], P_4[1], P_4[2])


Fixed code:
import numpy as np

x_1, y_1, x_2, y_2 = map(int, input().split())

P_1 = np.array([x_1, y_1])
P_2 = np.array([x_2, y_2])
vec_12 = P_2 - P_1
vec_13 = np.array([-vec_12[1], vec_12[0]])
P_3 = P_1 + vec_13
P_4 = P_2 + vec_13
print(P_4[0], P_4[1], P_3[0], P_3[1])
Buggy code:
import numpy as np
x1, y1, x2, y2 = map(int, input().split())


def get_rotation_matrix(rad):
    rot = np.array([[np.cos(rad), -np.sin(rad)],
                    [np.sin(rad), np.cos(rad)]])
    return rot

X1 = x1 -x2
Y1 = y1 - y2
r = get_rotation_matrix(np.pi*3 / 2)
rotated = np.dot(np.asarray([X1, Y1]),r )
print(str(int(rotated[0])+x2)+" "+ str(int(rotated[1])+y2),end=" ")

X2 = -int(rotated[0])
Y2 = -int(rotated[1])
r = get_rotation_matrix(np.pi / 2)
XY4 = np.dot(np.asarray([X2, Y2]),r )
x4 = int(XY4[0])
y4 = int(XY4[1])
print(str(x4+int(rotated[0])+x2)+" " +str(y4+int(rotated[1])+y2), end="")

Fixed code:
import numpy as np

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


def get_rotation_matrix(rad):
    rot = np.array([[np.cos(rad), -np.sin(rad)],
                    [np.sin(rad), np.cos(rad)]], dtype=np.int32)
    return rot


X1 = x1 - x2
Y1 = y1 - y2
r = get_rotation_matrix(np.pi / 2)
rotated = np.dot(-r, np.asarray([X1, Y1], dtype=np.int32))
print(str(rotated[0] + x2) + " " + str(rotated[1] + y2), end=" ")

X2 = -rotated[0]
Y2 = -rotated[1]
r = get_rotation_matrix(np.pi / 2)
XY4 = np.dot(-r, np.asarray([X2, Y2],dtype=np.int32))
x4 = XY4[0]
y4 = XY4[1]
print(str(x4 + rotated[0] + x2) + " " + str(y4 + rotated[1] + y2), end="")
Buggy code:
import math
x1, y1, x2, y2 = map(int, input().split())
x2 -= x1
y2 -= y1
print(x2, y2)
if x2 != 0:
    theta = math.atan2(y2,x2)
else:
    if y2 > 0:
        theta = math.pi / 2
    else:
        theta = 3 * math.pi / 2
if y2 == 0:
    if x2 < 0:
        theta = math.pi
    else:
        theta = 0

if theta < 0:
    theta += 2 * math.pi

l = math.sqrt(x2**2 + y2**2)

x3 = math.cos(theta+math.radians(45))*l*math.sqrt(2)+x1
y3 = math.sin(theta+math.radians(45))*l*math.sqrt(2)+y1

x4 = math.cos(theta+math.radians(90))*l+x1
y4 = math.sin(theta+math.radians(90))*l+y1
print(round(x3), round(y3), round(x4), round(y4))

Fixed code:

import math
x1, y1, x2, y2 = map(int, input().split())
x2 -= x1
y2 -= y1
if x2 != 0:
    theta = math.atan2(y2,x2)
else:
    if y2 > 0:
        theta = math.pi / 2
    else:
        theta = 3 * math.pi / 2
if y2 == 0:
    if x2 < 0:
        theta = math.pi
    else:
        theta = 0

if theta < 0:
    theta += 2 * math.pi
#theta = theta % (2 * math.pi)

l = math.sqrt(x2**2 + y2**2)

x3 = math.cos(theta+math.radians(45))*l*math.sqrt(2)+x1
y3 = math.sin(theta+math.radians(45))*l*math.sqrt(2)+y1

x4 = math.cos(theta+math.radians(90))*l+x1
y4 = math.sin(theta+math.radians(90))*l+y1
print(round(x3), round(y3), round(x4), round(y4))
Buggy code:
x1, y1, x2, y2 = map(int, input().split())

dx, dy = x2 - x1, y2- y1

for i in range(2):
    dx, dy = -dy, dx
    x2 += dx
    y2 += dy
    print(x2, y2, end='')

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

dx, dy = x2 - x1, y2- y1

for i in range(2):
    dx, dy = -dy, dx
    x2 += dx
    y2 += dy
    print(x2, y2, end=' ')
Buggy code:
import sys
from collections import deque
import math
#sys.setrecursionlimit(10**6)
def S(): return sys.stdin.readline().rstrip()
def SL(): return map(str,sys.stdin.readline().rstrip().split())
def I(): return int(sys.stdin.readline().rstrip())
def IL(): return map(int,sys.stdin.readline().rstrip().split())
def array(n,val=0):
    return [val]*n
def matrix(row,columns,val):
    return [[val]*columns for _ in range(row)]

def solve():
    x1,y1,x2,y2 = IL()
    points = sorted([[x1,y1],[x2,y2]], key=lambda x: x[1])
    print(points)
    dx = points[0][0]-points[1][0]
    dy = points[0][1]-points[1][1]
    x3 = points[1][0] + dy
    y3 = points[1][1] - dx
    x4 = points[0][0] + dy
    y4 = points[0][1] - dx
    print(x3,y3,x4,y4)
    return

if __name__=='__main__':
    solve()

Fixed code:
import sys
from collections import deque
import math
#sys.setrecursionlimit(10**6)
def S(): return sys.stdin.readline().rstrip()
def SL(): return map(str,sys.stdin.readline().rstrip().split())
def I(): return int(sys.stdin.readline().rstrip())
def IL(): return map(int,sys.stdin.readline().rstrip().split())
def array(n,val=0):
    return [val]*n
def matrix(row,columns,val):
    return [[val]*columns for _ in range(row)]

def solve():
    dx = x2-x1
    dy = y2-y1

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

if __name__=='__main__':
    x1,y1,x2,y2 = IL()
    solve()
Buggy code:
x1,y1,x2,y2 = map(int,input().split())
d1 = abs(x2-x1)
d2 = abs(y2-y1)
x3 = x2 + d2
y3 = y2 + d1
x4 = x1 + d1
y4 = y1 + d2
print(x3 y3 x4 y4)


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