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: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

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

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

print(*X3, *X4)

Submission status: Runtime Error

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

l = max(abs(x1-x2), abs(x2-y2))

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
#include <iostream>
#include <cstdio>
#include <cstring>
#include <vector>
#include <queue>
#include <array>
#include <set>
#include <unordered_set>
#include <unordered_map>
#include <cmath>
#include <algorithm>
#include <numeric>
#include <cassert>
#include <utility>
#include <functional>

using namespace std;
using lli = long long int;

int main() {

    lli x1, y1, x2, y2, x3, y3, x4, y4;
    cin >> x1 >> y1 >> x2 >> y2;
    
    lli x = x2 - x1;
    lli y = y2 - y1;

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

    cout << x3 << " " << y3 << " " << x4 << " " << y4 << endl;
}

Submission status: Runtime Error

Solution code:
import numpy as np
x1,y1,x2,y2 = map(int,input().split())
v = np.array([x1,y1])
w = np.array([x2,y2])
u = w - v
T = np.array([[0,-1],[1,0]])
v1 = np.matmul(T,u) + w
v2 = np.matmul(T,v1 - w) + v1
print(v1[0],v1[1],v2[0],v2[1])

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

print(f"{x3} {y3} {x4} {y4}")

Submission status: Runtime Error

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

x = x2-x1
y = y2-y1

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

print(x3,y3,x4,y4)

Submission status: Runtime Error

Solution code:
import numpy as np
x1,y1,x2,y2=map(int,input().split())
p1=np.array([x1,y1])
p2=np.array([x2,y2])
d=p2-p1
d=np.array([-d[1],d[0]])
p3=p2+d
d=np.array([-d[1],d[0]])

p4=p3+d
x3=p3[0]
y3=p3[1]
x4=p4[0]
y4=p4[1]
print(x3,y3,x4,y4)

Submission status: Runtime Error

Solution code:
import numpy as np
import itertools
import matplotlib as mpl

x1, y1, x2, y2 =map(int, input().split())  #複数数値入力

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

L = [x3,y3,x4,y4]
print(' '.join(map(str, L)))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
x_1,y_1,x_2,y_2=map(int,input().split())
x_3=-(y_2-y_1)+x_1
y_3=(x_1-x_2)+y_1
x_4=(x_3-x_1)+(x_2-x_1)+x_1
y_4=(y_3-y_1)+(y_2-y_1)+y_1
print(x_3 y_3 x_4 y_4)

Submission status: Runtime Error

Solution code:
import heapq
def solve():
  x1,y1,x2,y2 = (int(i) for i in input().split())
  
  que = []
  que2 = []
  for i in range(-300,300):
    for j in range(-300,300):
      if (x2-x1)**2+(y2-y1)**2 == (i-x1)**2+(j-y1)**2:
        if (i,j) != (x1,y1) and  (i,j) != (x2,y2):
          que.append((i,j))
      if (x2-x1)**2+(y2-y1)**2 == (i-x2)**2+(j-y2)**2:
        if  (i,j) != (x1,y1) and  (i,j) != (x2,y2):
         que2.append((i,j))
        
  #define x3,y3
  while que2:
    (x3,y3) = heapq.heappop(que2)
    for i in range(len(que)):
      x4,y4 = que[i]
      if (x3-x2)**2+(y3-y2)**2 == (x4-x1)**2+(y4-y1)**2:
       if (x3-x4)**2+(y3-y4)**2 == (x2-x1)**2+(y2-y1)**2:
        if (x3-x1)**2+(y3-y1)**2 == (x2-x4)**2+(y2-y4)**2:
           print(x3,y3,x4,y4)
            exit()
  #print(que)
 #print(que2)			
solve()

Submission status: Runtime Error

Solution code:
x(1),y(1),x(2),y(2)=map(int,input().split())
for i in range(3,5):
  x(i)=x(i-1)+y(i-2)-y(i-1)
  y(i)=y(i-1)+x(i-1)-x(i-2)
print(x(3) y(3) x(4) y(4))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import numpy as np
x1_, y_1, x_2, y_2 = map(int, input().split())

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

Submission status: Runtime Error

Solution code:
from sys import stdin
x1, y1, x2, y2 = [int(x) for x in stdin.readline.rstrip().split()]
print(x2-(y2-y1), y2+(x2-x1), x1-(y2-y1), y1+(x2-x1))

Submission status: Runtime Error

Solution code:
int_k = int(input())

if int_k % 2 == 0:
    print((int_k // 2) ** 2)
else:
    print((int_k // 2) * ((int_k //2) + 1))

Submission status: Runtime Error

Solution code:
import sys

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

  x4 = -(y2 - y1) + x1
  y4 = (x2 - x1) + y1
  x3 = x2 + x4 - x1
  y3 = y2 + y4 - y1
  print('{} {} {} {}'.format(x3, y3, x4, y4)


if __name__ == '__main__':
  main()

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

    if x1 == x2 and y2 > y1:
        length = y2 - y1
        print(x2 - length, y2, x2 - length, y1)

    elif x1 == x2 and y1 > y2:
        length = y1 - y2
        print(x2 + length, y2, x2 + length, y1)

    elif y1 == y2 and x2 > x1:
        length = x2 - x1
        print(x2, y1 + length, x1, y1 + length)

    elif y1 == y2 and x1 > x2:
        print(x2, y1 - length, x1, y1 - length)


if __name__ == "__main__":
    main()

Submission status: Runtime Error

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

be=[x_2-x_1,y_2-y_1]
za3=[x_2+(-1)*be[1],y_2+be[0]]
za4=[x_1+(-1)*be[1],y_1+be[0]]

print(za3[0],za3[1],za4[0],za4[

Submission status: Runtime Error

Solution code:
import numpy as np
a = np.array(list(map(int, input().split())))
p1, p2 = a[:2], a[2:]

h1, h2 = p2 - p1
print(*(p2 + [-h2, h1]), *(p1 + [-h2, h1]))

Submission status: Runtime Error

Solution code:
import numpy as np
a = np.array(list(map(int, input().split())))
p1, p2 = a[:2], a[2:]

h1, h2 = p2 - p1
print(*p2 + [-h2, h1], *p1 + [-h2, h1])

Submission status: Runtime Error

Solution code:
import numpy as np
a = np.array(list(map(int, input().split())))
p1, p2 = np.split(a, 2)

h1, h2 = p2 - p1
print(*p2 + [-h2, h1], *p1 + [-h2, h1])

Submission status: Runtime Error

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

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

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

Submission status: Runtime Error

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

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

print(x3 y3 x4 y4)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import numpy as np

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

vx = x2-x1
vy = y2-y1

vx2,vy2 = np.array([[0,-1],[1,0]])@np.array([vx,vy])

x3 = x2+vx2
y3 = y2+vy2

vx3,vy3 = np.array([[0,-1],[1,0]])@np.array([vx2,vy2])

x4 = x3+vx3
y4 = y3+vy3

print(x3,y3,x4,y4)

Submission status: Runtime Error

Solution code:
x1,y1,x2,y2 = map(int,int(input().split())
h = max(abs(x2-x1),abs(y2-y1))
v = min(abs(x2-x1),abs(y2-y1))
if x1 > x2:
  if y1 > y2: print(x2+h,y2-v,x1+h,y1-v)
  else:print(x2-v,y2-h,x1-v,y1-h)
else:
  if y1 > y2: print(x2+v,y2+h,x1+v,y1+h)
  else:print(x2-h,y2+v,x1-h,y1+v)

Submission status: Runtime Error

Solution code:
def answer(in0, in1, in2, in3):
    x1 = int(in0)
    y1 = int(in1)
    x2 = int(in2)
    y2 = int(in3)

    width = (x2 - x1)
    height = (y2 - y1)

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

    print(x3, y3, x4, y4)

answer(input(), input(), input(), input())

Submission status: Runtime Error

Solution code:
import sys

# 関数 solve は，もちろん，問題に応じて書き換える
def solve(a,b,c,d):
    x = c-a
    y = d-b
    x3 = 0
    x4 = 0
    y3 = 0
    y4 = 0
    #print(x,y)
    x3 = c-y
    y3 = d+x
    x4 = x3-x
    y4 = y3-y
    return str(x3) + ' '  + str(y3) + ' ' str(x4) + ' '  str(y4) + ' '

# ここから下は，入力・出力形式が同じであれば，変えなくて良い．
def readQuestion():
    line = sys.stdin.readline().rstrip()
    [str_a, str_b, str_c, str_d] = line.split(' ')
    return (int(str_a), int(str_b), int(str_c), int(str_d))

def main():
    a, b, c, d = readQuestion()
    answer = solve(a, b, c, d)
    print(answer)
    
if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
import sys

# 関数 solve は，もちろん，問題に応じて書き換える
def solve(a,b,c,d):
    x = c-a
    y = d-b
    x3 = 0
    x4 = 0
    y3 = 0
    y4 = 0
    #print(x,y)
    x3 = c-y
    y3 = d+x
    x4 = x3-x
    y4 = y3-y
    return x3,x4,y3,y4

# ここから下は，入力・出力形式が同じであれば，変えなくて良い．
def readQuestion():
    line = sys.stdin.readline().rstrip()
    [str_a, str_b, str_c, str_d] = line.split(' ')
    return (int(str_a), int(str_b), int(str_c)), int(str_d))

def main():
    a, b, c, d = readQuestion()
    answer = solve(a, b, c, d)
    print(answer)
    
if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
import sys

# 関数 solve は，もちろん，問題に応じて書き換える
def solve(a,b,c,d):
    x = c-a
    y = d-b
    x3 = 0
    x4 = 0
    y3 = 0
    y4 = 0
    #print(x,y)
    x3 = c-y
    y3 = d+x
    x4 = x3-x
    y4 = y3-y
    return x3,x4,y3,y4

# ここから下は，入力・出力形式が同じであれば，変えなくて良い．
def readQuestion():
    line = sys.stdin.readline().rstrip()
    [str_a, str_b, str_c, str_d] = line.split(' ')
    return (int(str_a), int(str_b), int(str_c)), int(str_d))

def main():
    a, b, c = readQuestion()
    answer = solve(a, b, c, d)
    print(answer)
    
if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
fun main(args:Array<String>){
    val input = readLine()!!.split(" ")
    val x1 = input[0].toInt()
    val y1 = input[1].toInt()
    val x2 = input[2].toInt()
    val y2 = input[3].toInt()

    println("${x2-(y2-y1)} ${y2+(x2-x1)} ${x1-(y2-y1)} ${y1+(x2-x1)}")
}

Submission status: Runtime Error

Solution code:
x1, y1, x2, y2 = map(int, input().split())
dis1 = x2 - x1
dis2 = y2 - y1
print('{} {} {} {}').format(x2-dis2, y2+dis1, x1-dis2, y1+dis1)

Submission status: Runtime Error

Solution code:
%%test_input https://abc108.contest.atcoder.jp/tasks/abc108_b
x1, y1, x2, y2 = map(int, input().split())
dx = x2 - x1
dy = y2 - y1
x3, y3 = x2 - dy, y2 + dx
x4, y4 = x3 - dx, y3 - dy
print('{} {} {} {}'.format(x3, y3, x4, y4))

Submission status: Runtime Error

Solution code:
point1 = [0, 0]
point2 = [0, 0]
point1[0] = int(input())
point1[1] = int(input())
point2[0] = int(input())
point2[1] = int(input())
x = int(point2[0] - point1[0])
y = int(point2[1] - point1[1])

point3 = [point2[0] - y, point2[1] + x]
point4 = [point3[0] - x, point3[1] - y]
print(point3[0], point3[1], point4[0], point4[1])

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import numpy as np
if __name__ == '__main__':
    xy = [int(i) for i in input().split()]
    a1 = np.array([xy[0], xy[1]])
    a2 = np.array([xy[2], xy[3]])
    b = a2 - a1
    r = np.pi / 2
    rot = np.matrix((
        (np.cos(r), np.sin(r)),
        (-np.sin(r), np.cos(r))
    ))
    c = np.dot(b, rot)
    print('{} {} {} {}'.format(np.round(a3[0,0]), np.round(a3[0,1]), np.round(a4[0,0]), np.round(a4[0,1])))

Submission status: Runtime Error

Solution code:
import numpy as np

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

P_1 = np.array([x_1, y_1])
P_2 = np.array([x_2, y_2])
vec_12 = P_2 - P_1
vec_13 = np.array([-vec_12[1], vec_12[0]])
P_3 = P_1 + vec_13
P_4 = P_2 + vec_13
print(P_3[0], P_3[1], P_4[1], P_4[2])

Submission status: Runtime Error

Solution code:
x1 = int(input())
y1 = int(input())
x2 = int(input())
y2 = int(input())
v1x = x2 - x1
v1y = y2 - y1

v2x = -v1y
v2y = v1x
v3x = -v2y
v3y = v2x
x3 = x2 + v2x
y3 = y2 + v2y
x4 = x3 + v3x
y4 = y3 + v3y
print(x3, " ", y3, " ", x4, " ", y4)

Submission status: Runtime Error

Solution code:
x1, y1, x2, y2 = map(int, input().split(" "))
a_2 = (x1 - x2) ** 2 + (y1 - y2) ** 2
x2dash = x2 - x1
y2dash = y2 - y1
x3, y3, x4, y4 = [None, None, None, None]

for x in range(-250, 250):
	for y in range(-250, 250):
		first = (x2dash - x) ** 2 + (y2dash - y) ** 2
		second = x ** 2 + y ** 2
		if first == a_2 and second == 2 * a_2:
			if x2dash >= 0 and y2dash >= 0:
				if x <= x2dash and y >= y2dash:
					x3, y3 = [x, y]
					break
			elif x2dash >= 0 and y2dash <= 0:
				if x >= x2dash and y >= y2dash:
					x3, y3 = [x, y]
					break
			elif x2dash <= 0 and y2dash <= 0:
				if x >= x2dash and y <= y2dash:
					x3, y3 = [x, y]
					break
			else:
				if x <= x2dash and y <= y2dash:
					x3, y3 = [x, y]
					break

for x in range(-250, 250):
	for y in range(-250, 250):
		first = x ** 2 + y ** 2
		second = (x3 - x) ** 2 + (y3 - y) ** 2
		if first == a_2 and second == a_2 and x != x2dash and y != y2dash:
			x4, y4 = [x, y]
			break

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

Submission status: Runtime Error

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

xd= x2-x1
yd= y2-y1

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

elif xd < 0 and yd > 0:

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

elif xd < 0 and yd < 0:

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

elif xd >0 and yd < 0:

    x3 = x2 + abs(yd)
    y3 = y2 + abs(xd)
    x4 = x1 + abs(yd)
    y4 = y1 + abs(xd)


print(x3,y3,x4,y4)

Submission status: Runtime Error

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

    ans = editorial(x1, y1, x2, y2)
    assert ans == twi(x1, y1, x2, y2)
    print(*ans)


def twi(x1, y1, x2, y2):
    """
    https://twitter.com/akensho/status/1035924165205716992
    https://twitter.com/hogeover30/status/1035903937830764545
    """
    import math
    cos90 = int(math.cos(math.pi / 2))
    sin90 = int(math.cos(math.pi / 2))

    x = x2 - x1
    y = y2 - y1
    x4 = x * cos90 - y * sin90 + x1
    y4 = x * sin90 + y * cos90 + y1

    x = x1 - x4
    y = y1 - y4
    x3 = x * cos90 - y * sin90 + x4
    y3 = x * sin90 + y * cos90 + y4

    return x3, y3, x4, y4


def editorial(x1, y1, x2, y2):
    x = x2 - x1
    y = y2 - y1

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

    return x3, y3, x4, y4


if __name__ == '__main__':
    main()

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
#include<bits/stdc++.h>
using namespace std;
#define fs first
#define sc second
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define ALL(A) A.begin(),A.end()
#define RALL(A) A.rbegin(),A.rend()
typedef long long LL;
typedef pair<LL,LL> P;
const LL mod=998244353;
const LL LINF=1LL<<62;


int main(){
    int a,b,c,d;
    cin >> a >> b >> c >> d;
    cout << c-(d-b) << " " << d+(c-a) << " " << a-(d-b) << " " << b+(c-a) << endl;  
    return 0;
}

Submission status: Runtime Error

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



if (x1 <= x2 and y1 <= y2):
    x3 = x2 - zouka_y
    y3 = y2 + zouka_x

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

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

    x4 = x1 + zouka_y
    y4 = y1 - zouka_x
elif (x1 < x2 and y1 > 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: Runtime Error

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



if (x1 <= x2 and y1 <= y2):
    x3 = x2 - zouka_y
    y3 = y2 + zouka_x

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

    x4 = x1 - zouka_y
    y4 = y1 - zouka_x
elif (x1 < x2 and y1 < y2):
    x3 = x2 - zouka_y
    y3 = y2 - zouka_x

    x4 = x1 + zouka_y
    y4 = y1 + zouka_x
elif (x1 < x2 and y1 > 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: Runtime Error

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



if (x1 <= x2 and y1 <= y2):
    x3 = x2 - zouka_y
    y3 = y2 + zouka_x

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

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

    x4 = x1 - zouka_y
    y4 = y1 + zouka_x
elif (x1 < x2 and y1 > 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: Runtime Error

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



if (x1 <= x2 and y1 <= y2):
    x3 = x2 - zouka_y
    y3 = y2 + zouka_x

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

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

    x4 = x1 - zouka_y
    y4 = y1 + zouka_x
elif (x1 < x2 and y1 > 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: Runtime Error

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(-500, 500):
        for y in range(-500, 500):
            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(-500, 500):
        for y in range(-500, 500):
            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: Runtime Error

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.inf

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: Runtime Error

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(-200, 200):
        for y in range(-200, 200):
            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(-200, 200):
        for y in range(-200, 200):
            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: Runtime Error

Solution code:
import math
x1,y1,x2,y2=input().split()
x1=int(x1)
y1=int(y1)
x2=int(x2)
y2=int(y2)
if x2-x1==0:
    m1=math.inf
else:
    m1=(y2-y1)/(x2-x1)
if m1!=0:
    m2=-1/m1
else:
    m2=math.inf
c1=y1-m1*x1
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: Runtime Error

Solution code:
import math
x1,y1,x2,y2=input().split()
x1=int(x1)
y1=int(y1)
x2=int(x2)
y2=int(y2)
if x2-x1==0:
    m1=math.inf
else:
    m1=(y2-y1)/(x2-x1)
if m1!=0:
    m2=-1/m1
else:
    m1=math.inf
c1=y1-m1*x1
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: Runtime Error

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: Runtime Error

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 = x1 - (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: Runtime Error

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 = x1 - (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: Runtime Error

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

xx = x2 - x1
yy = y2 - y1

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

print(x3, y3, x4, y4)

Submission status: Runtime Error

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

    if y1 >= y2 and x1 > x2:
        dx = x1 - x2
        dy = y1 - y2

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

    elif x1 >= x2 and y1 > y2:
        dx = x2 - x1
        dy = y1 - y2

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

    elif y2 >= y1 and x2 > x1:
        dx = x2 - x1
        dy = y2 - y1

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

        x3 = x2 - dy
        y3 = y2 - dx
        x4 = x1 - dy
        y4 = y1 - dx
        
    print '%s %s %s %s' % (x3, y3, x4, y4)

main()

Submission status: Runtime Error

Solution code:
class Vec:
  def __init__(self, x, y):
    self.x = x
    self.y = y

  def __add__(self, other):
    return self.__class__(self.x + other.x, self.y + other.y)
  
  def __sub__(self, other):
    return self.__class__(self.x - other.x, self.y - other.y)

  def turned(self):
    return self.__class__(-self.y, self.x)


def main():
  x1, y1, x2, y2 = map(int, input().strip().split())
  p1 = Vec(x1, y1)
  p2 = Vec(x2, y2)
  vec = p2 - p1
  p3 = p2 + vec.turned()
  p4 = p3 - vec
  print(f"{p3.x} {p3.y} {p4.x} {p4.y}")


if __name__ == '__main__':
  main()

Submission status: Runtime Error

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

diffx = x1 - x2
diffy = y1 - y2

len_of_v = int((diffx ** 2 + diffy ** 2) ** 0.5)

if diffx == 0:
    x3 = x2 + diffy
    x4 = x1 + diffy
    y3 = y2
    y4 = y1
else:
    grad = diffy / diffx
    counter_grad = -1 / grad

    x3 = x2 + diffy
    y3 = y2 + diffy * counter_grad

    x4 = x1 + diffy
    y4 = y1 + diffy * counter_grad

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

Submission status: Runtime Error

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

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

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

print(x3, y3, x4, y4)

Submission status: Runtime Error

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

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(r1)+" "+str(r2)+" "+str(s1)+" "+str(s2))

Submission status: Runtime Error

Solution code:
l = raw_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: Runtime Error

Solution code:
# coding:utf-8

INF = float('inf')


def inpl(): return list(map(int, input().split()))


x1, y1, x2, y2 = inpl()

diff_y = y2 - y1
diff_x = x2 - x1
ans1 = [x2 - diff_y, y2 + diff_x]
ans2 = [ans1[0] - diff_x, ans1[1] - diff_y]
ans = ans1 + ans2
print(' '.join(map(str, ans))

Submission status: Runtime Error

Solution code:
xy=input().split()
x1=int(hw[0])
y1=int(hw[1])
x2=int(hw[2])
y2=int(hw[3])
a=x2-x1
b=y2-y1
print(x2-b,y2+a,x1-b,y1+a)