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:
#!/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_y
        y4 = y3 + del_x
    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: Wrong Answer

Solution code:
def next(x1, y1, x2, y2):
  xd = x2 - x1
  yd = y2 - y1
  nyd = xd
  if xd > 0:
    nxd = -1*yd if yd > 0 else yd 
  else:
    nxd = -1*yd
#  print(xd,yd,nxd,nyd)
  x3 = x2 + nxd
  y3 = y2 + nyd
  return [x3,y3]

x1, y1, x2, y2 = list(map(int,input().split()))
p3 = next(x1,y1,x2,y2)
p4 = next(x2,y2,p3[0],p3[1])
print(p3[0],p3[1],p4[0],p4[1])

Submission status: Wrong Answer

Solution code:
def next(x1, y1, x2, y2):
  xd = x2 - x1
  yd = y2 - y1
  nyd = xd
  if xd > 0:
    nxd = -1*yd if yd > 0 else yd 
  else:
    nxd = -1*yd
  print(xd,yd,nxd,nyd)
  x3 = x2 + nxd
  y3 = y2 + nyd
  return [x3,y3]

x1, y1, x2, y2 = list(map(int,input().split()))
p3 = next(x1,y1,x2,y2)
p4 = next(x2,y2,p3[0],p3[1])
print(p3[0],p3[1],p4[0],p4[1])

Submission status: Wrong Answer

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 x1 < x2:
        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: Wrong Answer

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

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

print(x3, y3, x4, y4)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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


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


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

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

Submission status: Wrong Answer

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

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

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

print(x3, y3, x4, y4)

Submission status: Wrong Answer

Solution code:
A, B, C, D = (int(i) for i in input().split())
if D > B:
    E = (C - (D - B))
    F = D
    G = (A - (D - B))
    H = B
    print(E, F, G, H)
elif A > C:
    E = C
    F = D - (A - C)
    G = A
    H = B - (A - C)
    print(E, F, G, H)
elif B > D:
    E = (C + (B - D))
    F = D
    G = (A + (B - D))
    H = B
    print(E, F, G, H)
elif C > A:
    E = C
    F = D + (C - A)
    G = A
    H = B + (C - A)
    print(E, F, G, H)

Submission status: Wrong Answer

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

sx = x2 - x1
sy = y2 - y1

if sx > 0:
    if sy > 0:
        x3 = x2 - sy
        y3 = y2 + sx
        x4 = x3 - sx
        y4 = y3 - sy
    else:
        x3 = x2 + sy
        y3 = y2 + sx
        x4 = x3 - sx
        y4 = y3 + sy
else:
    if sy > 0:
        x3 = x2 - sy
        y3 = y2 + sx
        x4 = x3 - sx
        y4 = y3 - sy
    else:
        x3 = x2 - sy
        y3 = y2 + sx
        x4 = x3 - sx
        y4 = y3 - sy


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(x2 - x1)
    x4 = x1 - abs(y2 - y1)
    y4 = y1 + abs(x2 - x1)

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

print(x3, y3, x4, y4)

Submission status: Wrong Answer

Solution code:
import math

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

d = math.sqrt((x1-x2)**2+(y1-y2)**2)

x3 = 0
y3 = 0
x4 = 0
y4 = 0

#x3,y3の判定
for i in range(-100,100):      #x
  for j in range(-100,100):    #y
    d3 = math.sqrt((x2-i)**2+(y2-j)**2)
    ang3 = math.atan2(y2-j,x2-i)
    if d3 == d and ang3 == math.pi/2:
      x3 = i
      y3 = j
      
for i in range(-100,100):      #x
  for j in range(-100,100):    #y
    d3 = math.sqrt((x1-i)**2+(y1-j)**2)
    ang3 = math.atan2(y1-j,x1-i)
    if d3 == d and ang3 == math.pi/2:
      x4 = i
      y4 = j
    
print(x3,y3,x4,y4)

Submission status: Wrong Answer

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


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


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

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

Submission status: Wrong Answer

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: Wrong Answer

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

sx = x2 - x1
sy = y2 - y1

if sx > 0:
    if sy > 0:
        x3 = x2 - sy
        y3 = y2 + sx
        x4 = x3 - sx
        y4 = y3 - sy
    else:
        x3 = x2 + sy
        y3 = y2 + sx
        x4 = x3 - sx
        y4 = y3 + sy
else:
    if sy > 0:
        x3 = x2 - sy
        y3 = y2 + sx
        x4 = x3 - sx
        y4 = y3 - sy
    else:
        x3 = x2 + sy
        y3 = y2 + sx
        x4 = x3 - sx
        y4 = y3 + sy


print(x3,y3,x4,y4)

Submission status: Wrong Answer

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 = x1 - x2
    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: Wrong Answer

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

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

if x1 > x2 and y1 > y2:
    x3 = x2 + dy
    y3 = y2 - dx
    x4 = x3 + dx
    y4 = y3 + dy
elif x1 > x2 and y1 < y2:
    x3 = x2 - dy
    y3 = y2 - dx
    x4 = x3 + dx
    y4 = y3 - dy
elif x1 < x2 and y1 > y2:
    x3 = x2 + dy
    y3 = y2 + dx
    x4 = x3 - dx
    y4 = y3 + dy
else:
    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 = map(int, input().split())

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

if x1 > x2 and y1 > y2:
    x3 = x2 - dy
    y3 = y2 + dx
    x4 = x3 + dx
    y4 = y3 + dy
elif x1 > x2 and y1 < y2:
    x3 = x2 - dy
    y3 = y2 - dx
    x4 = x3 + dx
    y4 = y3 - dy
elif x1 < x2 and y1 > y2:
    x3 = x2 + dy
    y3 = y2 + dx
    x4 = x3 - dx
    y4 = y3 + dy
else:
    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()))

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 = x1 - x2
    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: Wrong Answer

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 = x1 - x2
    suby = y1 - y2
    x3 = x2 + suby
    y3 = y2 + subx
    x4 = x2 - subx
    y4 = y2 + + 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: Wrong Answer

Solution code:
zahyou=input().rstrip().split(" ")
x1 = int(zahyou[0])
y1 = int(zahyou[1])
x2 = int(zahyou[2])
y2 = int(zahyou[3])
if(x1==x2):
    ippen=abs(y1-y2)
    kotae=[x1-ippen,y2,x1-ippen,y1]
    print(kotae)
else:
    ippen=abs(x1-x2)
    kotae=[x2,y2-ippen,x1,y2-ippen]
    print(kotae)

Submission status: Wrong Answer

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

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

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

print(x3, y3, x4, y4)

Submission status: Wrong Answer

Solution code:
l = input().split(" ")
p = [int(l[0]),int(l[1])]
q = [int(l[2]),int(l[3])]
r = [0,0]
s = [0,0]

if p[1]==q[1]: 
    m = q[0]-p[0]
    r[0]=q[0]
    r[1]=q[1]+m
    s[0]=p[0]
    s[1]=p[1]+m
else:
    m = q[1]-p[1]
    r[0] = q[0]-m
    r[1] = q[1]
    s[0] = p[0]-m
    s[1] = p[1]
print(str(r[0])+" "+str(r[1])+" "+str(s[0])+" "+str(s[1]))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
zahyou=input().rstrip().split(" ")
x1 = int(zahyou[0])
y1 = int(zahyou[1])
x2 = int(zahyou[2])
y2 = int(zahyou[3])
if(x1==x2 and y2>y1):
    ippen=y2-y1
    kotae=[x1-ippen,y2,x1-ippen,y1]
elif(y1==y2 and x2<x1):
    ippen=x1-x2
    kotae=[x2,y2-ippen,x1,y2-ippen]
elif(x1==x2 and y1>y2):
    ippen=y1-y2
    kotae=[x2+ippen,y2,x1+ippen,y1]
else:
    ippen=x2-x1
    kotae=[x2,y2+ippen,x1,y1+ippen]
    
print(kotae)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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:

	slope = ( x1-x2 )/( y1 - y2 )

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

		mid = ( L + R )//2;

		x3 = mid;
		y3 = slope*( x3 - x2 ) + y2;

		
		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 = slope*( x3 - x2 ) + y2;

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

		if b==temp:
			x3 = L;
		else:
			x3 = R;
	y3 = int(slope*( x3 - x2 ) + y2);

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

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

	x3 = x2;

	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;

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

	print( x3,y3,x4,y4);

Submission status: Wrong Answer

Solution code:
import sys, math
from sys import stdin, stdout
rem = 10 ** 9 + 7
sys.setrecursionlimit(10 ** 6+5)
#from resource import *; setrlimit(RLIMIT_STACK, (RLIM_INFINITY, RLIM_INFINITY))
take = lambda: map(int, stdin.readline().strip().split())
from bisect import bisect_left,bisect_right

x1,y1,x2,y2=take()

if x1==x2:
    diff=y1-y2
    print x2+diff,y2,x1+diff,y1
else:
    diff=x1-x2
    print x2,y2-diff,x1,y1-diff

Submission status: Wrong Answer

Solution code:
a = list(map(int, input().split(" ")))
print(a)

p1 = (a[0], a[1])
p2 = (a[2], a[3])

dif = (p2[0]-p1[0], p2[1]-p1[1])

p3 = (p2[0]-dif[1], p2[1]+dif[0])
p4 = (p3[0]-dif[0], p3[1]-dif[1])

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

Submission status: Wrong Answer

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

tmpx = x2 - x1
tmpy = y2 - y1

if tmpx >= 0 and tmpy >= 0:
    x3 = x2 - tmpy
    y3 = y2 + tmpx
    x4 = x3 - tmpx
    y4 = y3 - tmpy
elif tmpx <= 0 and tmpy >= 0:
    x3 = x2 - tmpy
    y3 = y2 + tmpx
    x4 = x3 - tmpx
    y4 = y3 - tmpy
elif tmpx <= 0 and tmpy <= 0:
    x3 = x2 - tmpx
    y3 = y2 + tmpy
    x4 = x3 - tmpx
    y4 = y3 - tmpy
elif tmpx >= 0 and tmpy <= 0:
    x3 = x2 - tmpx
    y3 = y2 + tmpy
    x4 = x3 - tmpx
    y4 = y3 - tmpy

print(x3, y3, x4, y4)

Submission status: Wrong Answer

Solution code:
def next(x1, y1, x2, y2):
  xd = x2 - x1
  yd = y2 - y1
  if xd >= 0:
    nyd = xd
    nxd = yd if yd < 0 else -1*yd
  else:
    nyd = xd
    nxd = yd if yd < 0 else -1*yd
  x3 = x2 + nxd
  y3 = y2 + nyd
  return [x3,y3]

x1, y1, x2, y2 = list(map(int,input().split()))
p3 = next(x1,y1,x2,y2)
p4 = next(x2,y2,p3[0],p3[1])
print(p3[0],p3[1],p4[0],p4[1])

Submission status: Wrong Answer

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: Wrong Answer

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

for i in range(4):
    print pos[i]
print str(pos[2][0]) + " " + str(pos[2][1]) + " " + str(pos[3][0]) + " " + str(pos[3][1])

Submission status: Wrong Answer

Solution code:
l = input().split(" ")
p = [int(l[0]),int(l[1])]
q = [int(l[2]),int(l[3])]
r = [0,0]
s = [0,0]

if p[0]==q[0]:
    m = q[1]-p[1]
    r[0]=q[0]-m
    r[1]=q[1]
    s[0]=p[0]-m
    s[1]=p[1]
else:
    m = q[0]-p[0]
    r[0] = q[0]
    r[1] = q[1]+m
    s[0] = p[0]
    s[1] = p[1]+m
print(str(r[0])+" "+str(r[1])+" "+str(s[0])+" "+str(s[1]))

Submission status: Wrong Answer

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: Wrong Answer

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

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

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

a = max(abs(x1-x2), abs(y1-y2))

if x1 < x2:
  x3 = x2
  y3 = y1 + a
  x4 = x1
  y4 = y1 + a
elif x1 == x2:
  if y1 > y2:
    x3 = x2 + a
    y3 = y2
    x4 = x2 + a
    y4 = y1
  else:
    x3 = x2 - a
    y3 = y2
    x4 = x2 - a
    y4 = y1
elif x1 > x2:
  x3 = x2
  y3 = y1 - a
  x4 = x1
  y4 = y1 - a
  
print(str(x3)+' '+str(y3)+' '+str(x4)+' '+str(y4))

Submission status: Wrong Answer

Solution code:
import math
x1, y1, x2, y2 = [int(i) for i in input().split()]
if x1 >= x2:
    x3 = x2 - abs(y1 - y2)
    x4 = x1 - abs(y1 - y2)
    y3 = y2 - abs(x1 - x2)
    y4 = y1 - abs(x1 - x2)
elif x1 < x2:
    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: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
u,v,w,z=map(int,input().split())

a=w-(z-v)
b=z+w-u
c=u-(z-v)
d=w+w-u

print(a,end="")
print(b,end="")
print(c,end="")
print(d)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

a_y=abs(y2-y1)
a_x=abs(x2-x1)
if x2==x1:
    y3=y2+a_x
    x3=x2-a_y
    x4=x3-a_x
    y4=y3-a_y
elif (y2-y1)/(x2-x1)>=0:
    y3=y2+a_x
    x3=x2-a_y
    x4=x3-a_x
    y4=y3-a_y
else:
    y3=y2-a_x
    x3=x2-a_y
    x4=x3+a_x
    y4=y3-a_y
print(x3, y3, x4, y4)

Submission status: Wrong Answer

Solution code:
def abc108_b():
    import sys
    input = sys.stdin.readline

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

    if x1 > x2:
        return "{} {} {} {}".format(x2, y2 - (x1 - x2), x1, y1 - (x1 - x2))
    elif x1 < x2:
        return "{} {} {} {}".format(x2, y2 + (x2 - x1), x1, y1 + (x2 - x1))
    elif y1 > y2:
        return "{} {} {} {}".format(x2 + (y1 - y2), y2, x1 + (y1 - y2), y1)
    else:
        return "{} {} {} {}".format(x2 - (y2 - y1), y2, x1 - (y2 - y1), y1)


print(abc108_b())

Submission status: Wrong Answer

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

Submission status: Time Limit Exceeded

Solution code:
x1, y1, x2, y2 = map(int, input().split())
k = (x2-x1)**2+(y2-y1)**2
for i in range(-100, 101):
    for j in range(-100, 101):
        for p in range(-100, 101):
            for q in range(-100, 101):
                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()

Submission status: Time Limit Exceeded

Solution code:
import math
x1,y1,x2,y2=map(int,input().split())
base = math.sqrt((x1-x2)**2+(y1-y2)**2)
result1=[]
result2=[]
flag=0
#x3,y3を算出する
for x3 in range(-1000,1001):
    if flag==1:break
    for y3 in range(-1000,1001):
        base_2=math.sqrt((x3-x2)**2+(y3-y2)**2)
        base_1=math.sqrt((x3-x1)**2+(y3-y1)**2)
        if base_2==base and base_1==math.sqrt(2)*base:
            result1.append(x3)
            result1.append(y3)
            flag=1
            break
x3,y3=map(int,[k for k in result1])
p,q=(x1+x3)/2,(y1+y3)/2
x4=2*p-x2
y4=2*q-y2
print(x3,y3,x4,y4)

Submission status: Time Limit Exceeded

Solution code:
import math

def length(x1, y1, x2, y2):
    l = math.sqrt((x2 - x1) ** 2 + (y2 - y1) ** 2)
    return l

p = map(int, raw_input().split())
p1 = list(p)[:2]
p2 = list(p)[2:]
l = length(p1[0], p1[1], p2[0], p2[1])

if p1[0] == p2[0]:
    if p1[1] < p2[1]:
        print("%d %d %d %d" % (p2[0]-l, p2[1], p1[0]-l, p1[1]))
    else:
        print("%d %d %d %d" % (p2[0]+l, p2[1], p1[0]+l, p1[1]))
elif p1[1] == p2[1]:
    if p1[1] < p2[1]:
        print("%d %d %d %d" % (p2[0], p2[1]+l, p1[0], p1[1]+l))
    else:
        print("%d %d %d %d" % (p2[0], p2[1]-l, p1[0], p1[1]-l))
else:
    a =  float(p2[1] - p1[1]) / (p2[0] - p1[0])
    b = float(p1[1] * p2[1] - p1[0] * p2[1]) / (p2[0] - p1[0])

    p3 = []
    for x in range(-800, 800):
        for y in range(-800, 800):
            if p1[0] < p2[0]:
                if a * x + b < y:
                    if length(x, y, p1[0], p1[1]) == l * math.sqrt(2) and length(x,y,p2[0],p2[1]) == l:
                        p3 = [x, y]
            else:
                if a * x + b > y:
                    if length(x, y, p1[0], p1[1]) == l * math.sqrt(2) and length(x,y,p2[0],p2[1]) == l:
                        p3 = [x, y]
    p4 = []
    for x in range(-800, 800):
        for y in range(-800, 800):
            if p1[0] < p2[0]:
                if a * x + b < y:
                    if length(x, y, p1[0], p1[1]) == l and length(x,y,p2[0],p2[1]) == l * math.sqrt(2):
                        p4 = [x, y]
            else:
                if a * x + b > y:
                    if length(x, y, p1[0], p1[1]) == l and length(x,y,p2[0],p2[1]) == l * math.sqrt(2):
                        p4 = [x, y]

    print("%d %d %d %d" % (p3[0], p3[1], p4[0], p4[1]))

Submission status: Time Limit Exceeded

Solution code:
import math

def length(x1, y1, x2, y2):
    l = math.sqrt((x2 - x1) ** 2 + (y2 - y1) ** 2)
    return l

p = map(int, raw_input().split())
p1 = list(p)[:2]
p2 = list(p)[2:]
l = length(p1[0], p1[1], p2[0], p2[1])

if p1[0] == p2[0]:
    if p1[1] < p2[1]:
        print("%d %d %d %d" % (p2[0]-l, p2[1], p1[0]-l, p1[1]))
    else:
        print("%d %d %d %d" % (p2[0]+l, p2[1], p1[0]+l, p1[1]))
elif p1[1] == p2[1]:
    if p1[1] < p2[1]:
        print("%d %d %d %d" % (p2[0], p2[1]+l, p1[0], p1[1]+l))
    else:
        print("%d %d %d %d" % (p2[0], p2[1]-l, p1[0], p1[1]-l))
else:
    a =  float(p2[1] - p1[1]) / (p2[0] - p1[0])
    b = float(p1[1] * p2[1] - p1[0] * p2[1]) / (p2[0] - p1[0])

    p3 = []
    for x in range(-1000, 1000):
        for y in range(-1000, 1000):
            if p1[0] < p2[0]:
                if a * x + b < y:
                    if length(x, y, p1[0], p1[1]) == l * math.sqrt(2) and length(x,y,p2[0],p2[1]) == l:
                        p3 = [x, y]
            else:
                if a * x + b > y:
                    if length(x, y, p1[0], p1[1]) == l * math.sqrt(2) and length(x,y,p2[0],p2[1]) == l:
                        p3 = [x, y]
    p4 = []
    for x in range(-1000, 1000):
        for y in range(-1000, 1000):
            if p1[0] < p2[0]:
                if a * x + b < y:
                    if length(x, y, p1[0], p1[1]) == l and length(x,y,p2[0],p2[1]) == l * math.sqrt(2):
                        p4 = [x, y]
            else:
                if a * x + b > y:
                    if length(x, y, p1[0], p1[1]) == l and length(x,y,p2[0],p2[1]) == l * math.sqrt(2):
                        p4 = [x, y]

    print("%d %d %d %d" % (p3[0], p3[1], p4[0], p4[1]))

Submission status: Accepted

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

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

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:
x1, y1, x2, y2 = map(int, input().split())

a = x2 - x1
b = y2 - y1

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

print(x3,y3,x4,y4)

Submission status: Accepted

Solution code:
import sys
def MI(): return map(int,sys.stdin.readline().rstrip().split())


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

Submission status: Accepted

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

ans = [x3,y3,x4,y4]
print(*ans)

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

sys.setrecursionlimit(10**7)
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return map(int,sys.stdin.readline().rstrip().split())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))  #空白あり
def LI2(): return list(map(int,sys.stdin.readline().rstrip()))  #空白なし
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())  #空白あり
def LS2(): return list(sys.stdin.readline().rstrip())  #空白なし


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

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

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())
v12x, v12y = x2-x1, y2-y1
v14x, v14y = v12y*(-1), v12x
x4,y4 = x1+v14x, y1+v14y

x3,y3 = x4+v12x, y4+v12y

print(x3,y3,x4,y4)

Submission status: Accepted

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

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:
from typing import List


def answer(x1: int, y1: int, x2: int, y2: int) -> List[int]:
    x = x2 - x1
    y = y2 - y1

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

    return [x3, y3, x4, y4]


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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

v=[x2-x1,y2-y1]
x,y=v[0],v[1]
v=[-y,x]
x3,y3=x2+v[0],y2+v[1]
x,y=v[0],v[1]
v=[-y,x]
x4,y4=x3+v[0],y3+v[1]
print(x3,y3,x4,y4)

Submission status: Accepted

Solution code:
import sys

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:
a = list(map(int,input().split()))
x_inc = a[2] - a[0]
y_inc = a[3] - a[1]
print(a[2]-y_inc,a[3]+x_inc,a[0]-y_inc,a[1]+x_inc)

Submission status: Accepted

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

print("{} {} {} {}".format(x2 - dy, y2 + dx, x1 - dy, y1 + dx))