human
Maximize the sum of arr [ i ] * i | Python program to find the maximum value of i * arr [ i ].
Sort the array.
Finding the sum of arr [ i ] * i.
Driver Program"
Solution in Python:
assistant
#Here is code to maximize the sum of arr [ i ] * i and the other steps required.
 def maxSum ( arr , n ) :
	arr . sort ( )
	sum = 0
	for i in range ( n ) :
		sum += arr [ i ] * i
	return sum
arr = [ 3 , 5 , 6 , 1 ]
n = len ( arr )
print ( maxSum ( arr , n ) )