#asaporof. [asaporo_f]Problem where Commas Separate Digits
[asaporo_f]Problem where Commas Separate Digits
Problem Statement
You are given a string consisting of digits between 1
and 9
, inclusive. You will insert at most commas (,
) into this string to separate it into multiple numbers.
Your task is to minimize the maximum number among those produced by inserting commas. Find minimum possible such value.
Constraints
- consists of digits between
1
and9
, inclusive.
Partial Scores
- In the test set worth points, .
- In the test set worth another points, .
- In the test set worth another points, .
- In the test set worth another points, .
Input
The input is given from Standard Input in the following format:
Output
Print the minimum possible value.
Sample Input 1
2
15267315
Sample Output 1
315
When the string is separated into , and , the maximum among these is , which is the minimum possible value.
Sample Input 2
0
12456174517653111
Sample Output 2
12456174517653111
itself is the answer.
Sample Input 3
8
127356176351764127645176543176531763517635176531278461856198765816581726586715987216581
Sample Output 3
5317635176