Company: Visa_1july
Difficulty: medium
Newspaper Text Formatting You are laying out a newspaper page. The text arrives as p paragraphs; each paragraph is a list of words. Every line of the page can hold at most width characters. Build the page like this: Each paragraph starts on a new line, and the words of a paragraph are placed in the order they are given. Words that share a line are separated by exactly one space, and that space counts towards width . A word is never split. If placing the next word on the current line would push the line past width characters, the current line ends there and the word starts the next line. A finished line is usually shorter than width . The leftover blanks are shared out so that the text sits in the centre of the line: half of them go before the text and half after. When the leftover is odd it cannot be split evenly — the two sides differ by one, and the larger share goes after the text. Finally, the page gets a rectangular border of asterisks ( * ). The border does not count towards widt