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())
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:
#108
x1,y1,x2,y2=map(int,input().split())
vec_x,vec_y=x2-x1,y2-y1
print(x2-vec_y, y2+vec_x, x1-vec_y, y1+vec_x)

Submission status: Accepted

Solution code:
x1, y1, x2, y2 = [int(_) for _ in 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:
x1,y1,x2,y2 = map(int,input().split())


A=0

x3=x1+(x2-x1-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())
 
vector_x, vector_y = x2 - x1, y2 - y1
print(x2 - vector_y, y2 + vector_x, x1 - vector_y, y1 + vector_x)

Submission status: Accepted

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

Submission status: Accepted

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

vector_x, vector_y = x2 - x1, y2 - y1
print(x2 - vector_y, y2 + vector_x, x1 - vector_y, y1 + vector_x)

Submission status: Accepted

Solution code:
ls = raw_input().split()
l=[0,0,0,0]
l[0]=int(ls[0])
l[1]=int(ls[1])
l[2]=int(ls[2])
l[3]=int(ls[3])
ax=l[1]-l[3]
ay=l[2]-l[0]

x3=str(ax+l[2])
y3=str(ay+l[3])
x4=str(ax+l[0])
y4=str(ay+l[1])
ans=x3+" "+y3+" "+x4+" "+y4
print ans

Submission status: Accepted

Solution code:
x1, y1, x2, y2 = map(int, input().split())
x3, y3 = x1 + (x2 - x1 - y2 + y1), y1 + (x2 - x1 + y2 - y1)
x4, y4 = x1 - (y2 - y1), 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 = -x1+x2+y2
x4 = x1+y1-y2
y4 = -x1+x2+y1
print(x3,y3,x4,y4)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from math import *
x1,y1,x2,y2=map(int,input().split())
b=x2-x1
h=y2-y1

d=sqrt(h**2+b**2)

if(h==0):
    if(x2>x1):
        x3=x2
        y3=y2+d
        x4=x1
        y4=y1+d
    else:
        x3=x2
        y3=y2-d
        x4=x1
        y4=y1-d
    print(x3,round(y3),x4,round(y4))
else:
    ratio=b/h
    val1=sqrt((d**2)/(1+ratio**2))
    val2=sqrt(((d**2)*(ratio**2))/(1+ratio**2))
    if(x1<=x2 and y1<=y2):
        x3=x2-val1
        y3=y2+val2
        x4=x1-val1
        y4=y1+val2
    elif(x1>=x2 and y1<=y2):
        x3=x2-val1
        y3=y2-val2
        x4=x1-val1
        y4=y1-val2
    elif(x2<x1 and y2<y1):
        x3=x2+val1
        y3=y2-val2
        x4=x1+val1
        y4=y1-val2
    else:
        x3=x2+val1
        y3=y2+val2
        x4=x1+val1
        y4=y1+val2
    print(round(x3),round(y3),round(x4),round(y4))

Submission status: Accepted

Solution code:
ini=map(int, raw_input().split())

ans=[]

ans.append(ini[2]-(ini[3]-ini[1]))
ans.append(ini[3]+(ini[2]-ini[0]))
ans.append(ini[0]+ans[0]-ini[2])
ans.append(ini[1]+ans[1]-ini[3])
for i in ans:
    print i,

Submission status: Accepted

Solution code:
raw = input()

x1 = int(raw.split(' ')[0])
y1 = int(raw.split(' ')[1])
x2 = int(raw.split(' ')[2])
y2 = int(raw.split(' ')[3])

c = '0'
d = '0'

if x1 > x2:
    d1 = x1 - x2
    c = '1'
else:
    d1 = x2 - x1
 
if y1 > y2:
    d2 = y1 - y2
    d = '1'
else:
    d2 = y2 - y1
    
if c == '1':
    y3 = y2 - d1

    y4 = y1 - d1

else:
    y3 = y2 + d1

    y4 = y1 + d1

if d == '1':
    x3 = x2 + d2

    x4 = x1 + d2
else:
    x3 = x2 - d2
    
    x4 = x1 - d2

print(x3,y3,x4,y4)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x1, y1, x2, y2 = map(int, input().split())
diffX = x2 - x1
diffY = y2 - y1
x3 = 0
y3 = 0
x4 = 0
y4 = 0
if diffX >= 0 & diffY >= 0:
    x3 = x2 + diffY * -1
    y3 = y2 + diffX
    x4 = x3 + diffX * -1
    y4 = y3 + diffY * -1
elif diffX >= 0 & diffY <= 0:
    x3 = x2 + diffY * -1
    y3 = y2 + diffX
    x4 = x3 + diffX
    y4 = y3 + diffY
elif diffX <= 0 & diffY >= 0:
    x3 = x2 + diffY * -1
    y3 = y2 + diffX
    x4 = x3 + diffX * -1
    y4 = y3 + diffY * -1
elif diffX <= 0 & diffY <= 0:
    x3 = x2 + diffY
    y3 = y2 + diffX * -1
    x4 = x3 + diffX
    y4 = y3 + diffY
print(x3, y3, x4, y4)

Submission status: Accepted

Solution code:
from sys import stdin, stdout

input = lambda: stdin.readline()
write = stdout.write

def main():
    X1, Y1, X2, Y2 = map(int, input().split())

    l1 = abs(max(X1, X2) - min(X1, X2))
    l2 = abs(max(Y1, Y2) - min(Y1, Y2))
    if X1 <= X2 and Y1 <= Y2:
        x3 = X2 - l2
        y3 = Y2 + l1
        x4 = x3 - l1
        y4 = y3 - l2
    elif X1 > X2 and Y1 < Y2:
        x3 = X2 - l2
        y3 = Y2 - l1
        x4 = x3 + l1
        y4 = y3 - l2
    elif X1 >= X2 and Y1 >= Y2:
        x3 = X2 + l2
        y3 = Y2 - l1
        x4 = x3 + l1
        y4 = y3 + l2
    elif X1 < X2 and Y1 > Y2:
        x3 = X2 + l1
        y3 = Y2 + l2
        x4 = x3 - l2
        y4 = y3 + l1
    print(x3, y3, x4, y4)

main()

Submission status: Accepted

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

Submission status: Accepted

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

dx = x2 - x1
dy = y2 - y1

x3,y3,x4,y4 = [0,0,0,0]

if dx > 0 and dy > 0:
    x3 = x2 - abs(dy)
    y3 = y2 + abs(dx)
    x4 = x3 - abs(dx)
    y4 = y3 - abs(dy)
elif dx < 0 and dy > 0:
    x3 = x2 - abs(dy)
    y3 = y2 - abs(dx)
    x4 = x3 + abs(dx)
    y4 = y3 - abs(dy)
elif dx < 0 and dy < 0:
    x3 = x2 + abs(dy)
    y3 = y2 - abs(dx)
    x4 = x3 + abs(dx)
    y4 = y3 + abs(dy)
elif dx > 0 and dy < 0:
    x3 = x2 + abs(dy)
    y3 = y2 + abs(dx)
    x4 = x3 - abs(dx)
    y4 = y3 + abs(dy)
elif dx == 0:
    if dy > 0:
        x3 = x2 - abs(dy)
        y3 = y2
        x4 = x3
        y4 = y1
    else:
        x3 = x2 + abs(dy)
        y3 = y2
        x4 = x3
        y4 = y1
elif dy == 0:
    if dx > 0:
        x3 = x2
        y3 = y2 + abs(dx)
        x4 = x1
        y4 = y3
    else:
        x3 = x2
        y3 = y2 - abs(dx)
        x4 = x1
        y4 = x3
else:
    print("e")
    exit()

print(x3,y3,x4,y4)

Submission status: Accepted

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

ll = (x2-x1)**2 + (y2-y1)**2
if (x1>=x2):
    if (y1>=y2):
        l=x1-x2
        s=y1-y2
        x3=x2+s
        x4=x1+s
        y3=y2-l
        y4=y1-l
    else:
        l=y2-y1
        s=x1-x2
        x3=x2-l
        x4=x1-l
        y3=y2-s
        y4=y1-s
else:
    if (y1<=y2):
        l=x2-x1
        s=y2-y1
        x3=x2-s
        x4=x1-s
        y3=y2+l
        y4=y1+l
    else:
        l=y1-y2
        s=x2-x1
        x3=x2+l
        x4=x1+l
        y3=y2+s
        y4=y1+s
        


print(x3, y3, x4, y4)

Submission status: Accepted

Solution code:
# vim: set fileencoding=utf-8:


def main():
    x1, y1, x2, y2 = map(int, raw_input().split())
    if x1 <= x2 and y1 >= y2:
        a = abs(y1 - y2)
        b = abs(x1 - x2)
        y3 = y2 + b
        x3 = x2 + a
        y4 = y3 + a
        x4 = x3 - b
    elif x1 <= x2 and y1 <= y2:
        a = abs(x1 - x2)
        b = abs(y1 - y2)
        y3 = y2 + a
        x3 = x2 - b
        y4 = y3 - b
        x4 = x3 - a
    elif x1 >= x2 and y1 >= y2:
        b = abs(y1 - y2)
        a = abs(x1 - x2)
        y3 = y2 - a
        x3 = x2 + b
        y4 = y3 + b
        x4 = x3 + a
    elif x1 >= x2 and y1 <= y2:
        a = abs(y1 - y2)
        b = abs(x1 - x2)
        y3 = y2 - b
        x3 = x2 - a
        y4 = y3 - a
        x4 = x3 + b

    print("%s %s %s %s " % (x3, y3, x4, y4))


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import math
l = input().split()

x1 = int(l[0])
y1 = int(l[1])
x2 = int(l[2])
y2 = int(l[3])

yoko = x2-x1
tate = y2-y1

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

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

Submission status: Accepted

Solution code:
import numpy as np

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

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

vec1=np.array([x1,y1])
vec2=np.array([x2,y2])

vec2to1=vec1-vec2
vec2to3=np.dot(get_rotation_matrix(np.pi*3/2),vec2to1)

vec1to2=vec2-vec1
vec1to4=np.dot(get_rotation_matrix(np.pi/2),vec1to2)

vec3=vec2+vec2to3
vec4=vec1+vec1to4

print(
  int(round(vec3[0],0)),
  int(round(vec3[1],0)),
  int(round(vec4[0],0)),
  int(round(vec4[1],0)))

Submission status: Accepted

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

v = (x2-x1, y2-y1)
print('%d %d %d %d' % (x2-v[1], y2+v[0], x1-v[1], y1+v[0]))

Submission status: Accepted

Solution code:
def solve(x1, y1, x2, y2):

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

    return " ".join(str(i) for i in [x3, y3, x4, y4])

if __name__ == "__main__":
    l = input()
    x1, y1, x2, y2 = int(l.split()[0]),int(l.split()[1]), int(l.split()[2]), int(l.split()[3])
    print(solve(x1, y1, x2, y2))

Submission status: Accepted

Solution code:
import numpy as np
import math

line = input().split()
x1 = int(line[0])
y1 = int(line[1])
x2 = int(line[2])
y2 = int(line[3])

a = x2-x1
b = y2-y1
r = math.sqrt(a*a + b*b)


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

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

Submission status: Accepted

Solution code:
def next(x1,y1,x2,y2):
  xd = x2 - x1
  yd = y2 - y1
  nyd = xd
  nxd = -yd
  return [x2+nxd,y2+nyd]

x1,y1,x2,y2 = list(map(int,input().split()))
x3,y3 = next(x1,y1,x2,y2)
x4,y4 = next(x2,y2,x3,y3)
print(x3,y3,x4,y4)

Submission status: Accepted

Solution code:
x1, y1, x2, y2 = list(map(int, input().split()))
diff_x = x2 - x1
diff_y = y2 - y1
if diff_x > 0:
  if diff_y > 0:
    x3 = x2 - diff_y
    y3 = y2 + diff_x
    x4 = x3 - diff_x
    y4 = y3 - diff_y
  if diff_y == 0:
    x3 = x2
    y3 = y2 + diff_x
    x4 = x3
    y4 = y1
  if diff_y < 0:
    x3 = x2 - diff_y
    y3 = y2 + diff_x
    x4 = x3 - diff_x
    y4 = y3 - diff_y
if diff_x == 0:
    x3 = x2 - diff_y
    y3 = y2
    x4 = x3
    y4 = y1
if diff_x < 0:
  if diff_y > 0:
    x3 = x2 - diff_y
    y3 = y2 + diff_x
    x4 = x3 - diff_x
    y4 = y3 - diff_y
  if diff_y == 0:
    x3 = x2
    y3 = y2 + diff_x
    x4 = x1
    y4 = y3
  if diff_y < 0:
    x3 = x2 - diff_y
    y3 = y2 + diff_x
    x4 = x3 - diff_x
    y4 = y3 - diff_y
print("{} {} {} {}".format(x3, y3, x4, y4))

Submission status: Accepted

Solution code:
#! usr/bin/env python
# -*- coding: utf-8 -*-


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

    dx, dy = abs(x2-x1), abs(y2-y1)
    if x2 < x1:
        if y1 < y2:
            x3, y3 = x2 - dy, y2 - dx
            x4, y4 = x1 - dy, y1 - dx
        else:
            x3, y3 = x2 + dy, y2 - dx
            x4, y4 = x1 + dy, y1 - dx

    else:
        if y1 < y2:
            x3, y3 = x2 - dy, y2 + dx
            x4, y4 = x1 - dy, y1 + dx
        else:
            x3, y3 = x2 + dy, y2 + dx
            x4, y4 = x1 + dy, y1 + dx

    print(x3, y3, x4, y4)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

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

X = x2 - x1
Y = y2 - y1

if X > 0 and Y > 0:
    x3 = x2 - abs(Y)
    y3 = y2 + abs(X)
    x4 = x3 - abs(X)
    y4 = y3 - abs(Y)

elif X > 0 and Y < 0:
    x3 = x2 + abs(Y)
    y3 = y2 + abs(X)
    x4 = x3 - abs(X)
    y4 = y3 + abs(Y)
    
elif X < 0 and Y > 0:
    x3 = x2 - abs(Y)
    y3 = y2 - abs(X)
    x4 = x3 + abs(X)
    y4 = y3 - abs(Y)

elif X < 0 and Y < 0:
    x3 = x2 + abs(Y)
    y3 = y2 - abs(X)
    x4 = x3 + abs(X)
    y4 = y3 + abs(Y)

elif X > 0 and Y == 0:
    x3 = x2
    y3 = y2 + abs(X)
    x4 = x3 - abs(X)
    y4 = y3

elif X == 0 and Y > 0:
    x3 = x2 - abs(Y)
    y3 = y2
    x4 = x3
    y4 = y3 - abs(Y)

elif X < 0 and Y == 0:
    x3 = x2
    y3 = y2 - abs(X)
    x4 = x3 + abs(X)
    y4 = y3

elif X == 0 and Y < 0:
    x3 = x2 + abs(Y)
    y3 = y2
    x4 = x3
    y4 = y3 + abs(Y)

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

Submission status: Accepted

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

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

print(x3, y3, x4, y4)

Submission status: Accepted

Solution code:
def dis( x1,y1,x2,y2):

	dist = (x1-x2)**2 + (y1-y2)**2
	return dist;

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

if y1!=y2:

	if y1>y2:
		dire = 1;
	else:
		dire=-1;

	num = ( x1-x2 )
	den = ( y2 - y1 )

	L = x2;
	R = 99999999999999;
	flag=0;
	while ( R-L > 1):

		mid = ( L + R )//2;

		x3 = mid;
		y3 = ( num*( x3 - x2 ) + y2*den )//den;

		
		b = dis( x2,y2,x3,y3)

		if b==temp:
			flag=1;
			break;
		elif b > temp:
			R = mid-1;
		else:
			L = mid+1;
	
	if flag==0:
		mid = L;
		x3 = mid;
		y3 = ( num*( x3 - x2 ) + y2*den )//den;

		b = dis( x2,y2,x3,y3)

		if b==temp:
			x3 = L;
		else:
			x3 = R;
	#print(x3)
	#print(slope)
	y3 = ( num*( x3 - x2 ) + y2*den )//den;
	#print(y3)

	if dire == -1:

		x3 = x2 - ( x3-x2)
	y3 = ( num*( x3 - x2 ) + y2*den )//den;
	x4 = x1+x3-x2;
	y4 = y1+y3-y2;

	print( x3,y3,x4,y4);
else:

	x3 = x2;
	if x1>x2:
		dire=-1;
	else:
		dire=1;

	L = y2;
	R = 9999999999999;

	while ( R-L > 1):

		mid = ( L + R )//2;

		y3 = mid;

		b = dis( x2,y2,x3,y3)

		if b==temp:
			flag=1;
			break;
		elif b > temp:
			R = mid-1;
		else:
			L = mid+1;
	
	if flag==0:
		mid = L;
		y3 = mid;

		b = dis( x2,y2,x3,y3)

		if b==temp:
			y3 = L;
		else:
			y3 = R;

	if dire == -1:
		y3 = y2 - (y3-y2);
			
	x4 = x1+x3-x2;
	y4 = y1+y3-y2;

	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:
A, B, C, D = (int(i) for i in input().split())
if D > B and A > C:
    E = (C - (D - B))
    F = D - (A - C)
    G = (A - (D - B))
    H = B - (A - C)
    print(E, F, G, H)
elif A > C and B > D:
    E = C + (B - D)
    F = D - (A - C)
    G = A + (B - D)
    H = B - (A - C)
    print(E, F, G, H)
elif B > D and C > A:
    E = (C + (B - D))
    F = D + (C - A)
    G = (A + (B - D))
    H = B + (C - A)
    print(E, F, G, H)
else:
    E = C - (D - B)
    F = D + (C - A)
    G = A - (D - B)
    H = B + (C - A)
    print(E, F, G, H)

Submission status: Accepted

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

edge = [x2-x1, y2-y1]

if edge[0] >= 0  and edge[1] >= 0:
    x3, y3 = x2  - abs(edge[1]), y2 + abs(edge[0])
    x4, y4 = x3  - abs(edge[0]), y3 - abs(edge[1])
elif edge[0] >= 0 and edge[1] < 0:
    x3, y3 = x2  + abs(edge[1]), y2 + abs(edge[0])
    x4, y4 = x3  - abs(edge[0]), y3 + abs(edge[1])
elif edge[0] < 0 and edge[1] >=0:
    x3, y3 = x2  - abs(edge[1]), y2 - abs(edge[0])
    x4, y4 = x3  + abs(edge[0]), y3 - abs(edge[1])
else:
    x3, y3 = x2  + abs(edge[1]), y2 - abs(edge[0])
    x4, y4 = x3  + abs(edge[0]), y3 + abs(edge[1])
    
print(x3, y3, x4, y4)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

x1, y1, x2, y2 = map(int, input().split())
del_x = del_y = x3 = y3 = x4 = y4 = 0
del_x = abs(x1 - x2)
del_y = abs(y1 - y2)

if x1 > x2:
    if y1 > y2:
        x3 = x2 + del_y
        y3 = y2 - del_x
        x4 = x3 + del_x
        y4 = y3 + del_y
    else:
        x3 = x2 - del_y
        y3 = y2 - del_x
        x4 = x3 + del_x
        y4 = y3 - del_y
else:
    if y1 > y2:
        x3 = x2 + del_y
        y3 = y2 + del_x
        x4 = x3 - del_x
        y4 = y3 + del_y
    else:
        x3 = x2 - del_y
        y3 = y2 + del_x
        x4 = x3 - del_x
        y4 = y3 - del_y


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

Submission status: Accepted

Solution code:
import numpy as np

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

X1 = np.array([x1, y1])
X2 = np.array([x2, y2])

A = np.array([[0, -1], [1, 0]])
X3 = X2 + np.dot(A, X2 - X1)
X4 = X3 + np.dot(A, X3 - X2)

print(X3[0], X3[1], X4[0], X4[1])

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
 
def main():
	n = list(map(int, input().split()))
	x = abs(n[0] - n[2])
	y = abs(n[1] - n[3])
	if n[0] < n[2]:
		if n[1] < n[3]:
			print(n[2]-y,n[3]+x,n[0]-y,n[1]+x)
		else:
			print(n[2]+y,n[3]+x,n[0]+y,n[1]+x)
	else:
		if n[1] > n[3]:
			print(n[2]+y,n[3]-x,n[0]+y,n[1]-x)
		else:
			print(n[2]-y,n[3]-x,n[0]-y,n[1]-x)


if __name__ == '__main__':
	main()

Submission status: Accepted

Solution code:
#coding: utf-8

pos = [[0,0],[0,0],[0,0],[0,0]]

pos[0][0],pos[0][1],pos[1][0],pos[1][1] = map(int,raw_input().split())

vect = [pos[1][0] - pos[0][0], pos[1][1] - pos[0][1]]

vect_2 = [-vect[1], vect[0]]

pos[2] = [pos[1][0] + vect_2[0], pos[1][1] + vect_2[1]]
pos[3] = [pos[0][0] + vect_2[0], pos[0][1] + vect_2[1]]

print str(pos[2][0]) + " " + str(pos[2][1]) + " " + str(pos[3][0]) + " " + str(pos[3][1])

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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

x1 = p[0]
y1 = p[1]
x2 = p[2]
y2 = p[3]

X = int(x2 - x1)
Y = int(y2 - y1)

x3 = x2 - Y
y3 = y2 + X

x4 = x1 - Y
y4 = y1 + X

print(x3,y3,x4,y4)

Submission status: Accepted

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

Submission status: Accepted

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

xx = x2 - x1
yy = y2 - y1

x3 = x2 - yy
y3 = y2 + xx
x4 = x3 - xx
y4 = y3 - yy

print(x3, y3, x4, y4)

Submission status: Accepted

Solution code:
a = list(map(int, input().split()))
vec = [a[2] - a[0], a[3] - a[1]]
res = [0,0,0,0]
res[2] = a[0] - vec[1]
res[3] = a[1] + vec[0]

res[0] = res[2] + vec[0]
res[1] = res[3] + vec[1]

print(res[0], res[1], res[2], res[3])

Submission status: Accepted

Solution code:
xa,ya,xb,yb=map(int,input().split())
dx,dy=xa-xb,ya-yb
if dx>0:
	if dy>0:
		x3,y3=xb+dy,yb-dx
		x4,y4=xa+dy,ya-dx
	else:
		x3,y3=xb+dy,yb-dx
		x4,y4=xa+dy,ya-dx
else:
	if dy>0:
		x3,y3=xb+dy,yb-dx
		x4,y4=xa+dy,ya-dx
	else:
		x3,y3=xb+dy,yb-dx
		x4,y4=xa+dy,ya-dx


print('{0} {1} {2} {3}'.format(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_4 = -Y + x_1
y_4 = X + y_1

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

print(x_3,y_3,x_4,y_4)

Submission status: Accepted

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

Submission status: Accepted

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

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

r1 = np.array([x2-x1, y2-y1])
r2 = np.dot(R, r1)
x3, y3 = r2 + np.array([x2, y2])
r3 = np.dot(R, r2)
x4, y4 = r3 + np.array([x3, y3])

print(x3, y3, x4, y4)

Submission status: Accepted

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

if xy[2] - xy[0] == 0:
    if xy[3] > xy[1]:
        x3 = xy[2] - (xy[3]-xy[1])
        y3 = xy[3] - (xy[2]-xy[0])
        x4 = xy[0] - (xy[3]-xy[1])
        y4 = xy[1] - (xy[2]-xy[0])
    else:
        x3 = xy[2] + (xy[1]-xy[3])
        y3 = xy[3] - (xy[0]-xy[2])
        x4 = xy[0] + (xy[1]-xy[3])
        y4 = xy[1] - (xy[0]-xy[2])
else:
    if xy[2] > xy[0]:
        x3 = xy[2] + (xy[1]-xy[3])
        y3 = xy[3] + (xy[2]-xy[0])
        x4 = xy[0] + (xy[1]-xy[3])
        y4 = xy[1] + (xy[2]-xy[0])
    else:
        x3 = xy[2] - (xy[3]-xy[1])
        y3 = xy[3] + (xy[2]-xy[0])
        x4 = xy[0] - (xy[3]-xy[1])
        y4 = xy[1] + (xy[2]-xy[0])

print(x3,y3,x4,y4)

Submission status: Accepted

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

h=[x2-x1,y2-y1]

print(x2-h[1],y2+h[0],x1-h[1],y1+h[0])

Submission status: Accepted

Solution code:
inputto = input().split()
x1 = int(inputto[0])
y1 = int(inputto[1])
x2 = int(inputto[2])
y2 = int(inputto[3])
x3=str(x2-(y2-y1))
y3=str(y2-(x1-x2))
x4=str(int(x3)+(x1-x2))
y4=str(int(y3)-(y2-y1))
print(x3+" "+y3+" "+x4+" "+y4)

Submission status: Accepted

Solution code:
#B
x1,y1,x2,y2=map(int,input().split())
X1=[x1,y1]
d=[x2-x1,y2-y1]
dT=[-d[1],d[0]]
P3,P4=X1+dT,X1+dT+d
x3=x1+dT[0]+d[0]
y3=y1+dT[1]+d[1]
x4=x1+dT[0]
y4=y1+dT[1]
print(x3,y3,x4,y4)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x1, y1, x2, y2 = map(int, raw_input().split())
vx = - x1 + x2
vy = - y1 + y2
ux = - vy
uy = vx
x3 = x2 + ux
y3 = y2 + uy
x4 = x3 - vx
y4 = y3 - vy

print x3, y3, x4, y4

Submission status: Accepted

Solution code:
# -*-coding:utf-8-*-
x1, y1, x2, y2 = map(int, input().split(" "))

xdiff = x2-x1
ydiff = y2-y1

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

ans = str(x3) + " " + str(y3) + " " + str(x4) + " " + str(y4) 
print(ans)

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

Submission status: Accepted

Solution code:
x1,y1,x2,y2 = (int(i) for i in input().split())
if (x2-x1) > 0 and (y2-y1) >=0 :
    x3 = x2 - abs((y2 - y1))
    y3 = y2 + abs((x2 - x1))
    x4 = x3 - abs((y3 - y2))
    y4 = y3 - abs((x3 - x2))
    print(x3,y3,x4,y4)


elif (x2-x1) <= 0 and (y2-y1) >=0 :
    x3 = x2 - abs((y2 - y1))
    y3 = y2 - abs((x2 - x1))
    x4 = x3 + abs((y3 - y2))
    y4 = y3 - abs((x3 - x2))
    print(x3,y3,x4,y4)

elif (x2-x1) <= 0 and (y2-y1) < 0 :
    x3 = x2 + abs((y2 - y1))
    y3 = y2 - abs((x2 - x1))
    x4 = x3 + abs((y3 - y2))
    y4 = y3 + abs((x3 - x2))
    print(x3,y3,x4,y4)


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

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=x3-x
y4=y3-y
print(str(x3) + ' ' + str(y3) + ' ' + str(x4)  + ' ' + str(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())

def solve1(a,b,x,y):
    return -y + b + a, x - a + b

def solve2(a,b,x,y):    
    return y - b + a, -x + a + b

x3,y3 = solve2(x2,y2,x1,y1)
x4,y4 = solve1(x1,y1,x2,y2)
print(x3,y3,x4,y4)

Submission status: Accepted

Solution code:
x1,y1,x2,y2 = [int(i) for i 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:
xy = list(map(int,input().split() ))
vx12 = xy[2] - xy[0]
vy12 = xy[3] - xy[1]
vx3 = (-1)*vy12
vy3 = vx12
vx4 = (-1)*vy3
vy4 = vx3
print(xy[2]+vx3,xy[3]+vy3,xy[2]+vx3+vx4,xy[3]+vy3+vy4)

Submission status: Accepted

Solution code:
import numpy as np
listA=list(map(int,input().split()))
x1=listA[0]
y1=listA[1]
x2=listA[2]
y2=listA[3]
A=np.array([x1,y1])
B=np.array([x2,y2])
C=B+np.dot(B-A,np.array([[0,1],[-1,0]]))
D=C+np.dot(C-B,np.array([[0,1],[-1,0]]))
print(C[0],C[1],D[0],D[1])

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
import numpy as np
a = [int(i) for i in input().split()]
x_1 = np.array(a[:2])
x_2 = np.array(a[2:])
v_1 = x_2-x_1
v_2 = np.array([-v_1[1],v_1[0]])
print(*np.concatenate((x_2+v_2,x_1+v_2), axis=None))

Submission status: Accepted

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

c1 = x1 + y1 * 1j
c2 = x2 + y2 * 1j

c3 = (c1 - c2) * -1j + c2
c4 = (c2 -c3) * -1j + c3
print(int(c3.real),int(c3.imag),int(c4.real),int(c4.imag))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
x1,y1,x2,y2 = map(int, input().split())

sx = x2 - x1
sy = y2 - y1

x3 = x2 - sy
y3 = y2 + sx
x4 = x3 - sx
y4 = y3 - sy

print(x3,y3,x4,y4)

Submission status: Accepted

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

dx = x2-x1
dy = y2-y1
#print('{} {}'.format(dx, dy))	# フォーマット付き

x3 = x2 - dy
y3 = y2 + dx

x4 = x3 - dx
y4 = y3 - dy

print('{} {} {} {}'.format(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)

Submission status: Accepted

Solution code:
import numpy as np


def run(p1, p4):
    v = p4 - p1
    A = np.array([[v[0], v[1]], [v[1], -v[0]]])
    b = np.array([0, np.dot(v, v)])
    x = np.dot(np.linalg.inv(A), b)
    return x + p1


l = list(map(int, input().split()))
p1 = np.array([l[0], l[1]])
p2 = np.array([l[2], l[3]])

p3 = run(p2, p1).astype(np.int64)
p4 = run(p3, p2).astype(np.int64)

print("{} {} {} {}".format(p3[0], p3[1], p4[0], p4[1]))

Submission status: Accepted

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

d1 = x2 - x1
d2 = y2 - y1

x3 = x2 - d2
y3 = y2 + d1

x4 = x3 - d1
y4 = y3 - d2

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

def next_point(x1, y1, x2, y2):
    dx = x2 - x1
    dy = y2 - y1
    return x2 - dy, y2 + dx

def restore(x1, y1, x2, y2):
    x3, y3 = next_point(x1, y1, x2, y2)
    x4, y4 = next_point(x2, y2, x3, y3)
    return x3, y3, x4, y4

def main():
    x1, y1, x2, y2 = map(int, input().split())
    x3, y3, x4, y4 = restore(x1, y1, x2, y2)
    print(x3, y3, x4, y4)

main()

Submission status: Accepted

Solution code:
import math
x1, y1, x2, y2 = [int(i) for i in input().split()]
if x1 >= x2 and y1 <= y2:
    x3 = x2 - abs(y1 - y2)
    x4 = x1 - abs(y1 - y2)
    y3 = y2 - abs(x1 - x2)
    y4 = y1 - abs(x1 - x2)
elif x1 <= x2 and y1 <= y2:
    x3 = x2 - abs(y1 - y2)
    x4 = x1 - abs(y1 - y2)
    y3 = y2 + abs(x1 - x2)
    y4 = y1 + abs(x1 - x2)
elif x1 >= x2 and y1 >= y2:
    x3 = x2 + abs(y1 - y2)
    x4 = x1 + abs(y1 - y2)
    y3 = y2 - abs(x1 - x2)
    y4 = y1 - abs(x1 - x2)
elif x1 <= x2 and y1 >= y2:
    x3 = x2 + abs(y1 - y2)
    x4 = x1 + abs(y1 - y2)
    y3 = y2 + abs(x1 - x2)
    y4 = y1 + abs(x1 - x2)
print(x3, y3, x4, y4)

Submission status: Accepted

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

  dx = abs(x2 - x1)
  dy = abs(y2 - y1)
  x3, y3, x4, y4 = 0, 0, 0, 0

  if (x1 <= x2) and (y1 <= y2):
    x3, y3 = x2 - dy, y2 + dx
    x4, y4 = x1 - dy, y1 + dx
  elif (x1 <= x2) and (y1 >= y2):
    x3, y3 = x2 + dy, y2 + dx
    x4, y4 = x1 + dy, y1 + dx

  elif (x1 >= x2) and (y1 <= y2):
    x3, y3 = x2 - dy, y2 - dx
    x4, y4 = x1 - dy, y1 - dx

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

solve()