Go Back
Cibin Likes Networking (100)

Its a practical session of Computer Networks. Unlike other practical sessions, this one is interesting. Today the professor asked Cibin to establish a wired Star Topology network between all the PCs where the central PC is that of the professor.
Now, if you don’t know the star topology network, it is basically a network in which there is a central PC which is connected to all the others PCs in the network. As assisted by the professor, after 150m, there is a need of repeater.
There are total N PCs including the central PC. The total available wire length is L and the total no. of available repeaters are R.


The first line of input contain an integer T denoting the number of test cases. Each test case consists of two lines. The first line contains three numbers viz total no. of PCs N, the available no. of repeaters R and available length of wire L. The second line contains (N-1) numbers K1,K2,K3….Kn-1 i.e the lengths of the other PCs from the central PC.


For each test case, if the wire and repeaters are sufficient to establish the star topology then print sufficient otherwise print insufficient.


1 <= T <= 100
3 <= N <= 50
1 <= L <= 100000
1 <= R <= 100
1 <= Ki <= 1000

Copy Input

7 3 550
90 70 170 45 195 70
10 5 1500
175 200 45 95 35 180 170 100 120
8 2 1000
170 50 190 50 230 100 120



For the first test case, the total wire length required is 640 but available wire length is 550.
For the second test case, the wire and the no. of repeaters both are sufficient.
For the third test case, the wire length is sufficient but the available no. of repeaters is not enough.

Single Round Match #05
3 hour contest

Scoring will be 100-200-300.

Problem Tags
adhoc, math

Supported by our Coding Partner