Problem AA
Greeting Card

Quido plans to send a New Year greeting to his friend Hugo. He has recently acquired access to an advanced high-precision plotter and he is planning to print the greeting card on the plotter.
Here’s how the plotter operates. In step one, the plotter
plots an intricate pattern of
The plotter uses a special holographic ink, which has a limited supply. Quido wants to know the number of all plotted segments in the picture to be sure that there is enough ink to complete the job.
Input
The first line of input contains a positive integer
In this problem, all coordinates and distances are expressed in plotter length units, the length of the unit in the x-direction and in the y-direction is the same.
Output
The output contains a single integer equal to the number of
pairs of points which are exactly
Sample Input 1 | Sample Output 1 |
---|---|
4 20180000 20180000 20180000 20182018 20182018 20180000 20182018 20182018 |
4 |
Sample Input 2 | Sample Output 2 |
---|---|
6 0 0 1680 1118 3360 0 5040 1118 6720 0 8400 1118 |
5 |