Rod Cutting Profit

Given a rod of total length length and an array prices where prices[i] is the selling price of a piece of length i + 1, return the maximum total revenue obtainable by cutting the rod into pieces with integer lengths.

You must partition the entire rod into pieces whose lengths sum to length (a mandatory full cut). Making no cuts means using the whole rod as one piece of length length. For each cut length j from 1 to length, the piece value is prices[j - 1] when j <= prices.length; if a piece length is not listed in prices, its listed price is treated as 0 by the existing problem contract/implementations.

Examples
Input: [[1,5,8,9,10,17,17,20],8]
Output: 22
Hints
Related Problems

Rod Cutting Profit

Given a rod of total length `length` and an array `prices` where `prices[i]` is the selling price of a piece of length `i + 1`, return the maximum total revenue obtainable by cutting the rod into pieces with integer lengths.