
ZOJ Problem Set  3807
A palindrome is a symmetrical string, that is, a string read identically from left to right as well as from right to left. There're a string s and an operation defined on the string.
You are given the string, and you can perform the operation once. Please find the longest palindromic substring of string after you perform the operation. InputInput will consist of multiple test cases. Each test case contains exactly one line, which gives a nonempty string consisting of lowercase and uppercase letters. The length of the string will not be greater than 10^{5}. OutputFor each test case, print a line containing the test case number (beginning with 1) followed by the length of the longest palindrome. Sample Inputaaabbacaa Sample OutputCase 1: 8 HintThe longest palindrom of string "aaabbacaa" is "abba". If we exchange the 'a' and 'c', we will get "aaabbaaac". The longest palindrom is "aaabbaaa". Author: LIN, Xi Source: ZOJ Monthly, August 2014 