Problem 21.

Executes in a few seconds; may well be a faster way.