Fito invented a game with pumpkins on a $N \times N$ grid. The aim of the game is to put the pumpkins together. The only possible step in the game is to move one pumpkin to another position that has at least one pumpkin and shares the same column or the same row (moving a pumpkin to a position that doesn't contain any pumpkin is not allowed). Also, all the positions between the pumpkin to be moved and the target positions should be empty. For example, in (a) the movement indicated with the red dashed arrow is not allowed.
The game finishes when no pumpkin can be moved and Fito counts then how many positions with pumpkins remain at the end. For example, for the initial configuration in (a), two possible endings are shown in (b) and (c). Fito wants you to help him compute two values: the (1) minimum and the (2) maximum possible number of positions with pumpkins at the end of the game.