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 is inside a rectangle , @border@ if lies on the boundary of , and @outside@ if is outside . For example, the point is inside a rectangle of width , height , and lower-left corner , the point lies on the boundary of the rectangle, and the point is outside the rectangle.
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).
For each rectangle and point, print @inside@, @border@, or @outside@ according to the point being inside, on the boundary of, or outside the rectangle.
Author: Gabriel Valiente
Generation: 2026-01-25T16:50:34.548Z
© Jutge.org, 2006–2026.
https://jutge.org