Solves problem 23
Solves problem 27
Solves problem 30
Problem setup