Embryo is about to be defeated. All that's left to do is to launch
Note that all beams just barely touch both corners of the base at
Unfortunately, the large amount of spacetime convergence cannons means that some friendly fire is inevitable. The disadvantage for a single spacetime convergence cannon is the square of the number of other friendly spacetime convergence cannons that hit it. The disadvantage of the entire operation is the sum of the disadvantage values for each individual spacetime convergence cannon. Given
Input Specification
The first line of input contains two integers
The next
Constraints
For all subtasks:
Subtask 1 [5%]
All x-coordinates of the cannons will be the same.
Subtask 2 [5%]
All y-coordinates of the cannons will be the same.
Subtask 3 [5%]
Subtask 4 [15%]
Subtask 5 [70%]
No additional constraints.
Output Specification
Output the total disadvantage on one line.
Sample Input
5 10
1 1
3 2
5 1
6 4
10 1
Sample Output
5
Explanation of Output for Sample Input
The second cannon is hit by the fourth cannon, so its disadvantage is
The third cannon is hit by both the second and fourth cannons, so its disadvantage is
The total disadvantage is
A diagram of this case is given in the problem statement.
Comments