Unofficial Editorials December Lunchtime

But my point was not regarding the difficulty. I was thinking that whether every coordinator you proposed to and also the testers did get an O(n^3) solution instead of O(n^2)(which was also pretty easy to point). Then I feel its a deep trouble because the point of coordinator or tester is atleast observing the O(n^2) solution even though you allow O(n^4)to pass (which I believe is unobserved by them or either not pointed out to you by your previous comments).

ANOTHER DOUBT(Anyone can clarify): Is there any possibility that I get an update through mail or any if get a reply to my comment here.

Testers obviously know the most optimal solution(as they explore every possible solutions).

Approach for your solution, is it just Observation or can you derive it mathematically ?

@wittyceaser Suppose we have the following: a_1 + a_2 + a_3 + ... + a_k = n and we have to find the number of positive solutions such that 1 \leqslant a_i \leqslant s for all i in [1, k]. We can first find the unbounded solutions (i.e., a_i in the range [1, n] using (n-c)C(k-1). Then, we will choose one of the a_i and substitute it by b_i such that b_i = a_i + s. Now, all the solutions to b_1 + a_2 + ... + a_k = n-s will be invalid and we need to subtract it from the previous found unbounded solution. (1)

1 Like

@wittyceaser Now, instead of choosing a_1 we could have substituted any other a_i and all those solutions need to be excluded too. We have kC1 choices for this. But, while excluding these, we have excluded some solutions twice and we need to add it back. This process of inclusion and exclusion will keep on repeating till we replace all a_i with b_i in the final step. The final form will be: (-1)^i(nCr(k, i) * nCr(n-i*s-1, k-1)) for all i in range [1, k]. (2)

1 Like

you made an assumption that N= P+Q but N<=(P+Q) its value can be less than (P+Q) then in that case we can’t reduce 6 to 5 variables in your way N= P-p+Q-q.

P<=20 and q<=20. So N can be 40,thats y tle

Glad that u liked it. :slight_smile: