Time limit: 0.5s
Memory limit: 128MB
Input:
Output:
There are points in a -dimensional space, represented by -tuples of integers ().
Task
Determine the sum of the squares of the Euclidean distances between all unordered pairs of points, modulo .
Input data
The first line contains the integers and , with their meaning specified above.
Each of the next lines contains a -tuplet of integers, representing the coordinate of point in -dimensional space.
Output data
The first line contains a single integer, the sum of the squares of the Euclidean distances between all unordered pairs of points modulo .
Constraints and clarifications
- For tests worth points,
- It is recommended to use fast I/O
Example 1
stdin
3 2
0 0
0 1
1 1
stdout
4
Explanation
There are dimensions.
.