Easy one just Dynamic Programming and the way of calculator.