```
def maxRotateFunction(self, A):
"""
:type A: List[int]
:rtype: int
"""
n = len(A)
value = 0
for i in range(n):
value += i * A[i]
max_value = value
sumA = sum(A)
for i in range(n):
value = value + sumA - n*A[n-i-1]
max_value = max(max_value, value)
return max_value
```