Solve problems 45,53 using Ruby.