Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
Language: Alignments
Description HTML supports four different text alignments:
Text-based browsers render aligned texts by inserting spaces between neighboring words. Here words are strings consisting of non-space characters. Now you are to implement a small routine that simulates the text-browsers’ behaviors in rendering aligned texts specified in the table below:
Your routine works in a greedy manner, that is, as many as possible words should be put into the first line, then as many as possible words should be put into the second line, etc.. Line width is fixed in your routine to be 75 characters. Input The input contains a single test case on multiple lines. The first line contains only one character among “ Output Just print out the rendered text produced by your routine. Sample Input J Many years later, as he faced the firing squad, Colonel Aureliano Buendia was to remember that distant afternoon when his father took him to discover ice. Sample Output Many years later, as he faced the firing squad, Colonel Aureliano Buendia was to remember that distant afternoon when his father took him to discover ice. Hint Trailing spaces at the end of each output line can be ignored, though keeping them is also acceptable. Source |
[Submit] [Go Back] [Status] [Discuss]
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator