how to apply dynamic programming

join shbcf.ru