Coronavirus Spread 2 SOLUTIONS COVID19B

Coronavirus Spread 2 SOLUTION

There are N competitors (numbered 1 through N) in a line. For each legitimate I, the I-th competitor begins at the position I and his speed is Vi, for example for any genuine number t≥0, the situation of the I-th competitor at the time t is i+Vi⋅t. 
Shockingly, one of the competitors is tainted with an infection at the time t=0. This infection just spreads from a contaminated competitor to another at whatever point their positions are the equivalent simultaneously. A recently contaminated competitor may then taint others too. 
We don’t know which competitor is tainted at first. Notwithstanding, on the off chance that we stand by sufficiently long, a particular arrangement of competitors (contingent upon the competitor that was tainted at first) will get contaminated. Your errand is to locate the size of this set, for example the last number of tainted individuals, in the most ideal and most noticeably awful situation. 
The principal line of the info contains a solitary whole number T signifying the quantity of experiments. The portrayal of T experiments follows. 
The principal line of each experiment contains a solitary whole number N. 
The subsequent line contains N space-isolated numbers V1,V2,… ,VN. 
For each experiment, print a solitary line containing two space-isolated numbers ― the littlest and biggest last number of tainted individuals. 
0≤Vi≤5 for each substantial I 
Subtask #1 (1 point): N=3 
Subtask #2 (99 focuses): unique requirements 
Model Input 
1 2 3 
3 2 1 
1 3 2 
Model Output 
1 2 
Model case 1: No two competitors will actually have a similar position, so the infection can’t spread. 
Model case 2: It doesn’t make a difference who is at first contaminated, the principal competitor would consistently spread it to everybody. 
Model case 3: The competitors are not moving, so the infection can’t spread. 
Model case 4: The most ideal situation is the point at which the at first tainted competitor is the first, since he can’t contaminate any other person. In the most noticeably terrible conceivable situation, in the long run, the second and third competitors are tainted.

Coronavirus Spread 2 SOLUTION


13 thoughts on “Coronavirus Spread 2 SOLUTIONS COVID19B”

Leave a Comment