MathDB
diagonal forbidden!

Source: STEMS 2021 CS Cat A Q1

January 23, 2021
combinatorics

Problem Statement

Given is a n×nn\times n grid with all squares on one diagonal being forbidden. You are allowed to start from any square, and move one step horizontally, vertically or diagonally. You are not allowed to visit a forbidden square or previously visited square. Your goal is to visit all non forbidden squares. Find, with proof, the minimum number of times you will have to move one step diagonally