Given string S of N (N<=100 000) characters (each character is digit). Also given, L and R (L <= R<= 109 ). Find maximum sum that is possible to obtain cutting the string in such a way that every part has value <=R and >=L.
Input: N L R S
Test case:
8 13 997
81196054
Output: 1825
Explanation: These are all possible cuts. Last cut is best
1. 81|19|60|54
2. 81|196|054
3. 811|96|054
4. 811|960|54