In a 10x10 grid, there are 100 cells. A partition in this grid is a contiguous collection of cells meaning any two cells of a partition are connected through a path of cells in the partition itself. In how many ways can 5 partitions be created in this grid? Needless to say this can be generalized. Suggesting simpler variants and their solutions are also helpful.
A simple variant is when all partitions must share at least one cell on the boundary. No overlapping is allowed also. The partitions should add up to cover the entire grid. Each partition may have any non-zero number of cells.
Suggestion of an algorithm however computationally inefficient so that counting is done by computer would also be good if a mathematical technique is difficult to come by.