Area of a piecewise rectangular figure