Move rectangle

Using the definitions

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

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

write a function

    move_rectangle(r, dx, dy)

that changes the location of a rectangle r by adding (dx, dy) to the
lower-left corner. For example, moving a rectangle of width 100, height
200, and lower-left corner (0, 0) by (50, 100), is a rectangle of width
100, height 200, and lower-left corner (50, 100).

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 displacement (two non-negative integer
numbers).

Output

For each rectangle and displacement, print the result of moving the
rectangle by the displacement.

Problem information

Author: Gabriel Valiente

Generation: 2026-01-25T15:02:45.366Z

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