문제
After a long day of work, Farmer John completely forgot that he left his tractor in the middle of the field. His cows, always up to no good, decide to play a prank of Farmer John: they deposit N bales of hay
The location of the tractor, as well as the locations of the N hay bales, are all points in the 2D plane with integer coordinates in the range
Please help Farmer John determine the minimum number of hay bales he needs to remove so that he can free his tractor (that is, so he can drive his tractor to the origin of the 2D plane).
입력
Line 1: Three space-separated integers: N, and the (x,y) starting location of the tractor.
Lines
출력
Line 1: The minimum number of bales of hay Farmer John must remove in order to open up a path for his tractor to move to the origin.
예제1
7 6 3
6 2
5 2
4 3
2 1
7 3
5 4
6 4
1
Input Details
The tractor starts at (6,3). There are 7 bales of hay, at positions (6,2), (5,2), (4,3), (2,1), (7,3), (5,4), and (6,4).
Output Details
Farmer John only needs to remove one bale of hay to free his tractor.