836

This problem also can be solved using Dynamic Programming.

Similar problems are : uva 108, uva 10074,uva 10667; These can be solved using the same algorithm.

12542

 

10780

 

10394

 

11347

 

11415

 

10856

 

10139