409529: GYM103625 C One Piece
Description
Monkey D. Luffy has found the last clue necessary to pinpoint the location of the legendary One Piece! The clue is an unusual treasure map; it only has four scrawled integers $$$x_1, y_1, x_2, y_2$$$ along with the message:
"You shall find the greatest treasure of this world within a rectangle on the Cartesian plane with corners $$$(x_1, y_1)$$$ and $$$(x_2, y_2)$$$." - Gol D. Roger
However, there is a slight problem with this grand declaration. The two corners given may not always designate a unique rectangle! Luffy needs you, the intern navigator, to either let him know that the clue can lead to multiple possible rectangles or the area of the rectangle that must be searched for treasure.
InputThe first and only line of input will contain four space-separated integers $$$x_1, y_1, x_2, y_2$$$ as described above. The absolute value of all integers given as input will be at most $$$10^9$$$.
OutputOutput a single integer:
- If the clue could designate multiple possible rectangles, output $$$-1$$$.
- Otherwise, output the area of the unique rectangle where the One Piece is hidden.
0 0 1 1Output
1Input
0 0 1 0Output
-1