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:
a,b,c,d = map(int,raw_input().split())

x = c-a
y = d -b

print c-y,d+x,c - (x+y),(x+y+b) -y

Submission status: Accepted

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

dx = x2 - x1 
dy = y2 - y1

x3 = x2 - dy
y3 = y2 + dx

x4 = x1 - dy
y4 = y1 + dx

#print(dx, dy)
print(x3, y3, x4, y4)

Submission status: Accepted

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

Submission status: Accepted

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

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

print(x3, y3, x4, y4)

Submission status: Accepted

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

dx = x2 - x1
dy = y2 - y1

dx, dy = -dy, dx

print(x2+dx, end=" ")
print(y2+dy, end=" ")
print(x1+dx, end=" ")
print(y1+dy)

Submission status: Accepted

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

v1=(y1-y2,x2-x1)
v2=(-x2+x1,y1-y2)


x3=x2+v1[0]
y3=y2+v1[1]

x4=x3+v2[0]
y4=y3+v2[1]

print(x3,y3,x4,y4)

Submission status: Accepted

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

a = x2-x1
b = y2-y1

x4 = x1 - b
y4 = y1 + a
x3 = x4 + a
y3 = y4 + b

print(x3, y3, x4, y4)

Submission status: Accepted

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

s=c-a
t=d-b

ans=[str(c-t),str(d+s),str(a-t),str(b+s)]

g=str(ans)
#print(ans)
print(' '.join(ans))

Submission status: Accepted

Solution code:
from sys import stderr
from functools import reduce
from operator import add
def f(): return [int(i) for i in input().split()]
def yes(n): print("Yes" if n else "No")
def debug(*x, sep=" ", end="\n"):
    for item in x:
        stderr.write(repr(item))
        stderr.write(sep)
    stderr.write(end)


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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
xs = list(map(int, input().split()))
d1 = xs[2] - xs[0]
d2 = xs[3] - xs[1]
x3 = xs[2] - d2
y3 = xs[3] + d1
x4 = x3 - d1
y4 = y3 - d2
print(x3, y3, x4, y4)

Submission status: Accepted

Solution code:
nums = [int(num) for num in input().split()]
x1 = nums[0]
y1 = nums[1]
x2 = nums[2]
y2 = nums[3]
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:
x1, y1, x2, y2 =map(int, input().split())

d = [x2-x1, y2- y1]
ans1 = [x2 - d[1], y2 +d[0]]
ans2 = [ans1[0] - d[0], ans1[1] - d[1]]
print(str(ans1[0]) + " " + str(ans1[1]) + " " + str(ans2[0]) + " " + str(ans2[1]))

Submission status: Accepted

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

a = x2-x1
b = y2-y1

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

print(x3, y3, x4, y4)

Submission status: Accepted

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

x = x2
y = y2
d_x = x2 - x1
d_y = y2 - y1

ans = []
for i in range(2):
    d_y_temp = d_y
    d_y = d_x
    d_x = -d_y_temp
    x = x + d_x
    y = y + d_y
    print(x, y, end=" ")
print()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

k = x2-x1
l = y2-y1

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

print(x3, y3, x4, y4)

Submission status: Accepted

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

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

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

print(x3, y3, x4, y4)

Submission status: Accepted

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

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


print(x3,y3,x4,y4)

Submission status: Accepted

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

Submission status: Accepted

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

x=c-a
y=d-b

print(str(c-y)+" "+str(d+x)+" "+str(a-y)+" "+str(b+x))

Submission status: Accepted

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

Submission status: Accepted

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

xxt = -yy
yyt = xx
x4 = x1 + xxt
y4 = y1 + yyt
x3 = x2 + xxt
y3 = y2 + yyt
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+(y2-y3)
y4=y3+(x3-x2)
print(str(x3)+' '+str(y3)+' '+str(x4)+ ' '+str(y4))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

x4 = x1 + x3 - x2
y4 = y1 + y3 - y2
print("{} {} {} {}".format(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 + y2-y3
y4 = y3 + x3-x2
print(x3,y3,x4,y4)

Submission status: Accepted

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

e = c - (d - b)
f = d + (c - a)
g = e - (c - a)
h = f - (d - b)

print(e, f, g, h)

Submission status: Accepted

Solution code:
#
import sys
import math
import numpy as np
import itertools

# いくつか入力
x1, y1, x2, y2 = (int(i) for i in input().split())  

dx = x2 - x1
dy = y2 - y1

x3 = x2 - dy
y3 = y2 + dx

x4 = x3 - dx
y4 = y3 - dy

print(x3,y3,x4,y4)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x,y,z,w = map(int,input().split())
a = z - x
b = w - y

print(z-b,w+a,x-b,y+a)

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(x3, y3, x4, y4)

Submission status: Accepted

Solution code:
#!/usr/bin/env python
# coding: utf-8
#
    
def main(x1, y1, x2, y2):
    x3 = x2 + (- (y2 - y1))
    y3 = y2 + ((x2 - x1))
    x4 = x3 + (- (y3 - y2))
    y4 = y3 + ((x3 - x2))
    print('{} {} {} {}'.format(x3, y3, x4, y4))
    
if __name__ == '__main__':
    try:
        x1,y1,x2,y2 = list(map(int,input().strip().split(' ')))
        main(x1, y1, x2, y2)
    except EOFError:
        pass

Submission status: Accepted

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


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

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

Submission status: Accepted

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

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

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

print(x3, y3, x4, y4)

Submission status: Accepted

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

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

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

print(x3, y3, x4, y4)

Submission status: Accepted

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

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

x4, y4 = -vec[1] + x1, vec[0] + y1

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
x, y, xx, yy = map(int, input().split())
k = x - xx
j = y - yy
print(str(xx+j)+" "+str(yy-k)+" "+str(x+j)+" "+str(y-k))

Submission status: Accepted

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

x = xy[2]-xy[0]
y = xy[3]-xy[1]

print(xy[2]-y, xy[3]+x, xy[0]-y, xy[1]+x)

Submission status: Accepted

Solution code:
import math
a,b,c,d=map(int,input().split())
x=a+b*1j
y=c+d*1j
z=y-x
ans3=y+z*1j
ans4=ans3-z
print(*map(int,[ans3.real,ans3.imag,ans4.real,ans4.imag]))

Submission status: Runtime Error

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

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

print(x3, y3, x4, y4

Submission status: Runtime Error

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

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

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


print(x3, y3, x4, y4)

Submission status: Runtime Error

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

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

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


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

Submission status: Runtime Error

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

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

print(a, b)

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


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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
Dist = abs(y1-y2)**2+abs(x1-x2)**2
dist = Dist**0.5
if x2 >= x1 and y2 >= y1:
  x3=x2-abs(y2-y1)
  x4=x1-abs(y2-y1)
  y3=y2+abs(x2-x1)
  y4=y1+abs(x2-x1)
elif x2 < x1 and y2 >= y1:
  x3=x2-abs(y2-y1)
  x4=x1-abs(y2-y1)
  y3=y2-abs(x2-x1)
  y4=y1-abs(x2-x1)
elif x2 < x1 and y1 >= y2:
  x3=x2+abs(y2-y1)
  x4=x1+abs(y2-y1)
  y3=y2-abs(x2-x1)
  y4=y1-abs(x2-x1)
else:
  x3=x2+abs(y2-y1)
  x4=x1+abs(y2-y1)
  y3=y2+abs(x2-x1)
  y4=y1+abs(x2-x1)
print(x3,y3,x4,y4)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
x1, y1, x2, y2 = map(int, input().split())
nx = x2
ny = y2
l = []
for i in range(2) :
    dx, dy = -dy, dx
    nx += dx
    ny += dy
    l.append(nx)
    l.append(ny)
print(l[0], l[1], l[2], l[3])

Submission status: Runtime Error

Solution code:
import sys
import copy
import math
import bisect
import pprint
import bisect
from functools import reduce
from copy import deepcopy
from collections import deque
from decimal import *

import numpy as np

import math

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

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

Submission status: Runtime Error

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

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

    return f'{x3} {y3} {x4} {y4}'

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

Submission status: Runtime Error

Solution code:
#import numpy as np
import math
#T= str(input())
#K = int(input())
x1,y1,x2,y2= map(int,input().split())
#A = list(map(int,input().split()))
#B = list(map(int,input().split()))
#S= str(input())

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

a=abs(x2-x1)
b=abs(y2-y1)


if x1 =< x2 and y1 =< y2:
    x3 = x2 - b
    y3 = y2 + a
    x4 = x1 - b
    y4 = y1 + a
elif x1 =< x2 and y1 => y2:
    x3 = x2 + b
    y3 = y2 + a
    x4 = x1 + b
    y4 = x1 + a
elif x1 => x2 and y1 =< y2:
    x3 = x2 - b
    y3 = y2 - a
    x4 = x1 - b
    y4 = y1 - a
elif x1 => x2 and y1 => y2:
    x3 = x2 + b
    y3 = y2 - a
    x4 = x1 + b
    y4 = x1 - a

print(x3,y3,x4,y4)

Submission status: Runtime Error

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

#############
# Libraries #
#############

import sys
input = sys.stdin.readline

import math
#from math import gcd
import bisect
from collections import defaultdict
from collections import deque
from functools import lru_cache


#############
# Constants #
#############

MOD = 10**9+7
INF = float('inf')

#############
# Functions #
#############

######INPUT######
def inputI(): return int(input().strip())
def inputS(): return input().strip()
def inputIL(): return list(map(int,input().split()))
def inputSL(): return list(map(str,input().split()))
def inputILs(n): return list(int(input()) for _ in range(n))
def inputSLs(n): return list(input().strip() for _ in range(n))
def inputILL(n): return [list(map(int, input().split())) for _ in range(n)]
def inputSLL(n): return [list(map(str, input().split())) for _ in range(n)]

######OUTPUT######
def Yes(): print("Yes"); return
def No(): print("No"); return

#####Inverse#####
def inv(n): return pow(n, MOD-2, MOD)

######Combination######
kaijo_memo = []
def kaijo(n):
  if(len(kaijo_memo) > n):
    return kaijo_memo[n]
  if(len(kaijo_memo) == 0):
    kaijo_memo.append(1)
  while(len(kaijo_memo) <= n):
    kaijo_memo.append(kaijo_memo[-1] * len(kaijo_memo) % MOD)
  return kaijo_memo[n]

gyaku_kaijo_memo = []
def gyaku_kaijo(n):
  if(len(gyaku_kaijo_memo) > n):
    return gyaku_kaijo_memo[n]
  if(len(gyaku_kaijo_memo) == 0):
    gyaku_kaijo_memo.append(1)
  while(len(gyaku_kaijo_memo) <= n):
    gyaku_kaijo_memo.append(gyaku_kaijo_memo[-1] * pow(len(gyaku_kaijo_memo),MOD-2,MOD) % MOD)
  return gyaku_kaijo_memo[n]

def nCr(n,r):
  if(n == r):
    return 1
  if(n < r or r < 0):
    return 0
  ret = 1
  ret = ret * kaijo(n) % MOD
  ret = ret * gyaku_kaijo(r) % MOD
  ret = ret * gyaku_kaijo(n-r) % MOD
  return ret

######Factorization######
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])
    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])
    return arr

#####MakeDivisors######
def make_divisors(n):
  divisors = []
  for i in range(1, int(n**0.5)+1):
    if n % i == 0:
      divisors.append(i)
      if i != n // i: 
        divisors.append(n//i)
  return divisors

#####LCM#####
def lcm(a, b):
    return a * b // gcd (a, b)

#####BitCount#####
def count_bit(n):
  count = 0
  while n:
    n &= n -1
    count += 1
  return count

#####ChangeBase#####
def Base_10_to_n(X, n):
  if (int(X/n)):
    return Base_10_to_n(int(X/n), n)+[X%n]
  return [X%n]


#############
# Main Code #
#############

x1,y1,x2,y2 = inputIL()

dx,dy = x2-x1,y2-y1

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

Submission status: Runtime Error

Solution code:
# coding: utf-8
import sys
import numpy as np

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

x1, y1, x2, y2 = lr()
P2 = np.array([x2, y2])  # 2つ目の点
A = np.array([[0, -1], [1, 0]])
vec = np.array([x2-x1, y2-y1])
vec2 = np.dot(A, vec)
vec3 = np.dot(A, vec2)
P3 = np.array(P2) + vec2
P4 = np.array(P3) + vec3
print(*P3, *P4)

Submission status: Runtime Error

Solution code:
length = int(input())
s = input()

if s[:length // 2] == s[length // 2:]:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

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

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

elif x2>x1 and y2<y1:
  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: Runtime Error

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


if x1 >= x2 and y2 > y1:
    x3 = x2-abs_x-1
    x4 = x1-abs_x-1
    y3 = y2+abs_y-1
    y4 = y1+abs_y-1

elif x1 >= x2 and y1 > y2:
    x3 = x2-abs_x+1
    x4 = x1-abs_x+1
    y3 = y2+abs_y-1
    y4 = y1+abs_y-1

elif x2 >= x1 and y2 > y1:
    x3 = x2-abs_x+1
    x4 = x1-abs_x+1
    y3 = y2+abs_y+1
    y4 = y1+abs_y+1

elif x2 >= x1 and y1 > y2:
    x3 = x2-abs_x-1
    x4 = x1-abs_x-1
    y3 = y2+abs_y+1
    y4 = y1+abs_y+1
print(x3, y3, x4, y4)

Submission status: Runtime Error

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

import numpy as np
R_90 = np.array([[0, -1], [1, 0]])
oa = np.array([x1, y1])
ab = np.array([x2 - x1, y2 - y1])
ad = R_90 @ ab
od = oa + ad
oc = od + ab

od = map(str, list(od))
oc = map(str, list(oc))

print(' '.join(list(oc)) +' ' + ' '.join(list(od)))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
x1, y1, x2, y2 = map(int, input().split())
x = x1 - x2
y = y1 - y2
point3 = [x2 + y, y2 - x]
point4 = [x1 + y, y1 - x]
print(*[*point3, *point4], sep=' ')

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import numpy as np


rotation_mat = np.array([
    [0, -1],
    [1, 0]
])
x1, y1, x2, y2 = map(int, input().split())
a = np.array([[x1], [y1]])
b = np.array([[x2], [y2]])
delta = b - a
c = b + rotation_mat.dot(delta)
d = c - delta
print(*c.flatten(), *d.flatten())

Submission status: Runtime Error

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

print(x3, y3, x4, y4)

Submission status: Runtime Error

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

if x1 > x2 and y1 > y2:
    pass
elif x1 <= x2 and y1 > y2:
    pass
elif x1 > x2 and y1 <= y2:
    point3 = (x2 - diff_y, y2 - diff_x)
    point4 = (point3[0] + diff_x, point3[1] - diff_y)
else:  # x1 <= x2 and y1 <= y2
    point3 = (x2 - diff_y, y2 + diff_x)
    point4 = (point3[0] - diff_x, point3[1] - diff_y)

print(*[*point3, *point4], sep=' ')

Submission status: Runtime Error

Solution code:
x1,y1,x2,y2=map(int,input().split())
#90°回転より、
#x1'=y1,y1'=x1,x2'=y2,y2'=x2
x4=x1+(y2-y1)
#x4=x1+(x1'-x2')
x3=x2+(y2-y1)
y4=y1+(x2-x1)
y3=y2+(x22-x1)
 
print(x3,y3,x4,y4)

Submission status: Runtime Error

Solution code:
import numpy as np

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

x1y1 = np.array([x1,y1])
x2y2 = np.array([x2,y2])

vector = x1y1 - x2y2
rotation = np.array([[0,1],
                     [-1,0]])
rotated_vector = np.dot(rotation,vector)
x3y3 = x2y2 + rotated_vector
x4y4 = x3y3 + vector

print(*x3y3,*x4y4)

Submission status: Runtime Error

Solution code:
x1,x2,x3,x4=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
    #ok
elif x1>=x2 and y1<y2:
    x3=x2-dy
    y3=y2-dx
    x4=x3+dx
    y4=y3-dy
    #ok
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:
    print("NA")
print(x3,y3,x4,y4)

Submission status: Runtime Error

Solution code:
A = list(map(int, input().split()))
L = len(A)
ans = [0, 0, 0, 0]
dx = A[2] - A[0]
dy = A[3] - A[1]
if(dx>0 and dy>=0):
    dx = abs(dx)
    dy = abs(dy)
    x3 = A[2] - dy
    y3 = A[3] + dx
    x4 = x3 - dx
    y4 = y3 - dy
elif(dx>=0 and dy<0):
    dx = abs(dx)
    dy = abs(dy)
    x3 = A[2] + dy
    y3 = A[3] + dx
    x4 = x3 - dx
    y4 = y3 + dy
elif(dx<=0 and dy<0):
    dx = abs(dx)
    dy = abs(dy)
    x3 = A[2] + dy
    y3 = A[3] - dx
    x4 = x3 + dx
    y4 = y3 + dy
elif(dx<0 and dy>=0):
    dx = abs(dx)
    dy = abs(dy)
    x3 = A[2] - dy
    y3 = A[3] - dx
    x4 = x3 + dx
    y4 = y3 - dy

ans[0] = str(x3)
ans[1] = str(y3)
ans[2] = str(x4)
ans[3] = str(y4)
ans = ' '.join(ans)
print(ans)

Submission status: Runtime Error

Solution code:
#108b
import math

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

#正方形なのでベクトル(x2,y2)→(x3,y3)とベクトル(x2,y2)→(x1,y1)は同じ長さで直交している。
#(x3-x2)=xA
#(y3-y2)=yA
#(x1-x2)=xB
#(y1-y2)=yB
#とする。

#・大きさ同じ
# (x3-x2)**2+(y3-y2)**2 = (x1-x2)**2+(y1-y2)**2
# xA**2 + yA**2 = xB**2 + yB**2
#・直交→内積は0
# (x3-x2)*(x1-x2) + (y3-y2)*(y1-y2) = 0
# xA * xB = yA * yB

#整理すると
#yA = xA * xB / yB
#xA**2 + yA**2 = xB**2 + yB**2
#xA**2 + (xA * xB / yB)**2 = xB**2 + yB**2
#xA**2 * {1 + (xB / yB)**2)} = xB**2 + yB**2
#xA**2 = {xB**2 + yB**2} / {1 + (xB / yB)**2}

#xA = ±sqrt({xB**2 + yB**2} / {1 + (xB / yB)**2})
#yA = xA * xB / yB

xB = x1 - x2
yB = y1 - y2

xA = math.sqrt((xB**2 + yB**2) / (1 + (xB / yB)**2))
yA = xA * xB / yB
y3 = yA + y2

xA = -1 * math.sqrt((xB**2 + yB**2) / (1 + (xB / yB)**2))
yA = xA * xB / yB
x3 = xA + x2

###############################################################
#上と同様に考える
#xA = x4-x1
#yA = y4-y1
xB = x2 - x1
yB = y2 - y1

xA = math.sqrt((xB**2 + yB**2) / (1 + (xB / yB)**2))
yA = xA * xB / yB
y4 = yA + y1

xA = -1 * math.sqrt((xB**2 + yB**2) / (1 + (xB / yB)**2))
yA = xA * xB / yB
x4 = xA + x1

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

Submission status: Runtime Error

Solution code:
import numpy as np

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

a = np.array([[x1], [y1]])
b = np.array([[x2], [y2]])

rot = np.array([[0, -1], [1, 0]])
ab = b - a
bc = np.dot(rot, ab)

c = b + bc
d = a + bc

# print(a, b)
# print(c, d)

print(*c.flatten()+' '+*d.flatten())

Submission status: Runtime Error

Solution code:
import numpy as np

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

a = np.array([[x1], [y1]])
b = np.array([[x2], [y2]])

rot = np.array([[0, -1], [1, 0]])
ab = b - a
bc = np.dot(rot, ab)

c = b + bc
d = a + bc

# print(a, b)
# print(c, d)

print(*c.flatten(), *d.flatten(), sep=" ")

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a

Submission status: Runtime Error

Solution code:
import numpy as np
a,b,c,d=map(int,input().split())
n=np.array([c-a,d-b])
p=np.array([-n[1],n[0]])
print(*([c,d]+p),*([a,b]+p))

Submission status: Runtime Error

Solution code:
o

Submission status: Runtime Error

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

x = c − a
y = d - b
print(c-y,d+x,a-y,b+x)

Submission status: Runtime Error

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(-200,201):
    if flag==1:break
    for y3 in range(-200,201):
        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(math.floor(x3),math.floor(y3),math.floor(x4),math.floor(y4))

Submission status: Runtime Error

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(-200,201):
    if flag==1:break
    for y3 in range(-200,201):
        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: Runtime Error

Solution code:
k = int(input())
print((k//2)*((k+1)//2)

Submission status: Runtime Error

Solution code:
import numpy as np

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

a=np.array([x1,y1])
b=np.array([x2,y2])

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

c = b + np.dot(T,b-a)
d = c + np.dot(T,c-b)
print(*c,*d)

Submission status: Runtime Error

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

a,b = (n[2] - n[0]), (n[3] - n[1])

o1,o2 = (n[2] - b), (n[3] + a)
o3,o4 = (o1 - a),(o2 - b)

print(" ".join([o1,o2,o3,o4]))

Submission status: Runtime Error

Solution code:
x=list(input().split())
x1=int(x[0])
y1=int(x[1])
x2=int(x[2])
y2=int(x[3])
xlength=abs(x1-x2)
ylength=abs(y1-y2)
if x1>x2 and y2>y1:
  x3=x2-ylength
  y3=y2-xlength
  x4=x3+xlength
  y4=y3-ylength
elif x1>x2 and y1>y2:
  x3=x2+xlength
  y3=y2-ylength
  x4=x3+ylength
  y4=y3+xlength
elif x1<x2 and y1>y2:
  x3=x2+ylength
  y3=y2+xlength
  x4=x3-xlength
  y4=y3+ylength
elif x1<x2 and y1<y2:
  x3=x2-xlength
  y3=y2+ylength
  x4=x3-ylength
  y4=y3-xlength
  
print(str(x3)+' '+str(y3)+' '+str(x4)+' '+str(y4))

Submission status: Runtime Error

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

x3=x2+dy
y3=y2-dx

x4=x1+dy
y4=y1-dx
ans=[x3,y3,x4,y4]
print("".join(list(map(str,ans)))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

k1=x2-x1
k2=y2-y1

print(x2-k2,y2+k1,x3-k1,y3-k2)

Submission status: Runtime Error

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

for x in range(-100, 101):
    for y in range(-100, 101):
        if x*x12 + y*y12 == 0 and x12**2 + y12**2 == x**2 + y**2:
            x += x1
            y += y1
            if x12 >= 0 and y12 <= 0:
                if 0 <= x and 0 <= y:
                    x4 = x
                    y4 = y
            elif x12 >= 0 and y12 >= 0:
                if 0 >= x and 0 <= y:
                    x4 = x
                    y4 = y
            elif x12 <= 0 and y12 >= 0:
                if 0 >= x and 0 >= y:
                    x4 = x
                    y4 = y
            elif x12 <= 0 and y <= 0:
                if x >= 0 and y <= 0:
                    x4 = x
                    y4 = y

for x in range(-300,301):
    for y in range(-300,301):
        if (x2-x)**2 + (y2-y)**2 == (x4-x)**2 + (y4-y)**2 == x12**2 + y12**2 and x != x1 and y != y1:
            x3 = x
            y3 = y
print(x3,y3,x4,y4)

Submission status: Runtime Error

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

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

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

print(x3, y3, x4, y4)

Submission status: Runtime Error

Solution code:
x1, y1, x2, y2 = map(int, input().split())
import math
d12 = math.sqrt((x1-x2)**2 + (y1-y2)**2)
  
for x in range(-100, x1):
  for y in range(-100, 100):
    d14 = math.sqrt((x1-x)**2 + (y1-y)**2)
    if d12 == d14:
      y4 = y
      break
  if d12 == d14:
    x4 = x
    break
      
for x in range(-100, x2):
  for y in range(-100, 100):
    d23 = math.sqrt((x2-x)**2 + (y2-y)**2)
    if d12 == d23:
      y3 = y
      break
  if d12 == d23:
    x3 = x
    break

print(x3, y3, x4, y4)

Submission status: Runtime Error

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

p1 = (int(n[0]) + int(n[1]) * 1j)
p2 = (int(n[2]) + int(n[3]) * 1j)

p3 = (p2 - p1) * 1j + p2
p4 = p3 + (p1 - p2)

print(int(p3.real9), int(p3.imag), int(p4.real), int(p4.imag))

Submission status: Runtime Error

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

p1 = (n[0] + n[1]j)
p2 = (n[2] + n[3]j)

p3 = (p1 - p2) * j + p2
p4 = p3 + (p1 - p2)

print(real(p3),img(p3),real(p4)img(p4))