Can any one help me with this problem ? I cannot understand the algorithm . asked 03 Apr '15, 08:27

this problem is directly solved using matrix exponentiation first we need to write the recurrence in matrix form a b c 1 x t(n1) 1 0 0 0 t(n2) 0 1 0 0 t(n3) 0 0 0 1 d  then find pow(n3) binary exponentiation if u cant understand this see this link:http://zobayer.blogspot.in/2010/11/matrixexponentiation.html link to my solution:http://www.codechef.com/viewsolution/6610526 answered 03 Apr '15, 12:57

@shakil_ruet The editorial will be posted by tonight answered 03 Apr '15, 17:19
@shakil_ruet the editorial has been posted
(03 Apr '15, 19:52)
