459A.md (1528B)
1 Source: https://codeforces.com/problemset/problem/459/A 2 3 A. Pashmak and Garden 4 5 time limit per test 6 7 1 second 8 9 memory limit per test 10 11 256 megabytes 12 13 input 14 15 stdin 16 17 output 18 19 stdout 20 21 Pashmak has fallen in love with an attractive girl called Parmida since one year ago... 22 23 Today, Pashmak set up a meeting with his partner in a romantic garden. Unfortunately, Pashmak has forgotten where the garden is. But he remembers that the garden looks like a square with sides parallel to the coordinate axes. He also remembers that there is exactly one tree on each vertex of the square. Now, Pashmak knows the position of only two of the trees. Help him to find the position of two remaining ones. 24 25 Input 26 27 The first line contains four space-separated *x*1, *y*1, *x*2, *y*2 ( - 100 ≤ *x*1, *y*1, *x*2, *y*2 ≤ 100) integers, where *x*1 and *y*1 are coordinates of the first tree and *x*2 and *y*2 are coordinates of the second tree. It's guaranteed that the given points are distinct. 28 29 Output 30 31 If there is no solution to the problem, print -1. Otherwise print four space-separated integers *x*3, *y*3, *x*4, *y*4 that correspond to the coordinates of the two other trees. If there are several solutions you can output any of them. 32 33 Note that *x*3, *y*3, *x*4, *y*4 must be in the range ( - 1000 ≤ *x*3, *y*3, *x*4, *y*4 ≤ 1000). 34 35 Examples 36 37 Input 38 39 ``` 40 0 0 0 1 41 ``` 42 43 Output 44 45 ``` 46 1 0 1 1 47 ``` 48 49 Input 50 51 ``` 52 0 0 1 1 53 ``` 54 55 Output 56 57 ``` 58 0 1 1 0 59 ``` 60 61 Input 62 63 ``` 64 0 0 1 2 65 ``` 66 67 Output 68 69 ``` 70 -1 71 ```