Broken stick problem
Homework?

See the problem "Cutting Wood", which involves cutting rather than glueing, but is otherwise equivalent. Provided the orders matters (as noted by Marzio).


  Your favorite sawmill charges by length to cut each board of lumber. 
  For example, to make one cut anywhere on an 8 ft. board of lumber costs \$8. 
  The cost of cutting a single board of wood into
  smaller boards will depend on the order of the cuts.
  As input, you are given a board of length $n$ marked with $k$ locations to cut


solution to exercise (pdf) Found in several places on the web, don't know the original.