COVID19 doubt in code C++

Hi,
Actually I have solved Question COVID19 and it gave correct output on given test case but it is still showing WA. Can anybody please tell me my mistake in code or the the test case which i am not considering.
I am here attaching link to question and my code
Question Link

Solution

Your code gives wrong output for : 1 4 1 3 5 9
Output should be : 1 3
Your output : 3 3
if 4th person is infected , then minimum would be 1 .
You can refer my solution : CodeChef: Practical coding for everyone

5 Likes

Thanks archit for replying,but still I have a doubt. In question constaint is given like

X1<X2<X3… but the test case as suggested by you 1 4 1 3 5 9 here this constraint is not followed.

Here,
1
4
1 3 5 9
Constraint is followed as here , x1=1 , x2 = 3 , x3 = 5 , x4 = 9

7 Likes

Have a look at the the Input section . It says that the first line denotes the number of test cases and the first line of every test case contains a single integer N

1 Like

Thanx…I understood my mistake

what is wrong in my code
subtask 2 is giving WA
sol link