dp[len] = max over first cut c of ( price[c] + dp[len − c] ). Watch each length try every first cut, keep the max, record the choice, then reconstruct the pieces on a rod.
choice[] backward: len → len − choice[len] until 0. See junior.md and professional.md
for the optimal-substructure proof that the best plan for len is the best first cut plus the best plan for the remainder.