The topic describes our Lele classmate for the network can be regarded as a special love, he has a plan, that is to use wireless network coverage throughout the university. Now the school gives him a chance, so he wants to buy a lot of wireless routing. Now he is deploying a network of roads, and the school is only allowed to put his wireless router in the middle of the road. We are by default the road is straight and its width is the same everywhere. And the coverage area of all routers is the same. Now Lele calculates the length and width of the boulevard, and the radius of the router's coverage, and wants to ask you to help him figure out the number of routers he has to buy at least. Note: In order to prevent some interference, the minimum distance between two non-lines cannot be less than 1 meters in Figure 1 is a rectangular road, and the middle dashed line represents the midline. Figure 2 is the smallest overlay. Input input includes multiple sets of test data the first part: an Integer t (1<=t<= -the second part: a total of T-lines, each line comprising three integers l,d,r represents the length of the road, and the width of the cover radius (m). (1<=l<=100000),(1<=d<= -),(1<=r<= $). The output has a single row for each set of test data output, with only one integer representing the fewest number of routers. If you cannot overwrite, output the Impossible sample input2 + 6 5 + Ten 5Sample Output5Impossible
It's a water problem.
My Code is attached below
#include <stdio.h>#include<math.h>intMain () {DoubleS,t,i,j,m,n,l,d,r; scanf ("%LF",&t); while(t--) {scanf ("%LF%LF%LF",&l,&d,&R); S=pow (R,2)-pow (d/2,2); if(s<=0) printf ("impossible\n"); Else{s=2*sqrt (s); N=l/s; if(nint(n) = =0) printf ("%.0lf\n", N); Elseprintf ("%.0lf\n", n+1); } }}
The feeling is very simple a triangle solves the need to pay attention to is usually more than double but the array can only be shaped can not be floating point.
How many routers do you want to buy? Water problem.