Palindrome Partition

CodeForces - 932G