Any help appreciated. Thanks. Consider a problem of neatly prining a paragraph w
ID: 3634773 • Letter: A
Question
Any help appreciated. Thanks.
Consider a problem of neatly prining a paragraph with variable width font. The input is the sequence of word lengths L[I],....., L[n], and S, the minimum allowed space. We need partition the text into lines, i.e. express n as a sum of positive integers a1 + .....+ ak. This partition defined the first word in each line: first[1] = 1 for short, first[i] = f[i], and f[i+ 1] = f[i] + ai. In term, this defines the length of each line: L[i] = S times (ai - 1) + A solution a1, . . . ,ak is correct if L[i]