Pascal exercise, use two indices!
Exercise 1-14 money change tree