Time limit: 2s
Memory limit: 256MB
Input:
Output:
Task
Given an number and an array , we define its beauty as follows:
.
You are given a number and an array consisting of distinct positive integers.
You must find out the average beauty of all permutations of modulo .
Input data
The first line of input contains a single integer () - the length of array .
The second line of input contains integers () - the elements of array .
Output data
It is guaranteed that the real answer is of form where , are nonnegative integers .
You need to print the number .
Example 1
stdin
3
8 6 1
stdout
14
Example 2
stdin
4
10 0 1 7
stdout
24