Wireless network coverage and wireless coverage
Wireless Network Coverage
Time Limit: 3000 MS | memory limit: 65535 KB
Difficulty: 3
Description
Our Lele students have a special liking for the internet. He has a plan to use wireless networks to cover Zhengzhou University.
Now the school gives him a chance, so he wants to buy many wireless routes. Now he is deploying a network on a certain Avenue, and the school only allows his wireless router to be placed in the middle of the road. By default, this avenue is straight and Its width is the same anywhere. All routers have the same coverage area. Now Lele calculates the length and width of this avenue and the coverage radius of the router. Please help him calculate the minimum number of routers he wants to purchase.
Note: To prevent interference, the minimum distance between two wireless routes cannot be less than 1 meter.
The path in Figure 1 is a rectangle, and the dotted line in the middle represents the midline. Figure 2 shows the minimum coverage.
Input
Input includes multiple groups of test data
Part 1: an integer T (1 <= T <= 500)
Part 2: A total of T rows. Each line contains three integers, L, D, and R, representing the length, width, and coverage radius (meters) of the path ).
(1 <= L <= 100000), (1 <= D <= 50), (1 <= R <= 200 ).
Output
For each group of test data output each occupies one row, there is only one integer, indicating the minimum number of routers. If it cannot be overwritten, output impossible
Sample Input
240 6 540 10 5
Sample output
5 impossible
Question: determine the number of wireless routers: Step 1. Obtain the length of the road covered by a router. Step 2. Divide the total length of the road by the length of the road covered by each router, that is, the number of routers (considering the calculation accuracy)
Program code:
# Include <stdio. h>
# Include <math. h>
# Include <stdlib. h>
Int main ()
{
Int T, L, D, R;
Double N;
Scanf ("% d", & T );
While (T --)
{
Scanf ("% d", & L, & D, & R );
N = L/(sqrt (R * R-D * D/4.0) * 2 );
If (2 * R <= D)
Printf ("impossible \ n ");
Else
{
If (N-(int) N = 0)
Printf ("% d \ n", (int) N );
Else
Printf ("% d \ n", (int) N + 1 );
}
}
System ("pause ");
Return 0;
}
How does a wireless network overwrite the Local Area Network? to connect to the Internet, go directly to the vro, open the wireless network, and set a password to enable the connection.
Connect the external network to the WAN port.
Wireless Network coverage is actually a matter of fact, I 'd like to know how many flats in my house. It is more than enough to say that I use the TP-link on the second floor.
The third floor of my house also uses two Mercury wireless routes to bridge the Bridge Station. The two ends of the bridge fell offline for three days and were speechless.
Why bother to set the same SSID and password? Because the phone is still on the computer, you only need to save the settings and automatically connect to the reliable method. The two routes are connected to the same network cable.