Bob the penguin is part of a special species of penguins that can fly! He has recently discovered a peculiar fact: all the icebergs (even the floating ones!!) that he and his fellow flying penguin inhabit can be modelled as rectangles! In particular, Bob the penguin is examining a single iceberg with coordinates , in clockwise order of vertices, starting from the top left. He would like to know the area of the iceberg that is located above the x-axis, or in other words, the area of the region above the line
. However, since Bob the penguin isn't able to program this problem with his flippers, he asks you to help code this problem!
Input Specification
There will be lines of input, with the
line containing two space-separated integers
.
Output Specification
Output one integer, representing the total area of the iceberg that is located above the x-axis.
Constraints
For all subtasks,
Subtask 1 [50%]
All coordinates have a non-negative value, where
.
Subtask 2 [50%]
Sample Input
-3 2
7 2
7 -6
-3 -6
Sample Output
20
Sample Explanation
As observed in the graph, the portion above the x-axis has width and height
.
Comments