Link to solution: CodeChef: Practical coding for everyone
I exactly had that approach and it scared the hell out of me when the editorial requisite mentioned the word āDifferentiationā :\
I think testersās solution also includes BS approach but it looks overkill for this problem.
setterās solution is same as yours.
You have forgotten to take mod in your last loop.
Niceā¦
You took wrong modulo. Also, distinct function is not needed.
Hereās ur corrected solution.
Thanks a lot !
Differentiation is Differentiation, whether its basic or advanced, since calculus wasnāt my cup of tea ever, Iād get scared with even the slightest hint of it 
I did not add the remaining 6 to last element, but to element so that that element becomes a[k-1]+1.
After getting 2 3 4 5 6 7 8 9, My solution add 6 to 4, getting sequence 2 3 10 5 6 7 8 9
which will get the required product.
Thank you!
Might have worked if used Logarithms, but here, we need the product, not summation.
Plus, Time complexity will be an issue in this solution.
Differentiation is just required for proof of solution.
It is not required to solve the problem if you get the intuition of solution.
WOW !!!
I wonder how do people like you even think of using basic algorithms like binary search. I mean, even though there was no clue that anything needs to be searched, you applied it. Is this result of just lots of practice ???
Binary Search is my favorite 
Itās like lifeline XD
Use it anywhere you want toā¦
Itās from practiceā¦
Check all the algorithms you know for a particular question⦠if it can be applied or notā¦
Codeforces ? smit_mandavia 
Bro,you should write a few blogs on cp-topics so newbies like me and Harsh can get help 
+you explain stuff very nicely, Iāve seen that at many places
