adds lcs recursive dyn prog