[POI2008] PLA-Postering(单调栈)
题目描述
All the buildings in the east district of Byteburg were built in accordance with the old arbitecture:
they stand next to each other with no spacing inbetween.
Together they form a very long chain of buildings of diverse height, extending from east to west.
The mayor of Byteburg, Byteasar, has decided to have the north face of the chain covered with posters.
Byteasar ponders over the minimum number of posters sufficient to cover the whole north face.
The posters have rectangular shape with vertical and horizontal sides.
They cannot overlap, but may touch each other, i.e. have common points on the sides.
Every poster has to entirely adjoin the walls of certain buildings and the whole surface of the north face has to be covered.
Task Write a programme that:
reads the description of buildings from th