Given an array of integers. Find the sum of for every pair , where .
The first line contains the size of array . The second line contains integers — the elements of array.
Print the the sum of modulo .
Consider the first test case.
Subarrays are .
Minimums are . Their sum is .