Teaser 3134: Stringing along

From The Sunday Times, 16th October 2022 [link]

An artist hammered thin nails from a pack of 40 into a board to form the perimeter of a rectangle with a 1 cm gap between adjacent nails. He created a work of art by stringing a long piece of wire from one nail to another, such that consecutive nails were on different edges of the rectangle. The wire started and ended at two different nails, no nail was used more than once and the length of the wire was a whole number of cm. No longer wire was possible that satisfied the above conditions.

What were the dimensions of the rectangle and the length of the wire chain (in cm)?

The wording of this puzzle was later revised. The underlined section was changed to a more restrictive condition.

See: Teaser 3134: Stringing along [revised] for the revised puzzle.

[teaser3134]