You are given a special jigsaw puzzle consisting of n⋅mn⋅m identical pieces. Every piece has three tabs and one blank, as pictured below.
The jigsaw puzzle is considered solved if the following conditions hold:
The pieces are arranged into a grid with…