Problem:


Score : 200 points

Problem Statement

There is a square in the xy-plane. The coordinates of its four vertices are (x_1,y_1),(x_2,y_2),(x_3,y_3) and (x_4,y_4) in counter-clockwise order.
(Assume that the positive x-axis points right, and the positive y-axis points up.)

Takahashi remembers (x_1,y_1) and (x_2,y_2), but he has forgot (x_3,y_3) and (x_4,y_4).

Given x_1,x_2,y_1,y_2, restore x_3,y_3,x_4,y_4. It can be shown that x_3,y_3,x_4 and y_4 uniquely exist and have integer values.

Constraints

|x_1|,|y_1|,|x_2|,|y_2| \leq 100

(x_1,y_1) ≠ (x_2,y_2)

All values in input are integers.

Input

Input is given from Standard Input in the following format:

x_1 y_1 x_2 y_2

Output

Print x_3,y_3,x_4 and y_4 as integers, in this order.

Sample Input 1

0 0 0 1

Sample Output 1

-1 1 -1 0

(0,0),(0,1),(-1,1),(-1,0) is the four vertices of a square in counter-clockwise order.
Note that (x_3,y_3)=(1,1),(x_4,y_4)=(1,0) is not accepted, as the vertices are in clockwise order.

Sample Input 2

2 3 6 6

Sample Output 2

3 10 -1 7

Sample Input 3

31 -41 -59 26

Sample Output 3

-126 -64 -36 -131



Sample input:
0 0 0 1


Sample output:
-1 1 -1 0

Submission status: Wrong Answer

Solution 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+dy
    x4 = x1-dy
    y4 = y1+dx
    print(x3,y3,x4,y4)
    return

if __name__=='__main__':
    x1,y1,x2,y2 = IL()
    solve()

Submission status: Wrong Answer

Solution 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():
    points = sorted(a, key=lambda x: (x[1],-x[0]))
    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
    if points != a:
        x3,x4,y3,y4 = x4,x3,y4,y3
    print(x3,y3,x4,y4)
    return

if __name__=='__main__':
    x1,y1,x2,y2 = IL()
    a = [[x1,y1],[x2,y2]]
    solve()

Submission status: Wrong Answer

Solution 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():
    points = sorted(a, key=lambda x: (x[1],-x[0]))
    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(points,a)
    if points != a:
        x3,x4,y3,y4 = x4,x3,y4,y3
    print(x3,y3,x4,y4)
    return

if __name__=='__main__':
    x1,y1,x2,y2 = IL()
    a = [[x1,y1],[x2,y2]]
    solve()

Submission status: Wrong Answer

Solution 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():
    points = sorted(a, key=lambda x: (x[1],-x[0]))
    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
    if points is a:
        x3,x4,y3,y4 = x4,x3,y4,y3
    print(x3,y3,x4,y4)
    return

if __name__=='__main__':
    x1,y1,x2,y2 = IL()
    a = [[x1,y1],[x2,y2]]
    solve()

Submission status: Wrong Answer

Solution 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():
    points = sorted([[x1,y1],[x2,y2]], key=lambda x: (x[1],-x[0]))
    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__':
    x1,y1,x2,y2 = IL()
    solve()

Submission status: Wrong Answer

Solution 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():
    points = sorted([[x1,y1],[x2,y2]], key=lambda x: (x[1],x[0]))
    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__':
    x1,y1,x2,y2 = IL()
    solve()

Submission status: Wrong Answer

Solution 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():
    points = sorted([[x1,y1],[x2,y2]], key=lambda x: x[1])
    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__':
    x1,y1,x2,y2 = IL()
    solve()

Submission status: Wrong Answer

Solution 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()

Submission status: Wrong Answer

Solution code:
l = list(map(int, input().split()))
print(l)
a = l[2] - l[0] #x軸の差分
b = l[3] - l[1] #y軸の差分

if l[2]>=l[0]:
    if l[3]>l[1]:
        a1 = - b
        b1 = a
        a2 = -a
        b2 = -b

    if l[3]<l[1]:
        a1 = b
        b1 = a
        a2 = -a
        b2 = b

    x1 = l[2] + a1
    y1 = l[3] + b1
    x2 = x1 + a2
    y2 = y1 + b2
    print(x1, y1, x2, y2)
    exit()

elif l[2]<l[0]:
    if l[3]<=l[1]:
        a1 = b
        b1 = - a
        a2 = a
        b2 = b

    if l[3]>l[1]:
        a1 = - b
        b1 = - a
        a2 = a
        b2 = - b
        print("yes")

    x1 = l[2] + a1
    y1 = l[3] - b1
    x2 = x1 - a2
    y2 = y1 + b2
    print(x1, y1, x2, y2)

Submission status: Wrong Answer

Solution code:
x1, y1, x2, y2 = map(int, input().split())
x_len = abs(x1 - x2)
y_len =  abs(y2 - y1)
print("{} {} {} {}".format(x2-y_len,y2+x_len,x1-y_len,y1+x_len))

Submission status: Wrong Answer

Solution code:
x1,y1,x2,y2=map(int,input().split())
if y2>=y1 and x2>=x1:
    y3=y2+abs(x2-x1)
    x3=x2-abs(y2-y1)
elif y2>=y1 and x1>x2:
    x3=x2-abs(y2-y1)
    y3=y2-abs(x2-x1)
elif y1>y2 and x2>=x1:
    x3=x2+abs(y2-y1)
    y3=y2+abs(x2-x1)
else:
    x3=x2-abs(y2-y1)
    y3=y2-abs(x2-x1)

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

print(x3,y3,x4,y4)

Submission status: Wrong Answer

Solution code:
x1,y1,x2,y2=map(int,input().split())
if y2>y1:
    y3=y1-abs(x2-x1)
else:
    y3=y1+abs(x2-x1)

if x2>x1:
    x3=x1+abs(y2-y1)
else:
    x3=x1-abs(y2-y1)

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

print(x3,y3,x4,y4)

Submission status: Wrong Answer

Solution code:
a,b,c,d=map(int,input().split());print(a+b-d,d,a+b-d,b)

Submission status: Wrong Answer

Solution 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()

Submission status: Wrong Answer

Solution 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()

Submission status: Wrong Answer

Solution 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)

Submission status: Wrong Answer

Solution code:
import sys
import copy
import math
import itertools
import numpy as np
def rotation_o(u, t, deg=False):

    # 度数単位の角度をラジアンに変換
    if deg == True:
        t = np.deg2rad(t)

    # 回転行列
    R = np.array([[np.cos(t), -np.sin(t)],
                  [np.sin(t),  np.cos(t)]])

    return  np.dot(R, u)

a = [int(c) for c in input().split()]
A=np.array([a[0],a[1]])
B=np.array([a[2],a[3]])
AB=B-A
C = np.array(B) + rotation_o(AB,90,True)
D = C + A - B
print(int(C[0]),int(C[1]),int(D[0]),int(D[1]))

Submission status: Wrong Answer

Solution code:
x1, y1, x2, y2 = list(map(int, input().split()))
vector = (x2-x1, y2-y1)
x3, y3 = x1-vector[1], y1+vector[0]
x4, y4 = x2-vector[1], y2+vector[0]
print(x3, y3, x4, y4)

Submission status: Wrong Answer

Solution code:
# B - Ruined Square
x1,y1,x2,y2 = map(int,input().split())
if y1==y2:
    print(x2,y1+x2-x1,x1,y1+x2-x1)
else:
    print(x1+y1-y2,y2,x1+y1-y2,y1)

Submission status: Wrong Answer

Solution 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)

Submission status: Wrong Answer

Solution 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)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution 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)

Submission status: Wrong Answer

Solution code:
x1,y1,x2,y2=list(map(int,input().split()))
dx=x2-x1
dy=y2-y1
print((x2-dy,y2+dx,x1-dy,y1+dx))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

y3 = y2 + dx
x3 = x2 - dy

y4 = y1 + dx
x4 = x1 - dy

print(x3,y3,x4,y4)

Submission status: Wrong Answer

Solution 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)

Submission status: Wrong Answer

Solution code:
a,b,c,d = map(int,input().split())
print(c+b-d,d+a-c,a+b-d,b+a-c)

Submission status: Wrong Answer

Solution code:
x1, y1, x2, y2 = map(int,input().split())
if x1==x2:
    print(x2+(y1-y2), y2, x1+(y1-y2), y1)
else:
    print(x2, y2+(x1-x2), x1, y1+(x1-x2))

Submission status: Wrong Answer

Solution code:
x1, y1, x2, y2 = map(int,input().split())
if x1 == x2:
    l = abs(y1 - y2)
    x3 = x1 - l
    x4 = x1 - l
    y3 = y2
    y4 = y1
elif y1 == y2:
    l = abs(x1 - x2)
    y3 = y1 - l
    y4 = y1 - l
    x3 = x2
    x4 = x1
else:
    x12 = x2 - x1
    y12 = y2 - y1
    x3 = x2 - y12
    y3 = y2 + x12
    x4 = x3 -x12
    y4 = y3 -y12
print(x3, y3, x4, y4)

Submission status: Wrong Answer

Solution code:
x1,y1,x2,y2=map(int,input().split())
Dist = abs(y1-y2)**2+abs(x1-x2)**2
dist = Dist**0.5
x3=0
y3=0
x4=0
y4=0
if y2 ==y1:
  x3 = x2
  x4 = x1
  y3 = int(dist)
  y4 = y3
elif x1 == x2:
  x3 = -int(dist)
  x4 = x3
  y3 = y2
  y4 = y1
else:
  for i in range(-10000,10000):
    if (i-x2)**2==(y2-y1)**2:
      if i < x2:
        x3 = i
        y3 = y2 - (x2-x1)*(x3-x2)//(y2-y1)
        break
  for i in range(-10000,10000):
    if (i-x1)**2==(y2-y1)**2:
      if i < x1:
        x4 = i
        y4 = y1 - (x2-x1)*(x4-x1)//(y2-y1)
        break
print(x3,y3,x4,y4)

Submission status: Wrong Answer

Solution code:
x1,y1,x2,y2=map(int,input().split())
Dist = abs(y1-y2)**2+abs(x1-x2)**2
dist = Dist**0.5
for i in range(-100000,10000):
  if y2 ==y1:
    x3 = x2
    x4 = x1
    y3 = int(dist)
    y4 =y3
  elif x1 == x2:
    x3 = -int(dist)
    x4 = x3
    y3 = y2
    y4 = y1
  else:
    if Dist*(i-x2)**2==Dist*(y2-y1)**2:
      if i < x2:
        x3 = i
        y3 = y2 - (x2-x1)*(x3-x2)//(y2-y1)
    if Dist*(i-x1)**2==Dist*(y2-y1)**2:
      if i < x1:
        x4 = i
        y4 = y1 - (x2-x1)*(x4-x1)//(y2-y1)
print(x3,y3,x4,y4)

Submission status: Wrong Answer

Solution code:
x1,y1,x2,y2=map(int,input().split())
Dist = abs(y1-y2)**2+abs(x1-x2)**2
dist = Dist**0.5
for i in range(-1000,1000):
  if y2 ==y1:
    x3 = x2
    x4 = x1
    y3 = int(dist)
    y4 =y3
  elif x1 == x2:
    x3 = -dist
    x4 = x3
    y3 = y2
    y4 = y1
  else:
    if Dist*(i-x2)**2==Dist*(y2-y1)**2:
      if i < x2:
        x3 = i
        y3 = y2 - (x2-x1)*(x3-x2)//(y2-y1)
    if Dist*(i-x1)**2==Dist*(y2-y1)**2:
      if i < x1:
        x4 = i
        y4 = y1 - (x2-x1)*(x4-x1)//(y2-y1)
print(x3,y3,x4,y4)

Submission status: Wrong Answer

Solution code:
x1,y1,x2,y2=map(int,input().split())
Dist = abs(y1-y2)**2+abs(x1-x2)**2
dist = Dist**0.5
for i in range(-1000,1000):
  if y2 ==y1:
    x3 = x2
    x4 = x1
    y3 = int(dist)
    y4 =y3
  else:
    if Dist*(i-x2)**2==Dist*(y2-y1)**2:
      if i < x2:
        x3 = i
        y3 = y2 - (x2-x1)*(x3-x2)//(y2-y1)
    if Dist*(i-x1)**2==Dist*(y2-y1)**2:
      if i < x1:
        x4 = i
        y4 = y1 - (x2-x1)*(x4-x1)//(y2-y1)
print(x3,y3,x4,y4)

Submission status: Wrong Answer

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

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

print(x3,y3,x4,y4)

Submission status: Wrong Answer

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

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

print(x3,y3,x4,y4)

Submission status: Wrong Answer

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

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

print(x3,y3,x4,y4)

Submission status: Wrong Answer

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

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

print(x3,y3,x4,y4)

Submission status: Wrong Answer

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

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



print(x3,y3,x4,y4)

Submission status: Wrong Answer

Solution 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)

Submission status: Wrong Answer

Solution code:
x1,y1,x2,y2 = map(int,input().split())
diffy = abs(x2-x1)
diffx = abs(y2-y1)
print(x2-diffx,y2+diffy,x1-diffx,y1+diffy)

Submission status: Wrong Answer

Solution code:
a,b,c,d=map(int,input().split())
x = abs(a-c)
y = abs(b-d)
ax = c - y
bx = a - y
if a <= c:
    ay = d + x
    by = b + x
else:
    ay = d - x
    by = b - x
print(str(ax)+' '+str(ay)+' '+str(bx)+' '+str(by))

Submission status: Wrong Answer

Solution code:
#30 **より二回かけた方が早い
import math
x1,y1,x2,y2 = map(int,input().split())
x = x1-x2
y = y1-y2

print(x2+y,y2+x,x1+y,y1+x)

Submission status: Wrong Answer

Solution code:
#30 **より二回かけた方が早い
import math
x1,x2,y1,y2 = map(int,input().split())
x = x1-x2
y = y1-y2

print(x1+x,y1+y,x2+x,y2+y)

Submission status: Wrong Answer

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

length = (x2 - x1) ** 2 + (y2 - y1) ** 2

for x3 in range(-101, 101):
    for y3 in range(-101, 101):
        if length == (x2 - x3) ** 2 + (y3 - y2) ** 2: break
    else:
        continue
    break

for x4 in range(-101, 101):
    for y4 in range(-101, 101):
        if length == (x1 - x4) ** 2 + (y4 - y1) ** 2: break
    else:
        continue
    break

print(x3, y3, x4, y4)

Submission status: Wrong Answer

Solution code:
x = map(int, raw_input().split(' '))
a = tuple(x[:2])
b = tuple(x[2:])
vector = [-abs(b[1] - a[1]), abs(b[0] - a[0]) ]

c = [b[0] + vector[0],b[1] + vector[1] ]
d = [a[0] + vector[0],a[1] + vector[1] ]  

print c[0],c[1], d[0],d[1]

Submission status: Wrong Answer

Solution code:
import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7

x1, y1, x2, y2 = rm()
c1, c2 = x1+y1*1j, x2+y2*1j
c3, c4 = -1j*(c1-c2), 1j*(c2-c1)
print(int(c3.real), int(c3.imag), int(c4.real), int(c4.imag))

Submission status: Wrong Answer

Solution code:
import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7

x1, y1, x2, y2 = rm()
c1, c2 = x1+y1*1j, x2+y2*1j
c3, c4 = -1j*(c2-c1), 1j*(c1-c2)
print(int(c3.real), int(c3.imag), int(c4.real), int(c4.imag))

Submission status: Wrong Answer

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

dx = x1 - x2 #-4
dy = y1 - y2 #-3

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

print(x3,y3,x4,y4)

Submission status: Wrong Answer

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

dx = x1 - x2 #-4
dy = y1 - y2 #-3

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

print(x3,y3,x4,y4)

Submission status: Wrong Answer

Solution 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()

Submission status: Wrong Answer

Solution code:
a,b,c,d=map(int,input().split())
w=c-a
h=b-d
ans=[c-h,d+w,a-h,b+w]
print(*ans)
res=[c+h,d-w,a+h,b-w]
print(*res)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if a==c:
    l=abs(d-b)
    if b<d:
        print(c-l,d,c-l,b)
    else:
        print(a+l,b,a+l,d)
elif b==d:
    l=abs(c-a)
    if c>a:
        print(c,d+l,a,d+l)
    else:
        print(c,d-l,a,d-l)

elif a<c and b<d:
    l2,l3=(c-a),(d-b)
    print(c-l3,d+l2,c-l3-l2,d+l2-l3)
elif a>c and d>b:
    l2,l3=(d-b),(a-c)
    print(c-l2,d-l3,c-l2+l3,d-l3-l2)
elif a>c and b>d:
    l2,l3=(a-c),(b-d)
    print(c+l3,d-l2,c+l3+l2,d-l2+l3)
else:
    l2,l3=(b-d),(c-a)
    print(c+l2,d+l3,c+l2-l3,d+l3+l2)

Submission status: Wrong Answer

Solution code:
x1, y1, x2, y2 = map(int, input().split())
l = abs(x1-x2)
h = abs(y1-y2)

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

print(x3, y3, x4, y4)

Submission status: Wrong Answer

Solution code:
x1, y1, x2, y2 = map(int, input().split())
l = max(abs(x1-x2), abs(y1-y2))

if x1-x2:
    x3 = x2
    y3 = y2+l
    x4 = x1
    y4 = y1+l
else:
    x3 = x2-l
    y3 = y2
    x4 = x1-l
    y4 = y1

print(x3, y3, x4, y4)

Submission status: Wrong Answer

Solution code:
if __name__ == '__main__':
    a = [int(i) for i in input().split()]
    x=a[2]-a[0]
    y=a[3]-a[1]

    print(str(a[2]-y)+" "+ str(a[3]+x)+" "+str(a[3]+x)+" "+str(a[1]+x)+" ")

Submission status: Wrong Answer

Solution code:
def actual(x1, y1, x2, y2):
    a = x2 - x1
    b = y2 - y1

    x3, y3 = x2 - b, y2 + a
    x4, y4 = x3 - a, y3 - b

    return x3, y3, x4, y4

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

Submission status: Wrong Answer

Solution code:
x1,y1,x2,y2 = map(int,input().split())
r = (x2-x1)**2 + (y2-y1)**2
for i in range(-200,201):
    for j in range(-200,201):
        if (x1-i)**2+(y1-j)**2 == r and (x1-i)*(x2-x1)+(y1-j)*(y2-y1) == 0:
            print(i+x2-x1,j+y2-y1,i,j)
            exit()

Submission status: Wrong Answer

Solution code:
def resolve():
    x1, y1, x2, y2 = map(int, input().split())
    x3 = [x2-abs(y2-y1), x2+abs(y2-y1)]
    y3 = [y2-abs(x2-x1), y2+abs(x2-x1)]
    x4 = [x1-abs(y2-y1), x1+abs(y2-y1)]
    y4 = [y1-abs(x2-x1), y1+abs(x2-x1)]
    k = (x2-x1)**2+(y2-y1)**2
    s = 4*k**2
    for i in x3:
        for j in y3:
            for p in x4:
                for q in y4:
                    if (i-x2)**2+(j-y2)**2 == k and (p-x1)**2+(q-y1)**2 == k and (i-p)**2+(j-q)**2 == k and (i-x1)**2+(j-y1)**2 == s and (p-x2)**2+(q-y2)**2 == s:
                        print(i, j, p, q)
resolve()

Submission status: Wrong Answer

Solution code:
def resolve():
    x1, y1, x2, y2 = map(int, input().split())
    x3 = [x2-abs(y2-y1), x2+abs(y2-y1)]
    y3 = [y2-abs(x2-x1), y2+abs(x2-x1)]
    x4 = [x1-abs(y2-y1), x1+abs(y2-y1)]
    y4 = [y1-abs(x2-x1), y1+abs(x2-x1)]
    k = (x2-x1)**2+(y2-y1)**2
    s = 4*k**2
    for i in x3:
        for j in y3:
            for p in x4:
                for q in y4:
                    if (i-x2)**2+(j-y2)**2 == k and (p-x1)**2+(q-y1)**2 == k and (i-p)**2+(j-q)**2 == k and (i-x1)**2+(j-y1)**2 == s and (p-x2)**2+(q-y2)**2 == s:
                        print(i, j, p, q)
                        exit()
resolve()

Submission status: Wrong Answer

Solution code:
def resolve():
    x1, y1, x2, y2 = map(int, input().split())
    x3 = [x2-abs(y2-y1), x2+abs(y2-y1)]
    y3 = [y2-abs(x2-x1), y2+abs(x2-x1)]
    x4 = [x1-abs(y2-y1), x1+abs(y2-y1)]
    y4 = [y1-abs(x2-x1), y1+abs(x2-x1)]
    k = (x2-x1)**2+(y2-y1)**2
    for i in x3:
        for j in y3:
            for p in x4:
                for q in y4:
                    if (i-x2)**2+(j-y2)**2 == k and (p-x1)**2+(q-y1)**2 == k and (i-p)**2+(j-q)**2 == k and (i-x1)**2+(j-y1)**2 == k and (p-x2)**2+(q-y2)**2 == k:
                        print(i, j, p, q)
                        exit()
resolve()

Submission status: Wrong Answer

Solution code:
def resolve():
    x1, y1, x2, y2 = map(int, input().split())
    x3 = [x2-abs(y2-y1), x2+abs(y2-y1)]
    y3 = [y2-abs(x2-x1), y2+abs(x2-x1)]
    x4 = [x1-abs(y2-y1), x1+abs(y2-y1)]
    y4 = [y1-abs(x2-x1), y1+abs(x2-x1)]
    k = (x2-x1)**2+(y2-y1)**2
    for i in x3:
        for j in y3:
            for p in x4:
                for q in y4:
                    if (i-x2)**2+(j-y2)**2 == k and (p-x1)**2+(q-y1)**2 == k and (i-p)**2+(j-q)**2 == k:
                        print(i, j, p, q)
                        exit()
resolve()

Submission status: Wrong Answer

Solution code:
def resolve():
    x1, y1, x2, y2 = map(int, input().split())
    print(x2-abs(y2-y1), y2+x2-x1, x1-abs(y2-y1), y1+x2-x1)
resolve()

Submission status: Wrong Answer

Solution code:
import bisect,collections,copy,heapq,itertools,math,numpy,string
import sys
def S(): return sys.stdin.readline().rstrip()
def I(): return int(sys.stdin.readline().rstrip())
def SS(): return map(str,sys.stdin.readline().rstrip().split())
def II(): return map(int,sys.stdin.readline().rstrip().split())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())

x1,y1,x2,y2 = II()
norm = ((x1-x2)**2 + (y1-y2)**2) ** (0.5)
radian = math.atan2(y1-y2,x1-x2)

if radian >= 0:
  x3 = x2 + norm * math.sin(radian)
  y3 = y2 + norm * math.cos(radian)

  x4 = x1 + norm * math.sin(radian)
  y4 = y1 + norm * math.cos(radian)
else:
  x3 = x2 + norm * math.sin(radian)
  y3 = y2 - norm * math.cos(radian)

  x4 = x1 + norm * math.sin(radian)
  y4 = y1 - norm * math.cos(radian)

print(int(x3),int(y3),int(x4),int(y4))

Submission status: Wrong Answer

Solution code:
import sys
input=sys.stdin.readline
x1,y1,x2,y2=map(int,input().split())
if x1==x2:
    if y2>y1:
        d=y2-y1
        y3=y2
        y4=y1
        x3=x2-d
        x4=x3
    else:
        d=y1-y2
        y3 = y2
        y4 = y1
        x3 = x2+d
        x4 = x3
elif x1>x2:
    d=x1-x2
    x3=x2
    x4=x1
    y3=y2-d
    y4=y3
else:
    d=x2-x1
    x3 = x2
    x4 = x1
    y3 = y2+d
    y4 = y3
print(x3,y3,x4,y4)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x,y,x2,y2 = map(int,input().split())
hen = (x2-x)**2+(y2-y)**2
for x3 in range(-200,200):
    for y3 in range(-200,200):
        x4 = x+(x3-x2)
        y4 = y3+(y-y2)
        if hen == (x-x4)**2+(y-y4)**2 == (x3-x4)**2+(y3-y4)**2 and (x4-x2)**2+(y4-y2)**2 == (x3-x)**2+(y3-y)**2:
            print(x3,y3,x4,y4)
            exit()