Special-matrix problem

https://practice.geeksforgeeks.org/problems/special-matrix/0

this code is showing wrong ans on submission on gfg plz correct it …and expalin as well.

hello @S19LPPP0202
a) use long long everywhere to avoid overflow

b) use mod property .here -> image
(a+b)=(a%mod+b%mod)%mod

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.

Plz reply to other doubts of mine