General MotorsOA #1
Prepare Notification
估计简单可在线判题
考点(AI 标注)字符串
If the message is too long, keep the longest prefix of complete words and append a space and an ellipsis; otherwise return it unchanged; if even the first word does not fit, output just the ellipsis.
The standard input/output conventions and constraints added by this site are given under "Input".
输入格式
3≤K≤500; the message has 1..500 characters, consisting of letters and single spaces. The first line contains K, and the second line contains the message.
输出格式
Output the notification, whose length is ≤K.
样例 1
输入:
15
And now here is my secret
输出:
And now ...
样例 2
输入:
15
There is an animal with four legs
输出:
There is an ...
样例 3
输入:
4
super dog
输出:
...
样例 4
输入:
20
how are you
输出:
how are you