题目描述
Problem Description
Takahashi-kun manages a flower garden that boasts one of the largest areas in the world. In this flower garden, there is one flower that is considered the most beautiful in the world. The points in this flower garden are represented by their distance from this most beautiful flower. The position of a point that is $ x $ units east and $ y $ units south from the most beautiful flower is represented as $ (x, y) $. Takahashi-kun is very meticulous, so he always plants exactly one flower at each point $ (x, y) $ where both $ x $ and $ y $ are integers. No flowers are planted at any other points.
More formally, one flower is planted at every lattice point on the orthogonal coordinate system, and the most beautiful flower is planted at the origin. No flowers are planted at non-lattice points.
The most beautiful flower requires a large amount of water. Therefore, Takahashi-kun decided to install $ N $ sprinklers in the flower garden. Each sprinkler is installed at a point $ (x, y) $ where both $ x $ and $ y $ are integers. No two sprinklers are installed at the same position. Each sprinkler spreads water in a circular pattern. Increasing the radius allows the sprinkler to cover a larger area, but this is wasteful in terms of expenses. Therefore, each sprinkler is set to spray water just enough to reach the most beautiful flower. That is, the radius of the water spray is equal to the distance between the most beautiful flower and the sprinkler.
Takahashi-kun is curious about how many flowers will receive water when the sprinklers are activated.
Given the positions of the sprinklers, determine the number of flowers that will receive water.
Input Format
The input is given from the standard input in the following format:
$ N $ $ x_1 $ $ y_1 $ $ x_2 $ $ y_2 $ : $ x_N $ $ y_N $
- The first line contains the number of sprinklers to be installed, $ N(1≦N≦10^5) $.
- The following $ N $ lines each contain two integers $ x_i, y_i(-10^5≦x_i, y_i≦10^5) $ separated by a space. This indicates that the position of the $ i $ -th sprinkler is $ (x_i, y_i) $.
- $ (x_i, y_i) ≠ (x_j, y_j) $ holds for $ i ≠ j $.
- $ (x_i, y_i) ≠ (0, 0) $ always holds.
Output Format
Output the number of flowers that will receive water in one line. Ensure a newline at the end of the output.
Sample Input and Output
Sample Input #1
2
0 1
0 -1
Sample Output #1
9
Sample Input #2
2
3 1
1 4
Sample Output #2
74
Sample Input #3
4
3 4
4 3
-2 -2
-3 2
Sample Output #3
146
Notes/Hints
Partial Points
This problem has partial points.
- If you correctly solve all test cases where $ N≦100 $ and $ -100 ≦ x_i, y_i ≦ 100 $, you will be awarded 10 points.
- If you correctly solve all test cases where $ N≦1,000 $ and $ -1,000 ≦ x_i, y_i ≦ 1,000 $, you will be awarded an additional 20 points, totaling 30 points.
- If you correctly solve all test cases where $ N≦10^5 $ and $ -1,000 ≦ x_i, y_i ≦ 1,000 $, you will be awarded an additional 30 points, totaling 60 points.
- If you correctly solve all test cases where $ N≦10^5 $ and $ -10^5 ≦ x_i, y_i ≦ 10^5 $, you will be awarded an additional 40 points, totaling 100 points.
Sample Explanation 1
The following diagram illustrates the situation. The green dots represent flowers that receive water, and the red dot represents the position of the most beautiful flower. There are a total of 9 green and red dots. ![[MATH0]](/img/arc/022/4-2.png)
Sample Explanation 3
The following diagram illustrates the situation. 
输入格式
见题面 Input 部分
输出格式
见题面 Output 部分