
Once a year, all creatures in the Lylot System, big and small, take some time off in order to remember the great sacrifices that soldiers have made in order to keep the Lylot System safe from evils such as the Space Pirates and the Dankey Kang Gang. In the Lylot System, this day is called "Remembrance Day."
Today, Fax is in charge of firing a large space cannon as part of the Remembrance Day ceremony. However, he needs to make sure that no planets are in danger. In particular, there are
The cannon projectile's path can be modeled using an
Fax needs to ensure that no planet is on the path of the cannon projectile and that no planet is caught in the final explosion area, even at the edge. Can you help Fax to determine how many planets are in danger?
Input Specification
The first line of input will contain four space-separated integers,
Output Specification
On a single line, output the number of planets in the path of the cannon projectile or in the explosion area.
Sample Input
6 3 5 2
1 1
2 0
3 3
5 2
6 1
4 -5
1
-7
10
Sample Output
3
Explanation for Sample Output
In the diagram, the blue curve represents the cannon projectile's path, the red circle represents the explosion area, and the black points represent the locations of planets. The planets located at
Comments