Dynamic Programming Basic Problems