B - Ruined Square 解説 /

実行時間制限: 2 sec / メモリ制限: 1024 MB

配点 : 200

問題文

xy 平面上に正方形があり、4 つの頂点の座標は反時計回りに順番に (x_1,y_1),(x_2,y_2),(x_3,y_3),(x_4,y_4) です。 なお、x 軸は右向きに、y 軸は上向きに取ることにします。

高橋君は、これら 4 つの座標のうち (x_3,y_3),(x_4,y_4) を忘れてしまいました。

x_1,x_2,y_1,y_2 が与えられるので、x_3,y_3,x_4,y_4 を復元してください。なお、これらの条件から、x_3,y_3,x_4,y_4 は一意に存在し、整数となることが証明できます。

制約

  • |x_1|,|y_1|,|x_2|,|y_2| \leq 100
  • (x_1,y_1)(x_2,y_2)
  • 入力はすべて整数である

入力

入力は以下の形式で標準入力から与えられる。

x_1 y_1 x_2 y_2

出力

x_3,y_3,x_4,y_4 をこの順に整数で出力せよ。


入力例 1

0 0 0 1

出力例 1

-1 1 -1 0

4(0,0),(0,1),(-1,1),(-1,0) は、この順に正方形を反時計回りに見たときの 4 頂点をなします。 (x_3,y_3)=(1,1),(x_4,y_4)=(1,0) は、頂点が時計回りに並んでいるので適さないことに注意してください。


入力例 2

2 3 6 6

出力例 2

3 10 -1 7

入力例 3

31 -41 -59 26

出力例 3

-126 -64 -36 -131

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