Greatest K-Palindrome Substring

UVA - 1239