cutting rod and print out the solution
---------------------------------------------------------------
dp works only under acyclic graph
-------------------------------------------------------------------------
LCS, longest common sub-sequence