Add problem 19, newly written from scratch.