In an allotment, a piece of land is divided in various lots that each have a different owner. Farmers used to have small pieces of land, that were often intertwined. Back then, a farmer had to walk or drive through the land of another farmer in order to reach his own lots. Today, because of the expansion in agriculture, square lots are used, and farmers strive to work with parcels that are as large as possible: rectangular areas of adjacent lots.

The example below shops a rectangular piece of land that was divided in $$10 \times 10$$ square lots. Three parcels (white triangles) are already taken into use by farmers. Search the surface of the largest possible parcel of which no lots are being used. In this example, this is a parcel that consists of 16 lots, as indicated by the striped rectangle.

verkaveling

Assignment

Define a class Allotment with the following methods:

Example

>>> allotment = Allotment(6, 6)
>>> print(allotment)
######
######
######
######
######
######
>>> allotment.largestParcel()
36
>>> allotment.reserve(3, 0, 5, 2)
>>> print(allotment)
######
######
######
---###
---###
---###
>>> allotment.largestParcel()
18
>>> allotment.reserve(0, 3, 2, 5)
>>> print(allotment)
###---
###---
###---
---###
---###
---###
>>> allotment.largestParcel()
9
>>> allotment.reserve(2, 2, 3, 3)
Traceback (most recent call last):
AssertionError: parcel can not be reserved
>>> print(allotment)
###---
###---
###---
---###
---###
---###