#include #include #include #include #include void initialize(char* s) int main() { char* s = (char *)malloc(512000 * sizeof(char)); scanf("%s", s); initialize(s); int q; scanf("%i", &q); for(int a0 = 0; a0 < q; a0++){ int l; int r; scanf("%i %i", &l, &r); int result = answerQuery(l, r); printf("%d\n", result); } return 0; } int answerQuery(int l, int r) { int l= strlen(s); printf("%d\n", l); int i,j,k; int start,end,max=0,curr; if(length == 0) { printf("string null"); } if(l%2!=0) { //if string is of odd length for(i=0;i0 && k max) { max = curr; start = j; end = k; } } for(i=start;i<=end;i++) printf("%c", s[i]); printf("\n"); return s[i]; } else { //if string is of even length for(i=0;i=0 && k<=l-1 && s[j--]==s[k++]); curr = k-j-1; if(max < curr) { max = curr; start = j+1; end = k-1; } } for(i=start;i<=end;i++) printf("%c", s[i]); printf("\n"); } } } } return 0; }