Logo
(追記) (追記ここまで)

19229번 - Lexicography 스페셜 저지다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
3 초 512 MB112656160.396%

문제

Lucy likes letters. She studied the definition of the lexicographical order at school and plays with it.

At first, she tried to construct the lexicographically smallest word out of given letters. It was so easy! Then she tried to build multiple words and minimize one of them. This was much harder!

Formally, Lucy wants to make $n$ words of length $l$ each out of the given $n \cdot l$ letters, so that the $k$-th of them in the lexicographic order is lexicographically as small as possible.

입력

The first line contains three integers $n,ドル $l,ドル and $k$ (1ドル\le k \le n \le 1,000円$; 1ドル \le l \le 1,000円$) --- the total number of words, the length of each word, and the index of the word Lucy wants to minimize.

The next line contains a string of $n \cdot l$ lowercase letters of the English alphabet.

출력

Output $n$ words of $l$ letters each, one per line, using the letters from the input. Words must be sorted in the lexicographic order, and the $k$-th of them must be lexicographically as small as possible. If there are multiple answers with the smallest $k$-th word, output any of them.

제한

예제 입력 1

3 2 2
abcdef

예제 출력 1

af
bc
ed

예제 입력 2

2 3 1
abcabc

예제 출력 2

aab
bcc

힌트

출처

ICPC > Regionals > Northern Eurasia > Northern Eurasia Finals > Northern Eurasia Finals 2019 L번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /