Can anyone give me solution of SUMSUMS problem

Below is the link of problem
https://hack.codingblocks.com/app/practice/1/700/problem

@mehul.narendra.dubey
You can refer editorial for the same
https://ide.codingblocks.com/s/282602

@shrm.abhishek.kmr , but we have to use matrix exponentiation , can anyone explain how this logic works, i am not understanding this solution