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.
Input
100 200 0 0 50 100 100 200 0 0 0 0 100 200 0 0 100 0 100 200 0 0 0 200 100 200 0 0 100 200 100 200 0 0 200 0 100 200 0 0 0 300 100 200 0 0 200 300
Output
inside border border border border outside outside outside