VK Cup 2019-2020 - Elimination Round (Engine)
C
Au Pont Rouge
Codeforces
2800
原题
← BD →
翻译中…

VK just opened its second HQ in St. Petersburg! Side of its office building has a huge string $s$ written on its side. This part of the office is supposed to be split into $m$ meeting rooms in such way that meeting room walls are strictly between letters on the building. Obviously, meeting rooms should not be of size 0, but can be as small as one letter wide. Each meeting room will be named after the substring of $s$ written on its side.

翻译中…

image

翻译中…

For each possible arrangement of $m$ meeting rooms we ordered a test meeting room label for the meeting room with lexicographically minimal name. When delivered, those labels got sorted backward lexicographically.

翻译中…

What is printed on $k$th label of the delivery?

翻译中…

Input

翻译中…

In the first line, you are given three integer numbers $n, m, k$ — length of string $s$, number of planned meeting rooms to split $s$ into and number of the interesting label ($2 \le n \le 1\,000; 1 \le m \le 1\,000; 1 \le k \le 10^{18}$).

翻译中…

Second input line has string $s$, consisting of $n$ lowercase english letters.

翻译中…

For given $n, m, k$ there are at least $k$ ways to split $s$ into $m$ substrings.

翻译中…

Output

翻译中…

Output single string – name of meeting room printed on $k$-th label of the delivery.

翻译中…

Note

翻译中…

In the first example, delivery consists of the labels "aba", "ab", "a".

翻译中…

In the second example, delivery consists of $3060$ labels. The first label is "aupontrougevkof" and the last one is "a".

翻译中…

样例

Input #1
4 2 1
abac
Output #1
aba
InputCopy OutputCopy
Input #2
19 5 1821
aupontrougevkoffice
Output #2
au
InputCopy OutputCopy
题目信息
题号
1310C
时间限制
2 s
内存限制
512 MB
标签
二分
动态规划
字符串

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。