361Skyline

A small program that calculates the change in a skyline made by rectangular buildings in the distance.

Input is a number of tuples of the form (left,right,height)

Output is a number of pairs outlining the skyline. (xAxisPoint,heightChangedTo)

Example Input: (0.0,2.0,1.0) (1.0,4.0,2.0) (2.0,3.0,3.0) (5.0,6.0,2.0)

Example Output for Example Input: (0.0,1.0) (1.0,2.0) (2.0,3.0) (3.0,2.0) (4.0,0.0) (5.0,2.0) (6.0,0.0)