SP11407 TDOWN - Tied Down

Description

As we all know, Bessie the cow likes nothing more than causing mischief on the farm. To keep her from causing too much trouble, Farmer John decides to tie Bessie down to a fence with a long rope. When viewed from above, the fence consists of N posts (1

Input Format

\* Line 1: Four space-separated integers: N, M, bx, by. \* Lines 2..1+N: Line i+1 contains the space-separated x and y coordinates of fence post i. \* Lines 2+N..2+N+M: Each of these M+1 lines contains, in sequence, the space-separated x and y coordinates of a point along the rope. The first and last points are always the same as Bessie's location (bx, by).

Output Format

\* Line 1: The minimum number of posts that need to be removed in order for Bessie to escape by running to the right.