cswork / OAOpen practice workspace

General MotorsOA #1

Prepare Notification

Estimated EasyJudge-ready

Topics (AI-labelled)Strings

メッセージが長すぎる場合は、完全な単語からなる最長の接頭辞を残し、スペースと省略記号を付け加えます。そうでなければそのまま返します。最初の単語すら収まらない場合は、省略記号だけを出力します。

入力

3≤K≤500。メッセージは 1..500 文字で、英字と単一のスペースからなります。1 行目に K、2 行目にメッセージが与えられます。

出力

通知を出力してください。その長さは 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

Editorial

Loading solution…