Divide the grid into regions of orthogonally connected cells. Two regions of the same size may not share an edge. Enter a number into each cell equal to the size of its region (ie the number of cells in its region). Consider N the number in the top-left corner of a cell with arrows. Arrows indicate ALL the directions (up, down, left, and right) where the NEAREST occurrence(s) of N is/are located. The number placed in that cell indicates the distance to the first occurrence of N in the indicated direction(s).