Referring to this solution http://www.codechef.com/viewsolution/3331816 (got AC) for the question http://www.codechef.com/problems/CLMBSTRS, i came across teh confusion regarding modulo operator. I initially framed the array fib[] this way
for(i=2;i<=MAX;i++)
{
fib[i]=(fib[i-1]%mod+fib[i-2]%mod);
}
and this gave WA. I, just in case,changed the above to
for(i=2;i<=MAX;i++) { fib[i]=(fib[i-1]+fib[i-2])%mod; }
and this gave AC. As far as i know (a+b)%mod = a%mod + b%mod, then why such??