Using the definitions
class Point:
"""attributes: x, y"""
class Rectangle:
"""attributes: width, height, corner"""
write a function
relationship_between_rectangles(r1, r2)
that returns @less than@ if @r1@ is inside @r2@, @greater than@ if @r2@ is inside @r1@, @overlap@ if @r1@ and @r2@ overlap, @equal@ if @r1@ and @r2@ are identical, and @disjoint@ otherwise (if @r1@ and @r2@ do not share any point).
The input consists of several pairs of rectangles (four non-negative integer numbers for each: the width, the height, and the coordinates of the lower-left corner).
For each pair of rectangles, print their relationship as shown below.
Author: Gabriel Valiente
Generation: 2026-01-25T17:00:50.010Z
© Jutge.org, 2006–2026.
https://jutge.org