프로그램 명: apio_palindrome
제한시간: 1 초

ou are given a string of lower-case Latin letters. Let us define substring’s “occurrence value” as the number of the substring occurrences in the string multiplied by the length of the substring. For a given string find the largest occurrence value of palindromic substrings.

Note

|s| is length of string s.
A substring of string s1s2 . . . s|s| is any non-empty string sisi+1 . . . sj , where 1 ≤ i ≤ j ≤ |s|. Any string is also its own substring.
A string is called palindromic, if it is read the same in either direction, from left to right and from right to left.
In the first sample there are seven palindromic substrings a, b, c, aba, aca, bacab, abacaba. So, the largest occurrence value of palindromic substrings is 7.

입력

The only line of input contains a non-empty string of lower-case Latin letters (a-z).

출력

one integer - the largest occurrence value of palindromic substrings.

입출력 예

입력

abacaba 

출력

7

입력

www 

출력

4
출처:apio 2014

[질/답] [제출 현황] [푼 후(0)]
[ 채 점 ] [홈으로]  [뒤 로]