#P3975. [TJOI2015] 弦论
[TJOI2015] 弦论
Description
To boost her IQ, ZJY started studying string theory. One day, she saw the following problem in "String theory": Given a string of length , find its -th smallest substring. Can you help her?
Input Format
The first line contains a string consisting only of lowercase English letters.
The second line contains two integers and . If , identical substrings at different positions are counted as one; if , identical substrings at different positions are counted multiple times. The meaning of is as described above.
Output Format
Output exactly one line containing a string, which is the -th smallest substring. If there are fewer than substrings, output -1.
aabc
0 3
aab
aabc
1 3
aa
aabc
1 11
-1
Hint
Constraints
For of the testdata, .
For of the testdata, .
For of the testdata, , , .
Translated by ChatGPT 5
京公网安备 11011102002149号