A point in the integer plane is defined by a pair of integers : first the x-axis coordinate, then the y-axis coordinate, as usual. Such a point defines an axis-parallel rectangle with respect to the origin of coordinates, namely . The other two corners are, clearly, and . What is the area of this rectangle? Write a function that receives two integers and and returns the area of the rectangle specified in this manner.
An approximate drawing of the public test cases, with points and could be:
|
3 -- - -- - -- - -- - -- p
| |
2 |
| |
1 |
| |
- -3 - -2 - -1 -- 0 -- 1 -- 2 -- 3 -- 4 -- 5 --
| |
q - -1
|
-2
|
>>> area(5, 3) 15 >>> area(3, 5) + area(-1, -1) 16