This is the same problem as Rateo. You will see other methods of solution used there.