Given a N * M Grid of characters, as shown below:
00010 00110 00000
where \'1\' indicates a stone, find the rectangle with the largest perimeter such