Rectangle
题号:NC15935
时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 64 M,其他语言128 M
64bit IO Format: %lld

题目描述

There is a rectangular area in 2 dimensional Cartesian coordinate system. Its width is w, height is h and left bottom point is (0,0). A circle and some key points are in this area. In the area (including the boundary), point A is visible to B if and only if the segment AB doesn’t intersect with the circle (As a special case, A is visible to B if the segment is tangent to the Circle). Now you can choose a point P in the area (this point doesn’t need to be key points, it can be any point in the area including the boundary points). Let k denote the number of key points that are visible to P. Your task is to calculate the maximum k.

输入描述:

The first line is an integer T, representing the
number of test cases.

For each test case:

The first line are two integers h, w, denoting the
width and height of the rectangular area.

The second line are three integers r,cx,cy,
representing the radius of the circle and the position of the center.

The third line is an integer n, denoting the number
of key points.
n<=10000
Then n lines follow. Each line contains two integer xI,yI, representing
the position of the ith key point.

It is guaranteed that the circle is inside the
rectangular area (possibly tangent to the boundary), and all key points are
inside the area but outside the circle.

输出描述:

For each test case, output the maximum number of
visible key points.
示例1

输入

复制
2
65 51
2 15 7
6
42 42
22 42
46 13
16 44
29 12
19 29
20 20
4 14 10
4
7 13
3 9
1 1
15 4

输出

复制
6
4