#abc177c. [abc177_c]Sum of product of pairs
[abc177_c]Sum of product of pairs
Problem Statement
Given are integers .
Find the sum of over all pairs such that , modulo .
Constraints
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
Output
Print , modulo .
Sample Input 1
3
1 2 3
Sample Output 1
11
We have .
Sample Input 2
4
141421356 17320508 22360679 244949
Sample Output 2
437235829