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
|
Author: José Luis Balcázar
Generation: 2026-01-25T17:10:22.094Z
© Jutge.org, 2006–2026.
https://jutge.org