In constraints, it is mentioned that 1<=N,Q<=300000. But I found now that there is no any test case where N=300000.

During contest I wrote a code by fixing MAX=300000 for array size(for precomputaion), for which I was getting TLE and WA, then It took me two more days to optimize my code so that it can pass for N=300000.

But after the contest ends, I saw many people precomputed only till N=250000, and their solution passed. Then I also changed my code and fixed MAX=250000. And it passed all the test case.It means there were no test case which contains N=300000, otherwise my code would get SIGSEV.

2 Likes

I think they have mentioned it in the subtask.:

### Subtasks

**Subtask #1 (10 points):** 1≤N,Q≤100

**Subtask #2 (20 points):** 1≤N,Q≤1,000

**Subtask #3 (70 points):**

- T≤5T≤5
- 1≤N≤250,000
- 1≤Q≤3⋅105

for 70 points they mentioned that N<=250,000

Then Why did they mentioned in constraint that 1<=N,Q<=300000?

2 Likes

May be they must have forgot to make two rows separately for N and Q, in the constraint.

BTW N<=300,000.

But this is very strange usually they write last subtask as **Original Constraint**