How can we take matrix exponentiaon, the value of n is 50,000 so the n^3 will always give us TLE, explain how and why
SumSums problem
@msid78641,
Mat expo is one approach for small k, but here you can this problem, using fast expo, you just have to figure out a math formula.