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

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


def f(x1, y1, x2, y2):
    if x1 == x2:
        # print("x")
        y3 = y2
        y4 = y1
        x3 = x1 - abs(y2)
        x4 = x3
    elif y1 == y2:
        # print("y")
        x3 = x2
        x4 = x1
        y3 = y1 - abs(x2)
        y4 = y3
    else:
        dx = abs(x2 - x1)
        dy = abs(y2 - y1)
        d = dx + dy
        if y2 > y1 and x2 < x1:
            # 右1,上2
            x3, y3, x4, y4 = \
                x1 - d, y2 - dx, x1 - dy, y2 - d

        elif y2 < y1 and x2 < x1:
            # 上1,左2
            x3, y3, x4, y4 = \
                x2 - dy, y1 - d, x2 + d, y1 + dx

        elif y2 < y1 and x2 > x1:
            # 左1,下2
            x3, y3, x4, y4 = \
                x1 + d, y2 + dx, x1 + dy, y2 + d

        elif y2 > y1 and x2 > x1:
            # 下1,右2
            x3, y3, x4, y4 = \
                x2 - dy, y1 + d, x2 - d, y1 + dx

    return x3, y3, x4, y4


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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


xdif = abs(x1 - x2)
ydif = abs(y1 - y2)

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

Submission status: Wrong Answer

Solution code:
import math
x1,y1,x2,y2=input().split()
x1=int(x1)
y1=int(y1)
x2=int(x2)
y2=int(y2)
if y2-y1!=0:
    m2=-1*((x2-x1)/(y2-y1))
else:
    m2=math.tan(math.pi/2)
s=((y2-y1)**2+(x2-x1)**2)**(1/2)
cos2=math.cos(math.atan(m2))
sin2=math.sin(math.atan(m2))
x4=(x1-cos2*s)
x3=(x2-cos2*s)
y4=(y1-sin2*s)
y3=(y2-sin2*s)
print(round(x3),round(y3),round(x4),round(y4))

Submission status: Wrong Answer

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

refx = x2 - x1
refy = y2 - y1
#hen = math.sqrt((x2-x1)**2 + (y2-y1)**2)

if refx >= 0 and refy >= 0:
  print ("{} {} {} {}".format(x2-refy, y2+refx, x1-refy, y1+refx))
if refx >= 0 and refy < 0:
  print ("{} {} {} {}".format(x2+refy, y2-refx, x1+refy, y1-refx))
if refx < 0 and refy >= 0:
  print ("{} {} {} {}".format(x2+refy, y2+refx, x1+refy, y1+refx))
if refx < 0 and refy < 0:
  print ("{} {} {} {}".format(x2-refy, y2-refx, x1-refy, y1-refx))

Submission status: Wrong Answer

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

tmpx = x2 - x1
tmpy = y2 - y1
print(tmpx, tmpy)
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
    x4 = x3
    y4 = y3 + (x3-x2)
elif tmpx == 0 and tmpy < 0:
    x3 = x2 - tmpy
    y3 = y2
    x4 = x3
    y4 = y3 + (x3-x2)
elif tmpx > 0 and tmpy == 0:
    x3 = x2
    y3 = y2 + tmpx
    x4 = x3 - (y3-y2)
    y4 = y3
elif tmpx < 0 and tmpy == 0:
    x3 = x2
    y3 = y2 + tmpx
    x4 = x3 - (y3-y2)
    y4 = y3

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 + tmpy
    y3 = y2 - tmpx
    x4 = x3 - tmpx
    y4 = y3 - tmpy
elif tmpx > 0 and tmpy < 0:
    x3 = x2 + tmpy
    y3 = y2 - tmpy
    x4 = x3 - tmpx
    y4 = y3 - tmpy

print(x3, y3, x4, y4)

# n, k = map(int, input().split())
# tmp = 0
# tmp = [i for i in range(0, n*2+1, k) if i!=0]
# print(tmp)
# cnt = 0
#
# for k in tmp:
#     if
# for j in tmp:
#     if j %2 == 0:
#         cnt += 1
# print(len(tmp)*3-cnt)

Submission status: Wrong Answer

Solution code:
import math
x1,y1,x2,y2 = map(int,input().split())
side_len = math.sqrt((x1 - x2)**2 + (y1 - y2)**2)
# x3,y3,x4,y4 = 0,0,0,0

if y1 == y2:
    if x1 > x2:
        #No.2
        x3 = x2
        y3 = y2 - side_len
        x4 = x1
        y4 = y1 - side_len
    else:
        #No.4
        x3 = x2
        y3 = y2 + side_len
        x4 = x1
        y4 = y1 + side_len
else:
    if y1 < y2:
        # No.1
        x3 = x2 - side_len
        y3 = y2
        x4 = x3
        y4 = y3 - side_len
    else:
        # No.3
        x3 = x1 + side_len
        y3 = y2
        x4 = x3
        y4 = y1

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

Submission status: Wrong Answer

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

# x3 = x2 - (max(y1, y2) - min(y1, y2))
# x4 = y1 - (max(y1, y2) - min(y1, y2))
# y3 = y2 + (x2 - x1)
# y4 = y1 + (x2 - x1)
# if x2 > x1 or y2 > y1:
#     x3 = x2 + (y1 - y2)
#     y3 = y2 + (x1 - x2)
#     x4 = x3 + (y3 - y2)
#     y4 = y3 + (x3 - x2)
# else:
#     x3 = x2 + (y2 - y1)
#     y3 = y2 + (x2 - x1)
#     x4 = x3 + (y3 - y2)
#     y4 = y3 + (x3 - x2)

x_dif, y_dif = x2 - x1, y2 - y1

if x_dif > 0 and y_dif > 0:
    x3 = x2 - y_dif
    y3 = y2 + x_dif
    x4 = x3 - y_dif
    y4 = y3 - x_dif
elif x_dif > 0 and y_dif < 0:
    x3 = x2 + y_dif
    y3 = y2 + x_dif
    x4 = x3 - y_dif
    y4 = y3 + x_dif
elif x_dif < 0 and y_dif > 0:
    x3 = x2 - y_dif
    y3 = y2 - x_dif
    x4 = x3 + y_dif
    y4 = y3 - x_dif
elif x_dif < 0 and y_dif < 0:
    x3 = x2 + y_dif
    y3 = y2 - x_dif
    x4 = x3 + y_dif
    y4 = y3 + x_dif
elif x_dif == 0:
    if y_dif > 0:
        x3 = x2 - y_dif
        y3 = y2
        x4 = x3
        y4 = y3 - x_dif
    else:
        x3 = x2 + y_dif
        y3 = y2
        x4 = x3
        y4 = y3 + x_dif
elif y_dif == 0:
    if y_dif > 0:
        x3 = x2
        y3 = y2 + x_dif
        x4 = x3 - y_dif
        y4 = y3
    else:
        x3 = x2 - y_dif
        y3 = y2
        x4 = x3
        y4 = y3 - x_dif



print(x3, y3, x4, y4)

Submission status: Wrong Answer

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

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


def f(x1, y1, x2, y2):
    if x1 == x2:
        # print("x")
        y3 = y2
        y4 = y1
        x3 = x1 - abs(y2)
        x4 = x3
    elif y1 == y2:
        # print("y")
        x3 = x2
        x4 = x1
        y3 = y1 - abs(x2)
        y4 = y3
    else:
        dx = abs(x2 - x1)
        dy = abs(y2 - y1)
        d = dx + dy
        if y2 > y1 and x2 < x1:
            # 右1,上2
            x3, y3, x4, y4 = \
                x1 - d, y2 - dx, x1 - dy, y2 - d

        elif y2 < y1 and x2 < x1:
            # 上1,左2
            x3, y3, x4, y4 = \
                x2 - dy, y1 - d, x2 + d, y1 + dx

        elif y2 < y1 and x2 > x1:
            # 左1,下2
            x3, y3, x4, y4 = \
                x1 + d, y2 + dy, x1 + dx, y2 + d

        elif y2 > y1 and x2 > x1:
            # 下1,右2
            x3, y3, x4, y4 = \
                x2 - dy, y1 + d, x2 - d, y1 + dx

    return x3, y3, x4, y4


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import math
x1,y1,x2,y2=input().split()
x1=int(x1)
y1=int(y1)
x2=int(x2)
y2=int(y2)
if y2-y1!=0:
    m2=-1*((x2-x1)/(y2-y1))
else:
    m2=1000000000000000
s=((y2-y1)**2+(x2-x1)**2)**(1/2)
cos2=math.cos(math.atan(m2))
sin2=math.sin(math.atan(m2))
x4=(x1-cos2*s)
x3=(x2-cos2*s)
y4=(y1-sin2*s)
y3=(y2-sin2*s)
print(round(x3),round(y3),round(x4),round(y4))

Submission status: Wrong Answer

Solution code:
import math
x1,y1,x2,y2=map(int,input().split())
#dist=sqrt((x2-x1)**2+(y2-y1)**2)
if x1==x2:
    dist=abs(y2-y1)
    print('{} {} {} {}'.format(x2-dist,y2,x1-dist,y1))
elif y1==y2:
    dist=abs(x2-x1)
    print('{} {} {} {}'.format(x2,y2-dist,x1,y1-dist))
else:
    x3=x2-y2+y1
    y3=x2-x1+y2
    x4=x1+y1-y2
    y4=x2+y1-x1
    #x3=x1+((x2-x1)*(math.sqrt(2)/2)-(y2-y1)*(math.sqrt(2)/2))*math.sqrt(2)
    #y3=y1+((x2-x1)*(math.sqrt(2)/2)-(y2-y1)*(math.sqrt(2)/2))*math.sqrt(2)
    #x4=x2+((x1-x2)*(math.sqrt(2)/2)-(y1-y2)*(math.sqrt(2)/2))*math.sqrt(2)
    #y4=y2+((x1-x2)*(math.sqrt(2)/2)-(y1-y2)*(math.sqrt(2)/2))*math.sqrt(2)
    print('{} {} {} {}'.format(x3,y3,x4,y4))

Submission status: Wrong Answer

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

refx = x2 - x1
refy = y2 - y1
#hen = math.sqrt((x2-x1)**2 + (y2-y1)**2)

if refx >= 0 and refy >= 0:
  print ("{} {} {} {}".format(x2-refy, y2+refx, x1-refy, y1+refx))
if refx >= 0 and refy < 0:
  print ("{} {} {} {}".format(x2-refy, y2-refx, x1-refy, y1-refx))
if refx < 0 and refy >= 0:
  print ("{} {} {} {}".format(x2-refy, y2+refx, x1-refy, y1+refx))
if refx < 0 and refy < 0:
  print ("{} {} {} {}".format(x2-refy, y2-refx, x1-refy, y1-refx))

Submission status: Wrong Answer

Solution code:
l = list(map(int, input().split()))
print(l[1] + l[2] - l[3], end=' '),
print(l[3] + l[1] - l[0], end=' '),
print(l[2] - l[3] + l[0], end=' '),
print(l[1] - l[0] + l[2], end=' ')

Submission status: Wrong Answer

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

if x1<x2 and y1<=y2 or x1<=x2 and y1<y2:
    x3,y3 =x2-y,y2+x
    x4,y4 =x3-x,y3-y
elif x1>x2 and y1<=y2 or x1>=x2 and y1<y2:
    x3,y3 =x2-y,y2-x
    x4,y4 =x3+x,y3-y
elif x1<x2 and y1>=y2 or x1<=x2 and y1>y2:
    x3,y3 =x2+y,y2+x
    x4,y4 =x3-x,y3+y
elif x1>x2 and y1>=y2 or x1>=x2 and y1>y2:
    x3,y3 =x2-y,y2+x
    x4,y4 =x3+x,y3+y
print(x3,y3,x4,y4)

Submission status: Wrong Answer

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

vector_x, vector_y = x2 - x1, y2 - y1

if y2 >= y1:
    print(x2 - vector_y, y2 + vector_x, x1 - vector_y, y1 + vector_x)
else:
    print(x2 + vector_y, y2 + vector_x, x1 + vector_y, y1 + vector_x)

Submission status: Wrong Answer

Solution code:
import math
import numpy as np

x1, y1, x2, y2 = [int(num) for num in input().split(' ')]
dif  = x1-x2 if y1==y2 else y1-y2
size = abs(dif)

if y1==y2:
    if dif > 0:
        print('{} {} {} {}'.format(x2, y2-size, x1, y1-size))
    else:
        print('{} {} {} {}'.format(x2, y2+size, x1, y1+size))

elif x1==x2:
    if dif > 0:
        print('{} {} {} {}'.format(x2+size, y2, x1+size, y1))
    else:
        print('{} {} {} {}'.format(x2-size, y2, x1-size, y1))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#ここからB問題
x1, y1, x2, y2 = map(int, input().split())
x = abs(x1 - x2)
y = abs(y1 - y2)
x3 = x2 - y
y3 = y2 - x
x4 = x1 - y
y4 = y1 - x
print(x3, y3, x4, y4)

Submission status: Wrong Answer

Solution code:
Data = input()

data = Data.split()

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

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

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

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

Submission status: Wrong Answer

Solution code:
Data = input()

data = Data.split()

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

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

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

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

Submission status: Wrong Answer

Solution code:
#ここからB問題
x1, y1, x2, y2 = map(int, input().split())
x = abs(x1 - x2)
y = abs(y1 - y2)
x3 = x2 - x
y3 = y2 - y
x4 = x1 - x
y4 = y1 - y
print(x3, y3, x4, y4)

Submission status: Wrong Answer

Solution code:
Data = input()
 
data = Data.split()
 
x1,y1,x2,y2 = int(data[0]),int(data[1]),int(data[2]),int(data[3])
 
x3 = x2 - abs(y1-y2)
if x1 < x2 :
    if x3 > x2:
        x3 = x2 + abs(y1-y2)
else:
    if x3 > x2:
        x3 = x2 + abs(y1-y2)
y3 = y2 - abs(x1-x2)
 
if x1 < x2 :
    if y3 < y2:
        y3 = y2 + abs(x1-x2)
else:
    if y3 > y2:
        y3 = y2 + abs(x1-x2)
 
x4 = x1 - abs(y1-y2)
if x1 < x2 :
    if x1 < x4:
        x4 = x1 + abs(y1-y2)
else:
    if x1 < x4:
        x4 = x1 + abs(y1-y2)
y4 = y1 - abs(x1-x2)
    
if x1 < x2 :
    if y1 < y4:
        y4 = y1 + abs(x1-x2)
else:
    if y1 < y4:
        y4 = y1 + abs(x1-x2)
    
print(x3,y3,x4,y4)

Submission status: Wrong Answer

Solution code:
s = input()

s = s.split(" ")

x1 = int(s[0])
y1 = int(s[1])

x2 = int(s[2])
y2 = int(s[3])

 # X1 - X2 の増加量
zouka_x = abs(int(x1) - int(x2))

 # Y1 - Y2 の増加量
zouka_y = abs(int(y1) - int(y2))

x3 = x2 - zouka_y
y3 = y2 + zouka_x

x4 = x1 - zouka_y
y4 = y1 + zouka_x

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from math import sin, cos, acos, pi
x1, y1, x2, y2 = map(int, input().split())
r = ((x1 - x2) ** 2 + (y1 - y2) ** 2) ** 0.5
t = acos((x2 - x1)/r)
x3, y3 = x1 + (2 ** 0.5)*r*cos(t + pi/4), y1 + (2 ** 0.5)*r*sin(t + pi/4)
x4, y4 = x1 + r*cos(t + pi/2), y1 + r*sin(t + pi/2)
print(round(x3), round(y3), round(x4), round(y4))

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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,y3,x4,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: Wrong Answer

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

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

print(x1, y1)

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

print(x2, y2, x3, y3)
   
e = c + x2
f = d + y2
g = e + x3
h = f + y3

print(e, f, g, h)

Submission status: Wrong Answer

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

refx = x2 - x1
refy = y2 - y1
#hen = math.sqrt((x2-x1)**2 + (y2-y1)**2)

if refx >= 0 and refy >= 0:
  print ("{} {} {} {}".format(x2-refy, y2+refx, x1-refy, y1+refx))
if refx >= 0 and refy < 0:
  print ("{} {} {} {}".format(x2+refy, y2-refx, x1+refy, y1-refx))
if refx < 0 and refy >= 0:
  print ("{} {} {} {}".format(x2-refy, y2+refx, x1-refy, y1+refx))
if refx < 0 and refy < 0:
  print ("{} {} {} {}".format(x2+refy, y2-refx, x1+refy, y1-refx))

Submission status: Wrong Answer

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

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

print(x3,y3,x4,y4)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
Data = input()

data = Data.split()

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

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

if x1 < x2 :
    if y3 < y2:
        y3 = y2 + abs(x1-x2)
else:
    if y3 > y2:
        y3 = y2 + abs(x1-x2)

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

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

print(x3, y3, x4, y4)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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 x2 < x1:
        if y1 < y2:
            x3, y3 = x2 - dy, y2 - dx
            x4, y4 = x1 - dy, y1 - dx
        else:
            x3, y3 = x2 + dy, x2 - dx
            x4, y4 = x1 + dy, x1 - 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: Wrong Answer

Solution code:
from math import sin, cos, acos, pi
x1, y1, x2, y2 = map(int, input().split())
r = ((x1 - x2) ** 2 + (y1 - y2) ** 2) ** 0.5
t = acos((x2 - x1)/r)
print(r, t)
x3, y3 = x1 + (2 ** 0.5)*r*cos(t + pi/4), y1 + (2 ** 0.5)*r*sin(t + pi/4)
x4, y4 = x1 + r*cos(t + pi/2), y1 + r*sin(t + pi/2)
print(round(x3), round(y3), round(x4), round(y4))

Submission status: Wrong Answer

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-(c-a),a-(d-b),b-(c-a))
        else:
            print(c-(d-b),d+(a-c),a-(d-b),b+(a-c))

Submission status: Wrong Answer

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-(c-a),a-(d-b),b-(c-a))
        else:
            print(c-(d-b),d+(a-c),a-(d-b),b+(a-c))

Submission status: Wrong Answer

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

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),d-(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-(c-a),a-(d-b),b-(c-a))
        else:
            print(c-(d-b),d+(a-c),a-(d-b),b+(a-c))

Submission status: Wrong Answer

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


if x2>x1 and y2>y1:
  x3=x2-(y2-y1)
  y3=y2-(x1-x2)
  x4=x3-(y3-y2)
  y4=y3-(x2-x3)
  print(x3,y3,x4,y4)
  exit()

if x2<x1 and y2>y1:
  x3=x2-(y2-y1)
  y3=y2-(x1-x2)
  x4=x3-(y3-y2)
  y4=y3-(x2-x3)
  print(x3,y3,x4,y4)
  exit()
  
if x2<x1 and y2<y1:
  x3=x2-(y2-y1)
  y3=y2-(x1-x2)
  x4=x3-(y2-y3)
  y4=y3-(x3-x2)
  print(x3,y3,x4,y4)
  exit()

if x2>x1 and y2<y1:
  x3=x2-(y1-y2)
  y3=y2-(x2-x1)
  x4=x3-(y2-y1)
  y4=y3-(x2-x3)
  print(x3,y3,x4,y4)
  exit()

if x1==x2:
  x3=x2-(y2-y1)
  y3=y2
  x4=x3
  y4=y3-(x2-x3)
  print(x3,y3,x4,y4)
  exit()

if y1==y2:
  y3=y2-(x1-x2)
  x3=x2
  y4=y3
  x4=x3-(y3-y2)
  print(x3,y3,x4,y4)
  exit()

Submission status: Wrong Answer

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

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

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:
import math
x1,x2,y1,y2=map(int,input().split())
l=int(math.sqrt(pow(x1-x2,2)+pow(y1-y2,2)))
x3=x2-y2+y1
y3=y2+x2-x1
x4=x1-y2+y1
y4=y1+x2-x1
print(x3,y3,x4,y4)

Submission status: Wrong Answer

Solution code:
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 + (D - B)
    G = (A + (B - D))
    H = B + (D - B)
    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: Wrong Answer

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

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'

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

    x4 = x1 - d2
    y4 = y1 - d1

else:
    x3 = x2 - d2
    y3 = y2 + d1

    x4 = x1 - d2
    y4 = y1 + d1

print(x3,y3,x4,y4)

Submission status: Wrong Answer

Solution code:
x1,y1,x2,y2 = map(int,input().split())
r = int((((x1-x2)**2 + (y1-y2)**2)**(1/2)))
if y1 == y2 and x1 < x2:
  print(x2,y2+r,x1,y1+r)
elif y1 == y2 and x1 > x2:
  print(x2,y2-r,x1,y1-r)
elif x1 == x2 and y1 < y2:
  print(x2-r,y2,x1-r,y1)
elif x1 == x2 and y1 > y2:
  print(x2+r,y2,x1+r,y1)