cho.sh
Notes
Loading...

Spiderweb

Time limit

2s

Memory limit

128 MB

Problem

Dongju wants to create a large spiderweb-shaped artwork in a field.

The N pillars are placed as the vertices of a convex polygon. Dongju may connect two pillars with a rope only if all of the following conditions are satisfied.

  • Two adjacent pillars of the polygon cannot be connected.
  • No two ropes may cross. Ropes that meet at the same pillar are allowed.
  • The field contains G circular puddles, each with radius R. A rope must not pass through the interior or boundary of any puddle.

Find the maximum number of ropes that can be connected while satisfying all conditions.

Input

The first line contains the number of pillars N (1 ≤ N ≤ 150), the number of puddles G (0 ≤ G ≤ 100), and the puddle radius R (1 ≤ R ≤ 100,000).

Each of the next N lines contains the coordinates x and y of one pillar. Each of the following G lines contains the coordinates x and y of the center of one puddle.

All coordinates are integers between 0 and 1,000,000 inclusive, and all coordinate points appearing in the input are distinct. The given pillars are the vertices of one convex polygon.

Output

Print the maximum number of ropes that can be connected.