To draw the map of a country, you need to determine a rectangle that encloses the whole country. This rectangle is called the bounding box of the country. If you know the $$x$$- and $$y$$-coordinates of some points that are on the border of the country, the sides of the bounding box can be found in the following way:

The position and size of a rectangle can be described by the coordinates of two of its opposing corner points. The bounding box of a country is thus fully described if you know two points: the point with the minimum of all $$x$$- and $$y$$-coordinates and the point with the maximum of all $$x$$- and $$y$$-coordinates.

Assignment

Write a function boundingbox that takes a list of tuples as its only argument. Each tuple contains two real-valued numbers that represent the coordinates of a point on the border of a country. The function must return the coordinates of the two opposing corner points that describe the bounding box of the country. The first corner point is the point with the minimum of all $$x$$- and $$y$$-coordinates and the second point is the point with with the maximum of all $$x$$- and $$y$$-coordinates. Inspect the examples below to find out the details about the return value of the function. If your answer is correct or incorrect, you will find on the feedback page a graphical representation of the bounding boxes as determined by your implementation.

Example

>>> boundingbox([(0.0, 1.0), (1.0, 0.0)])
[(0.0, 0.0), (1.0, 1.0)]
>>> border = [(51.2632, 4.3024), (51.3751, 4.2524), (51.4867, 5.0414),
...           (51.1564, 5.8492), (50.8397, 5.6408), (50.7573, 6.0118),
...           (50.3232, 6.3982), (50.1278, 6.1344),(50.1813, 6.0263),
...           (49.545, 5.8079), (49.7972, 4.8731), (50.1686, 4.8325),
...           (49.9784, 4.1492), (50.2831, 4.165), (51.0911, 2.5417),
...           (51.3739, 3.3709), (51.3504, 4.2389), (51.2632, 4.3024)]
>>> boundingbox(border)
[(49.545, 2.5417), (51.4867, 6.3982)]