시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
---|---|---|---|---|---|
2 초 | 512 MB | 0 | 0 | 0 | 0.000% |
Nili company want to develop a simple text editor. Mohammad as the member of development team has been assigned to work on an essential feature - the justify line. You have already used a word processing software and specifically the justify line feature. Help him and write a program that gets the lines as input and print them out justified.
Here is what you should keep in mind while writing the program:
First line contains the max number of characters per line (C >= 50).
Next N lines (N < 100000) each containing W words (W < 10000).
Input ends with the line ENDOFINPUT
. It is not part of input.
Note: There is no word bigger than C.
Print the lines justified.
50 The International Collegiate Programming Contest, known as the ICPC, is an annual multi-tiered competitive programming competition among the universities of the world. Headquartered at Baylor University, directed by ICPC Executive Director and Baylor Professor Dr. William ENDOFINPUT
The International Collegiate Programming Contest, known as the ICPC, is an annual multi-tiered competitive programming competition among the universities of the world. Headquartered at Baylor University, directed by ICPC Executive Director and Baylor Professor Dr. William
There should be only 50 characters in a line. So: