Doubt in Dp problem

https://codeforces.com/problemset/problem/189/A

what can be the approach to solve it in dp?
pls help me

@dare_devil_007,
Here is my submission link, I have explained the dp in comments.

Bro i am not able to understand the code.Could you pls explain it

@dare_devil_007,
dp[i] = max no of pieces ribbon of length I can be cut in.
There are three possibilities of cutting the suffix of ribbon, namely of length a, or length b or length c.
Simply dp[I] will be maximum from those choices. Also take care that whether it is possible to have a ribbon of length I-a etc., cause if not it would not contribute to dp[I].

it was mentioned in the question that after cutting the ribbon the length of the remaining ribbon should be a,b or c right?? but why we r cutting lengths of a,b,c ?

@dare_devil_007,
Not the remaining length, length of each piece should be a,b or c.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.