Untitled attachment
https://i.poastcdn.org/3fb01a5cf47665f9d03b663ec827b2898b89e1afbfe6bb012139d517cc5e059e.png
For a while I was getting filtered by part 2, but then I came across a hint that that the number of vertices of a polygon equals the number of sides (for polygons, start with a triangle and then use induction, and here we are just combing squares...) which made this easier to solve. Also helpful was printing out the grid but color-coded (pic 2 shows a test case).
GNU social JP is a social network, courtesy of GNU social JP管理人. It runs on GNU social, version 2.0.2-dev, available under the GNU Affero General Public License.
All GNU social JP content and data are available under the Creative Commons Attribution 3.0 license.