N stones lying in a line
ith stone ai unitsith stone is iN types of stonesCan perform this operation 0 or more times to change types of all stones in one step:
i will change to type i+1N, change to type 1Cost of this operation is x units
Calculate minimum price to collect all types.
N < 2000, x < 10^9
N=3, x=5 [50, 1, 50]
Output: 13