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: Accepted

Solution code:
x1, y1, x2, y2 = 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)

Submission status: Accepted

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

x_temp = x2 - x1
y_temp = y2 - y1

x3 = x2 - y_temp
y3 = y2 + x_temp

x4 = x3 - x_temp
y4 = y3 - y_temp

print(x3, y3, x4, y4)

Submission status: Accepted

Solution code:
def rot(v):
    v = [-v[1],v[0]]
    return v

S = list(map(int, input().split()))

u = [S[2]-S[0],S[3]-S[1]]
v = rot(u)
w = rot(v)

X3 = [S[2]+v[0],S[3]+v[1]]
X4 = [X3[0]+w[0],X3[1]+w[1]]

print(*(X3+X4))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def abc():
    x1, y1, x2, y2 = map(int, input().split())
    dx = x2 - x1
    dy = y2 - y1
    x3 = x2 - dy
    y3 = y2 + dx

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

    print(x3, y3, x4, y4)


abc()

Submission status: Accepted

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

# PROCESS
dx, dy = x2-x1, y2-y1
 
x3, y3 = x1 + dx - dy, y1 + dy + dx
x4, y4 = x1 - dy, y1 + dx

# OUTPUT 
print(x3, y3, x4, y4)

Submission status: Accepted

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

vector = [-1 * (y2 - y1), x2 - x1]
x3 = x2 + vector[0]
y3 = y2 + vector[1]
x4 = x1 + vector[0]
y4 = y1 + vector[1]

print(x3, y3, x4, y4)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import numpy as np
x1, y1, x2, y2 = map(int, input().split())
c1 = np.array([x1, y1])
c2 = np.array([x2, y2])
vec1 = c2 - c1
rot = np.array([[0, 1], [-1, 0]])
vec1 = np.dot(vec1, rot)
c3 = c2 + vec1
vec1 = np.dot(vec1, rot)
c4 = c3 + vec1
ans = c3.tolist() + c4.tolist()
ans = list(map(str, ans))
print(" ".join(ans))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import bisect
import os
from collections import Counter, deque
from fractions import gcd
from functools import lru_cache
from functools import reduce
import functools
import heapq
import itertools
import math
import numpy as np
import re
import sys

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

sys.setrecursionlimit(2147483647)
INF = float("inf")

x1, y1, x2, y2 = list(map(int, sys.stdin.readline().split()))
x3 = x2 - (y2 - y1)
y3 = y2 - (x1 - x2)
x4 = x3 - (y3 - y2)
y4 = y3 - (x2 - x3)
print(x3, y3, x4, y4)

Submission status: Accepted

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

a=n[1]-n[3]+n[2]
b=n[2]-n[0]+n[3]
c=n[1]-n[3]+n[0]
d=n[2]-n[0]+n[1]


print(a,b,c,d)

Submission status: Accepted

Solution code:

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



dx, dy = x2-x1, y2-y1

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

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

Submission status: Accepted

Solution code:
a,b,c,d = (int(i) for i in input().split())
x,y = c-a,d-b
print(c-y,d+x,a-y,b+x)

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x1, y1, x2, y2 = map(int, input().split())
import math
x = x2 - x1
y = y2 - y1
theta3 = math.pi/4
x3 = round(math.sqrt(2) * (x*math.cos(theta3) - y*math.sin(theta3)))
y3 = round(math.sqrt(2) * (x*math.sin(theta3) + y*math.cos(theta3)))
theta4 = math.pi/2
x4 = round(x*math.cos(theta4) - y*math.sin(theta4))
y4 = round(x*math.sin(theta4) + y*math.cos(theta4))

print(x3+x1,y3+y1,x4+x1,y4+y1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

print(x3, y3, x4, y4)

Submission status: Accepted

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, sep=" ")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
ls = list(map(int,input().split()))

p =  [ls[2]-ls[0],ls[3]-ls[1]]

b = [-p[1],p[0]]
c = [-b[1],b[0]]

p3 = [ls[2]+b[0],ls[3]+b[1]]
p4 = [p3[0]+c[0],p3[1]+c[1]]
print(p3[0],p3[1],p4[0],p4[1])

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x,y,X,Y=map(int,input().split())
print(X-Y+y,Y+X-x,x-Y+y,y+X-x)

Submission status: Accepted

Solution code:
p,q,r,s = list(map(int,input().split()))
delta_x = r - p
delta_y = s - q
print(r - delta_y, s + delta_x, p - delta_y, q + delta_x)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
p = list(map(int, input().split()))
s, d = list(map(lambda x, y: x + y * 1j, p[::2], p[1::2]))

ans = ""
for _ in range(2):
  v = d - s
  s = d
  d = s + v * 1j
  ans += " {:.0f} {:.0f}".format(d.real, d.imag)
print(ans[1:])

Submission status: Accepted

Solution code:
import numpy as np
p = list(map(int, input().split()))
s, d = list(map(lambda x, y: np.array([x, y]), p[::2], p[1::2]))

ans = ""
for _ in range(2):
  v = d - s
  s = d
  d = s + v.dot([[0,1], [-1,0]])
  ans += " " + " ".join(map(str, d))
print(ans[1:])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import numpy as np

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

r = np.array([[0, -1], [1, 0]])
p1 = np.array([[x1, y1]])
p2 = np.array([[x2, y2]])
vec = p2 - p1
p4 = r.dot(vec.T).flatten() + p1
p3 = p4 + vec

x3, y3 = p3.flatten()
x4, y4 = p4.flatten()

print(x3, y3, x4, y4)

Submission status: Accepted

Solution code:
z = list(map(int, input().split()))

for i in range(2):
  z.append(z[2*i+2] - (z[2*i+3] - z[2*i+1]))
  z.append(z[2*i+3] + (z[2*i+2] - z[2*i]))
  
print(str(z[4]) + " " + str(z[5]) + " " + str(z[6]) + " " + str(z[7]))

Submission status: Accepted

Solution code:
x_1, y_1, x_2, y_2 = [int(xy) for xy in input().split()]
dx = x_2 - x_1
dy = y_2 - y_1

x_3 = x_2 - dy
y_3 = y_2 + dx
x_4 = x_1 - dy
y_4 = y_1 + dx

print(str(x_3) + " " + str(y_3) + " " + str(x_4) + " " + str(y_4))

Submission status: Accepted

Solution code:
p = list(map(int, input().split()))
ps = list(zip(p[::2], p[1::2]))

ans = ""
for _ in range(2):
  v = list(map(lambda x, y: x - y, ps[1], ps[0]))
  v = [-v[1], v[0]]
  ps = [ps[1], list(map(lambda x, y: x + y, ps[1], v))]
  ans += " " + " ".join(map(str, ps[1]))

print(ans[0:])

Submission status: Accepted

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

d = (-d[1], d[0])
x3, y3 = x2 + d[0], y2 + d[1]

d = (-d[1], d[0])
x4, y4 = x3 + d[0], y3 + d[1]

print(x3, y3, x4, y4)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys, os

f = lambda:list(map(int,input().split()))
if 'local' in os.environ :
    sys.stdin = open('./input.txt', 'r')

def solve():
    x1, y1, x2, y2 = f()
    
    x3 = x2 + (y1 - y2)
    y3 = y2 + (x2 -x1)
    

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


    print(x3, y3, x4, y4)


solve()

Submission status: Accepted

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

d = [x2-x1,y2-y1]

def rot90(x):
    return [-x[1], x[0]]
    
d23 = rot90(d)
d34 = rot90(d23)

x3 = x2+d23[0]
y3 = y2+d23[1]
x4 = x3+d34[0]
y4 = y3+d34[1]

print(x3,y3,x4,y4)

Submission status: Accepted

Solution code:

lst_1 = input().split()

x_1 = int(lst_1[0])
y_1 = int(lst_1[1])
x_2 = int(lst_1[2])
y_2 = int(lst_1[3])

x_3 = x_2 - (y_2 - y_1)
y_3 = y_2 + (x_2 - x_1)
x_4 = x_3 - (x_2 - x_1)
y_4 = y_3 - (y_2 - y_1)

print("{} {} {} {}".format(x_3, y_3, x_4, y_4))

Submission status: Accepted

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

Submission status: Accepted

Solution 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('{} {} {} {}'.format(x3,y3,x4,y4))

Submission status: Accepted

Solution code:
a, b, c, d = map(int, input().split())
x = c - a
y = d - b
print("{} {} {} {}".format(c - y, d + x, a - y, b + x))

Submission status: Accepted

Solution code:
x0, y0, x1, y1 = [int(x) for x in input().split()]
dx = x1 - x0
dy = y1 - y0
print(x1 - dy, y1 + dx, x0 - dy, y0 + dx)

Submission status: Accepted

Solution code:
x1, y1, x2, y2 = [ int(v) for v in 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: Accepted

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

x = abs(x1-x2)
y = abs(y1-y2)

if x1 >= x2 and y1 >= y2:
  x3 = x2 + y
  y3 = y2 - x
  x4 = x3 + x
  y4 = y3 + y
elif x1 <= x2 and y1 >= y2:
  x3 = x2 + y
  y3 = y2 + x
  x4 = x3 - x
  y4 = y3 + y
elif x1 <= x2 and y1 <= y2:
  x3 = x2 - y
  y3 = y2 + x
  x4 = x3 - x
  y4 = y3 - y
else:
  x3 = x2 - y
  y3 = y2 - x
  x4 = x3 + x
  y4 = y3 - y

print(x3,y3,x4,y4)

Submission status: Accepted

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

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

print(x3, y3, x4, y4)

Submission status: Accepted

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

Submission status: Accepted

Solution 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(x3,y3,x4,y4)

Submission status: Accepted

Solution 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(x3, y3, x4, y4)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(x3, y3, x4, y4)

Submission status: Accepted

Solution 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(str(x3) + " " + str(y3) + " " + str(x4) + " " + str(y4))

Submission status: Accepted

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

Submission status: Accepted

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

dx = x2 - x1
dy = y2 - y1

x3 = x2 - dy
y3 = y2 + dx

x4 = x1 - dy
y4 = y1 + dx

print(str(x3) + ' ' + str(y3) + ' ' + str(x4) + ' ' + str(y4))

Submission status: Accepted

Solution code:
x1,y1,x2,y2 = [ int(it) for it in input().split() ]

dx = x2-x1
dy = y2-y1

x,y=x2,y2
x,y=x-dy,y+dx
z,w=x-dx,y-dy
print (x,y,z,w)

Submission status: Accepted

Solution code:
x1,y1,x2,y2 = map(int,input().split())
MoveX,MoveY = x2 - x1,y2 - y1
x3,y3 = x2 - MoveY,y2 + MoveX
x4,y4 = x3 - MoveX,y3 - MoveY
print('{} {} {} {}'.format(x3,y3,x4,y4))

Submission status: Accepted

Solution code:
x1, y1, x2, y2 = map(int, raw_input().split())
dx = x2-x1
dy = y2-y1
x3 = x2-dy
y3 = y2+dx
x4 = x3-dx
y4 = y3-dy
print str(x3)+' '+str(y3)+' '+str(x4)+' '+str(y4)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys


def solve(x: "List[int]", y: "List[int]"):
    dx = x[1] - x[0]
    dy = y[1] - y[0]

    x3 = x[1] - dy
    y3 = y[1] + dx
    x4 = x[0] - dy
    y4 = y[0] + dx

    print(x3,y3,x4,y4)
    return


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    x = [int()] * (2)  # type: "List[int]" 
    y = [int()] * (2)  # type: "List[int]" 
    for i in range(2):
        x[i] = int(next(tokens))
        y[i] = int(next(tokens))
    solve(x, y)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
from sys import stdin
import numpy as np

A = np.array([int(x) for x in stdin.readline().rstrip().split()])
B = np.reshape(A, (2, 2))
vector = np.array(B[1] - B[0])
print(
    str((B[1] - np.array([vector[1], -vector[0]]))[0]) + ' ' + str((B[1] - np.array([vector[1], -vector[0]]))[1])
    + ' ' + str((B[0] - np.array([vector[1], -vector[0]]))[0]) + ' ' + str((B[0] - np.array([vector[1], -vector[0]]))[1])
)

Submission status: Accepted

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


x3, y3 = x2 - dy, y2 + dx
x4, y4 = x1 - dy, y1 + dx
x3, y3, x4, y4 = int(x3), int(y3), int(x4), int(y4)
print("{0} {1} {2} {3}".format( x3, y3, x4, y4))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
u,v,x,y = map(int,input().split())
[p,q] = [x-(y-v),y+(x-u)]
[r,s] = [p-(q-y),q+(p-x)]
print(p,q,r,s)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
B - Ruined Square
https://atcoder.jp/contests/abc108/tasks/abc108_b

"""
import sys


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


def main(args):
    x1, y1, x2, y2 = map(int, input().split())
    ans = solve(x1, y1, x2, y2)
    print(*ans)


if __name__ == '__main__':
    main(sys.argv[1:])

Submission status: Accepted

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

Submission status: Accepted

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

def calc_x3_y3():
    if (x2 - x1) >= 0 and (y2 - y1) >= 0:
        return [x2 - abs(y2 - y1), y2 + abs(x2 - x1)]
    elif (x2 - x1) >= 0:
        return [x2 + abs(y2 - y1), y2 + abs(x2 - x1)]
    elif (x2 - x1) < 0 and (y2 - y1) >= 0:
        return [x2 - abs(y2 - y1), y2 - abs(x2 - x1)]
    else:
        return [x2 + abs(y2 - y1), y2 - abs(x2 - x1)]

def cakc_x4_y4():
    if (x2 - x1) >= 0 and (y2 - y1) >= 0:
        return  [x1 - abs(y2 - y1), y1 + abs(x2 - x1)]
    elif (x2 - x1) >= 0:
        return  [x1 + abs(y2 - y1), y1 + abs(x2 - x1)]
    elif (x2 - x1) < 0 and (y2 - y1) >= 0:
        return  [x1 - abs(y2 - y1), y1 - abs(x2 - x1)]
    else:
        return  [x1 + abs(y2 - y1), y1 - abs(x2 - x1)]

print(calc_x3_y3()[0], calc_x3_y3()[1],  cakc_x4_y4()[0],  cakc_x4_y4()[1])

Submission status: Accepted

Solution code:
#B

x1,y1,x2,y2 = (int(num) for num in input().split())
v = [x2-x1,y2-y1]
v = [-v[1],v[0]]
x3,y3 = x2+v[0],y2+v[1]
v = [-v[1],v[0]]
x4,y4 = x3+v[0],y3+v[1]
print(x3,y3,x4,y4)

Submission status: Accepted

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

x=c-a
y=d-b

e=c-y
f=d+x
g=e-x
h=f-y

print(str(e)+' '+str(f)+' '+str(g)+' '+str(h))

Submission status: Accepted

Solution code:
import numpy as np

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

p1 = np.array([x1, y1])
p2 = np.array([x2, y2])

rotate = np.array([[0, 1], [-1, 0]])

p3 = p2 + np.dot((p2 - p1),rotate)
p4 = p3 + np.dot((p3 - p2),rotate)

print(p3[0], p3[1], p4[0], p4[1])

Submission status: Accepted

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

sax = x2 -x1
say = y2- y1

x3 = x2 - say
x4 = x3 - sax
y3 = y2 + sax
y4 = y3 - say

print(x3, y3, x4, y4)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, b,c,d = map(int, input().split()) 
x=c-a
y=d-b
x2=c-y
x2=str(x2)
y2=d+x
y2=str(y2)
x3=a-y
x3=str(x3)

y3=b+x
y3=str(y3)
print(x2+' '+y2+' '+x3+' '+y3)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import numpy as np

x1, y1, x2, y2 = map(int, input().split())
A = np.array([[0, -1], [1, 0]])
x = np.array([[x2 - x1], [y2 - y1]])
tmp = np.dot(A, x) + np.array([[x1], [y1]])
x4, y4 = tmp[0][0], tmp[1][0]

center = np.array([(x2 + x4)/2, (y2 + y4)/2])
tmp = np.array([x1, y1]) + 2 * (center - np.array([x1, y1]))
x3, y3 = int(tmp[0]), int(tmp[1])

print(x3, y3, x4, y4)

Submission status: Accepted

Solution code:
lst = list(map(int, input().split()))

vec_x = lst[2] - lst[0]
vec_y = lst[3] - lst[1]

x3 = lst[2] - vec_y
y3 = lst[3] + vec_x

x4 = x3 - vec_x
y4 = y3 - vec_y

print (x3, end =' ')
print (y3, end =' ')
print (x4, end =' ')
print (y4)

Submission status: Accepted

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

x_3 = x_2 + y_1 - y_2
y_3 = y_2 + x_2 - x_1
x_4 = x_3 + y_2 - y_3
y_4 = y_3 + x_3 - x_2

print(x_3,y_3,x_4,y_4)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    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)

if __name__=='__main__':
    main()

Submission status: Accepted

Solution code:
x1,x2,x3,x4 = map(int,input().split())

x5 = x2 - x4 + x3
x6 = x3 - x1 + x4
x7 = x2 - x4 + x1
x8 = x3 - x1 + x2

print(str(x5) + " " + str(x6) + " " + str(x7) + " "+ str(x8))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#ABC 108 B
x1, y1, x2, y2 = map(int, input().split())
x3 = x2 + y1-y2
y3 = y2 + x2-x1
x4 = x1 + y1-y2
y4 = y1 + x2-x1
print(" ".join(map(str, [x3, y3, x4, y4])))

Submission status: Accepted

Solution 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(str(x3)+' '+str(y3)+' '+str(x4)+' '+str(y4))

Submission status: Accepted

Solution code:
# coding: utf-8
from sys import stdin

x1,y1,x2,y2 = map(int,stdin.readline().rstrip().split())

def main():
    print("{} {} {} {}".format(x2 - y2 + y1, y2 + x2 - x1, x1 - y2 + y1, y1 + x2 - x1 ))
    
    
if __name__ == '__main__':
    main()

Submission status: Accepted

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

def vector(x1, y1, x2, y2):
    return x2 - (y2 - y1), y2 + (x2 - x1)

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

print(x3, y3, x4, y4)

Submission status: Accepted

Solution code:
x1, y1, x2, y2 = [int(i) for i in input().split()]
print(x2 +(y1-y2), y2 - (x1-x2), x1 + (y1-y2), y1 - (x1 - x2))

Submission status: Accepted

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

x12 = x2 - x1
y12 = y2 - y1

print(x2 - y12, y2 + x12, x1 - y12, y1 + x12)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
###############################################################################

from sys import stdout
from bisect import bisect_left as binl
from copy import copy, deepcopy


mod = 1


def intin():
    input_tuple = input().split()
    if len(input_tuple) <= 1:
        return int(input_tuple[0])
    return tuple(map(int, input_tuple))


def intina():
    return [int(i) for i in input().split()]


def intinl(count):
    return [intin() for _ in range(count)]


def modadd(x, y):
    global mod
    return (x + y) % mod


def modmlt(x, y):
    global mod
    return (x * y) % mod


def lcm(x, y):
    while y != 0:
        z = x % y
        x = y
        y = z
    return x


def combination(x, y):
    assert(x >= y)

    if y > x // 2:
        y = x - y

    ret = 1

    for i in range(0, y):
        j = x - i
        i = i + 1

        ret = ret * j
        ret = ret // i

    return ret


def get_divisors(x):
    retlist = []
    for i in range(1, int(x**0.5) + 3):
        if x % i == 0:
            retlist.append(i)
            retlist.append(x // i)
    return retlist


def get_factors(x):
    retlist = []
    for i in range(2, int(x**0.5) + 3):
        while x % i == 0:
            retlist.append(i)
            x = x // i
    retlist.append(x)
    return retlist


def make_linklist(xylist):
    linklist = {}
    for a, b in xylist:
        linklist.setdefault(a, [])
        linklist.setdefault(b, [])
        linklist[a].append(b)
        linklist[b].append(a)
    return linklist


def calc_longest_distance(linklist, v=1):
    distance_list = {}
    distance_count = 0
    distance = 0
    vlist_previous = []
    vlist = [v]
    nodecount = len(linklist)

    while distance_count < nodecount:
        vlist_next = []
        for v in vlist:
            distance_list[v] = distance
            distance_count += 1
            vlist_next.extend(linklist[v])
        distance += 1
        vlist_to_del = vlist_previous
        vlist_previous = vlist
        vlist = list(set(vlist_next) - set(vlist_to_del))

    max_distance = -1
    max_v = None
    for v, distance in distance_list.items():
        if distance > max_distance:
            max_distance = distance
            max_v = v

    return (max_distance, max_v)


def calc_tree_diameter(linklist, v=1):
    _, u = calc_longest_distance(linklist, v)
    distance, _ = calc_longest_distance(linklist, u)
    return distance


###############################################################################


def main():
    x1, y1, x2, y2 = intin()

    xdiff = x2 - x1
    ydiff = y2 - y1

    x3 = x2 - ydiff
    y3 = y2 + xdiff
    x4 = x3 - xdiff
    y4 = y3 - ydiff

    print(x3, y3, x4, y4)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

x = x_2-x_1
y = y_2-y_1
x_3, y_3 = x_2-y, y_2+x
x_4, y_4 = x_3-x, y_3-y
print(x_3, y_3, x_4, y_4)

Submission status: Accepted

Solution code:
import math
import sys
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(x3,y3,x4,y4)

Submission status: Accepted

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

v23 = (-(y2 - y1), x2 - x1)
x3 = x2 + v23[0]
y3 = y2 + v23[1]

v34 = (-(y3 - y2), x3 - x2)
x4 = x3 + v34[0]
y4 = y3 + v34[1]

print(x3, y3, x4, y4)

Submission status: Accepted

Solution code:
x1, y1, x2, y2 = map(int, input().split())
x3 = x2+y1-y2
y3 = y2+x2-x1
x4 = x1+y1-y2
y4 = y1+x2-x1
print("{0} {1} {2} {3}".format(x3,y3,x4,y4))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

vec = [x2-x1,y2-y1]

x3 = x2 - vec[1]
y3 = y2 + vec[0]
x4 = x3 - vec[0]
y4 = y3 - vec[1]

print(x3,y3,x4,y4)

Submission status: Accepted

Solution code:
import numpy as np
x1,y1,x2,y2=[int(a) for a in input().split()]
p1 = np.array([x1,y1])
p2 = np.array([x2,y2])
v1 = p2-p1
v2 = np.array([-v1[1],v1[0]])
p3 = p2+v2
p4 = p3+(-v1)
print(" ".join([str(v) for v in list(p3)+list(p4)]))

Submission status: Accepted

Solution code:
x1,y1,x2,y2 = map(int,input().split())
vec = [x2-x1,y2-y1]
to23 = [-1*vec[1],vec[0]]
to34 = [-1*vec[0],-1*vec[1]]

print(x2+to23[0],y2+to23[1],x2+to23[0]+to34[0],y2+to23[1]+to34[1])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A, B, C, D = map(int, input().split())

dx, dy = C - A, D - B

print(C - dy, D + dx, A - dy, B + dx)

Submission status: Accepted

Solution code:
a,b,c,d=map(int,input().split())
e=c+b-d
f=d+c-a
g=e+a-c
h=f+b-d

print(e,f,g,h)

Submission status: Accepted

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

y = y2 - y1
x = x2 - x1

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

Submission status: Accepted

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

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

print(x3,y3,x4,y4)

Submission status: Accepted

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

Submission status: Accepted

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

vx = x2 - x1
vy = y2 - y1

x3 = x2 - vy
y3 = y2 + vx

x4 = x3 - vx
y4 = y3 - vy

print(x3, y3, x4, y4)

Submission status: Accepted

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

x1 -= x2
y1 -= y2

c1 = complex(x1, y1)
c2 = c1 * (-1j)

print(int(c2.real+x2), int(c2.imag+y2), end = ' ')

c3 = c1 + c2
print(int(c3.real+x2), int(c3.imag+y2))

Submission status: Accepted

Solution code:
x,y,z,w=map(int,input().split())
def m(a,b):
  return [sum(a[i][j]*b[j]for j in range(2))for i in range(2)]
def a(a,b,s=None):
  if s:
    return [a[i]-b[i]for i in range(2)]
  else:
    return [a[i]+b[i]for i in range(2)]
r=[[0,-1],[1,0]]
p=a([z,w],[x,y],True)
f=m(r,p)
s=m(r,f)
print(*a([z,w],f),end=' ')
print(*a(a([z,w],f),s),end=' ')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python
import math
x1, y1, x2, y2 = map(int, input().split())

s = x2 - x1
t = y2 - y1

print(x2 - t, y2 + s, x1 - t, y1 + s)

Submission status: Accepted

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