Point in rectangle

Using the definitions

class Point:
    """attributes: x, y"""

class Rectangle:
    """attributes: width, height, corner"""

write a function

point_in_rectangle(p, r)

that returns @inside@ if a point pp is inside a rectangle rr, @border@ if pp lies on the boundary of rr, and @outside@ if pp is outside rr. For example, the point (50,100)(50, 100) is inside a rectangle of width 100100, height 200200, and lower-left corner (0,0)(0, 0), the point (100,200)(100,200) lies on the boundary of the rectangle, and the point (200,300)(200, 300) is outside the rectangle.

Input

The input consists of several rectangles (four non-negative integer numbers: the width, the height, and the coordinates of the lower-left corner), each followed by a point (two non-negative integer numbers).

Output

For each rectangle and point, print @inside@, @border@, or @outside@ according to the point being inside, on the boundary of, or outside the rectangle.

Problem information

Author: Gabriel Valiente

Generation: 2026-01-25T16:50:34.548Z

© Jutge.org, 2006–2026.
https://jutge.org