409529: GYM103625 C One Piece

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

C. One Piecetime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output

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.

Input

The 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$$$.

Output

Output 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.
ExamplesInput
0 0 1 1
Output
1
Input
0 0 1 0
Output
-1

加入题单

算法标签: