← RoseCode

ROSECODE 219

Conspicuous buildings

Philippe_57721 · Programming ·

In a city, all the buildings are located in the same district.

This district is a rectangle of size W by H, its sides are labelled South, East, North and West.
  • Each building occupies a 1-unit square, there are W*H buildings.
  • There height are all integers from 1 to W*H.
  • When we look at the buildings facing South face or East face, we can see each building, partly or totally. No building is hidden behind a higher one.
For a 2*3 rectangle, there are five possible arrangements for the buildings.



How many possible arrangements are there for a 15*20 rectangle?


Answer format: the count in compressed format as in problem 198.
[My timing: < 100 ms]