SP18666 UVA1 - Radiation

Description

Nuclear power plants (NPP) are a blessing and curse of modern civilization. NPPs have some risks but still it is one of the cheapest ways to produce electricity in the developed world. In this problem we will discuss a situation related to two nuclear plants, which are not far away from each other. ![](https://cdn.luogu.com.cn/upload/vjudge_pic/SP18666/ceb8ede35be5c4cda8253b45b564d709df16790b.png) Figure 1: Two Nuclear Power Plants. Houses at (81, 49) and (77,33) are at high risk from both the plants. We will describe the entire scenario in a at land, so two-dimensional Cartesian coordinate system is used to denote each location. Lets assume that the coordinate of the two nuclear power plants are (ax;ay) and (bx;by). Houses that are located within distance R1 (inclusive) of the power plant at (ax;ay) are under high risk of radiation. Similarly, houses that are located within distance R2 (inclusive) of the power plant at (bx;by) are under high risk of radiation. So the authorities of power plant 1 and power plant 2 distribute special protective equipments to the houses that are within radius (inclusive) R1 and R2 of the respective power plants. As a result each of the houses that are endangered by both the plants actually receive two sets of equipments to protect their house. Given the location of the houses and the values of ax;ay; bx; by and possible values of R1 and R2 your job is to find out the number of houses that are endangered by both the plants

Input Format

The input le contains at most 3 test cases. The description of each test case is given below: A test case starts with a line containing a positive integerN(0 < N

Output Format

For each test case produceq+ 1 lines of output. The rst line is the serial of output. For each query (given value of R1 and R2) determine the number of houses that are endangered by both the plants. You may consider using faster IO as judge input le is large. Note: First query in the sample input corresponds to Figure 1.