Point and a rectangle
Very easy
Execution time limit is 1 second
Runtime memory usage limit is 128 megabytes
Determine whether the point (x, y) belongs to a rectangle with the ends of the diagonal (x[1]
, y[1]
), (x[2]
, y[2]
) and the sides parallel to coordinate axes.
Input
Six real numbers x, y, x[1]
, y[1]
, x[2]
, y[2]
- the coordinates of the point and the coordinates of diagonal ends of rectangle respectively. The numbers do not exceed 100 by absolute value.
Output
Print 1 if the point belongs to a rectangle (including the border), and 0 otherwise.
Examples
Input #1
Answer #1
Submissions 2K
Acceptance rate 34%