| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 1 초 | 1024 MB | 92 | 26 | 13 | 22.034% |
When a window of a text editor resizes, it is often necessary to readjust all of the containing words to fit in the screen window without splitting up any of the words. This is referred to as word-wrapping. Given a block of text, word-wrap the data to fit in a specific size.
The first line of input will contain a single integer n that indicates the number of datasets to follow. Each dataset will consist of:
Output the text word wrapped to the proper number of characters, and include one blank line after each dataset.
2 40 4 Chinua Achebe was born on November 16, 1930 into the Igbo African ethnic group in southern Nigeria. He was raised in a Christian family, but he was always fascinated by the traditional African religion and culture. 35 4 Achebe uses the short story of a hard working man in a war torn area with a bright outlook on life to act as a model for other Africans affected by the Nigerian Civil War.
Chinua Achebe was born on November 16, 1930 into the Igbo African ethnic group in southern Nigeria. He was raised in a Christian family, but he was always fascinated by the traditional African religion and culture. Achebe uses the short story of a hard working man in a war torn area with a bright outlook on life to act as a model for other Africans affected by the Nigerian Civil War.