Fences

January 2019 : Puzzle

A 17-by-17 field is divided into unit squares. Some of the squares contain “posts” at their center. Each post is represented below by a number. Construct one or more fences emanating from each post, such that the total length of fence connected to a post equals the number given. Fences have integer length and can only be constructed horizontally or vertically. Fences from different posts may not touch, nor may a fence from one post touch a different post.

The goal of this puzzle is to build your fences in such a manner that it is possible to draw a closed loop through some of the remaining empty squares. The loop must enclose at least one post, and must be symmetric in some way (either via rotation or reflection). As in the example, the loop must be rectilinear, passing through the centers of adjacent empty squares.

The answer to this puzzle is the product of the fence-lengths of the fences inside the loop.