#P6095. [JSOI2015] 串分割
[JSOI2015] 串分割
Description
JYY wrote a circular string of length that contains only the different characters 1, 2, , 9. JYY wants to cut exactly times, splitting it into non-empty substrings. For each substring, since it contains only digits, we can treat it as a decimal number. Therefore, after cuts, JYY can obtain different decimal numbers. JYY wants the largest among these numbers to be as small as possible.
Input Format
The first line contains two integers and .
The second line contains a string of length .
Output Format
Output one line containing a positive integer, which is the minimum possible value of the largest number among the numbers obtained in an optimal splitting plan.
4 2
4321
32
Hint
For of the testdata, , .
Translated by ChatGPT 5
京公网安备 11011102002149号