All testcases not passed why

@navin
Line 20
sum=(sum%n+n)%n;
Kindly close this doubt