Help regarding CSEQ [April Challenge]?

I was not able to solve this problem during contest, but this is my CSEQ code

codechef solution link ->

I cant figure out why there is error in program.

Can anyone please help me, as, this is not getting accepted now ?


you are calculating wrong Combinatorial(n,r) you had to calculate combinatorial( (r-l+1),(n+ r-l+1))-1.