I used matrix exponentiation for TILLING PROBLEM - II

i used matrix exponentiation for TILLING PROBLEM - II (https://hack.codingblocks.com/contests/c/547/1045)
but when i submit it’s give wrong answer
my code is https://ide.codingblocks.com/s/83430
pleas help me!

use simple dynamic programming because the contrainsts are not too high.

than you !:heart:️:heart:️:heart:️:heart:️:heart:️:heart:️:heart:️:heart:️:heart:️:heart:️

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.