Introduction - If you have any usage issues, please Google them yourself
Playground in a circle around the stones are placed n heap. Stone is to have the order to merge into a pile. Provisions can only choose 2 adjacent stones piled into a heap of new and new pile of stones a few in mind for its combined score. Try to design an algorithm to calculate the n heap into a pile of stones the minimum scores and maximum scores. For example, shown in Figure 1 of 4 Rockfill, each pile a few stones (from the top of a pile of several cases, clockwise number) followed by 4,5,9,4. 3 times the combined score is the sum of the smallest program for the Figure 2, the sum of scores for the largest program of Figure 3. Programming tasks: for a given n stack stone, into a pile of programming the calculation of the minimum scores and maximum scores.