spoj problem mixtures, recursive solution working. try dp now