Min Cost Permutation

https://hack.codingblocks.com/app/practice/5/1019/problem

In this question, we are supposed to calculate the min cost. also, cost of a[i] at jth position is a[i]*j
So, in the example a[]={1,2,3,4,5}
For minimum cost we will rearrange a[] to have permutation {5,4,3,2,1} and now multiply a[i] with j(1 to 5)
When I follow this approach, cost = 35, wheres in the question it is 40