UVA105 - The Skyline Problem

computational geometry, sweep line (or ad hoc: brute force, height map).