Center of rectangle X90614


Statement
 

pdf   zip

html

Using the definitions

class Point: """attributes: x, y""" class Rectangle: """attributes: width, height, corner"""

write a function

find_center(r)

that returns a point containing the coordinates of the center of a rectangle r. For example, the center of a rectangle of width 100, height 200, and lower-left corner (0, 0), is the point (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).

Output

For each rectangle, print the coordinates of the center (two non-negative real numbers).

Public test cases
  • Input

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

    Output

    50.0 100.0
    100.0 200.0
    150.0 300.0
    
  • Information
    Author
    Gabriel Valiente
    Language
    English
    Official solutions
    Python
    User solutions
    C++ Python