CF1310C.Au Pont Rouge

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

VK just opened its second HQ in St. Petersburg! Side of its office building has a huge string ss written on its side. This part of the office is supposed to be split into mm 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 ss written on its side.

For each possible arrangement of mm 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 kk th label of the delivery?

输入格式

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

Second input line has string ss , consisting of nn lowercase english letters.

For given n,m,kn, m, k there are at least kk ways to split ss into mm substrings.

输出格式

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

输入输出样例

  • 输入#1

    4 2 1
    abac

    输出#1

    aba
  • 输入#2

    19 5 1821
    aupontrougevkoffice

    输出#2

    au

说明/提示

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

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

首页