minimum cost of cutting a given stick
longest common strings