p14 with dynamic programming
p015