SUMSUMS - SUMMING SUMS Test Cases are failing

HI @abhishek_trigunait bhaiya and @abhishek_ranjan bhaiya -

I tried solving the problem using matrix exponentiation and binary exponentiation i have tried some of the combinations that are getting passed but for test cases i am getting run time exception and wrong answer .
Please let me know what i am missing .

https://ide.codingblocks.com/#/s/14323