Move rectangle X30583


Statement
 

pdf   zip

html

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.

Public test cases
  • Input

    100 200 0 0 50 100
    100 200 50 100 50 100
    100 200 100 200 50 100
    

    Output

    100 200 50 100
    100 200 100 200
    100 200 150 300
    
  • Information
    Author
    Gabriel Valiente
    Language
    English
    Official solutions
    Python
    User solutions
    C++ Python