atcoder#ABC290E. [ABC290E] Make it Palindrome
[ABC290E] Make it Palindrome
Score : points
Problem Statement
For a sequence , let (the minimum number of elements one must modify to make a palindrome).
Given a sequence of length , find the sum of over all contiguous subarrays of .
Here, a sequence of length is said to be a palindrome if and only if the -th and the -th elements of are equal for all .
Constraints
- All values in the input are integers.
Input
The input is given from Standard Input in the following format:
Output
Print the answer as an integer.
5
5 2 1 2 2
9
Therefore, the sought answer is .