Divide the grid into regions of orthogonally connected cells. Each cell should contain a number equal to the size of its region (ie the number of cells in its region). The size of any region must not divide the size of an orthogonally adjacent region.