![]() |
||||||||||
|
||||||||||
Just a StringTime Limit: 2000/2000 MS (Java/Others) Memory Limit: 65535/32768 K (Java/Others)Total Submission(s): 1300 Accepted Submission(s): 259 Problem Description A substring of a string is a successive part of the string. Given a string your task is to find out the K-th alphabet order substring of the original string. For example, the string "ABC" contains six substrings: "A" "AB" "ABC" "B" "BC" "C" (in alphabet order) and string "BBC" also contains six substrings: "B" "B" "BB" "BBC" "BC" "C" (in alphabet order) Input The input contains several test cases, the first line of input contains the number of test cases. For each test case, there is only one line contains the string S of length N, followed by a integer K. (1 <= K <= N*(N+1)/2, 1 <= N <= 100000, S contains only letters and digits) Output For each test cases, output the K-th alphabet order substring. Sample Input
Sample Output
Author HyperHexagon Source | ||||||||||
|