You have a sequence of N non-negative integers. N <= 100 000. You need to find sum of multiplies of all pairs numbers and output this value by modulo P = 30 000.
Input:
The first line of input contains integer N, 1 <= N <= 100 000.
The second line contains N integers, all of them satisfy following condition: 0 <= x <= 10000.
Output:
Multiply of all pairs by modulo P.
Example:
Hint:
In example we have: 1 * 2 + 1 * 3 + 2 * 3 = 11.
Remember that James Gosling with us!
|