Sir please help me out understand this problem better

sir in the code of this solution how did you calculate the sum
and why you have taken the size of F1 vector as k+2,( i mean you can but why ?)
why we are starting F1 vector with 2 index ?

if i am not wrong in this question we have to find the sum from the m th term to n th term ?
and to calculate that we need to find the sum of n terms ,and sum of m terms seperately and then we can get TOTAL=sn-(sm-1)

@gupta.ritik2002
Are you referring to the editorial code ?

Yes I am referring to editorial code.

@gupta.ritik2002

For calculating sum we are using matrix exponentiation
See this for reference https://www.geeksforgeeks.org/matrix-exponentiation/

and to calculate that we need to find the sum of n terms ,and sum of m terms separately and then we can get TOTAL=sn-(sm-1)
Thats right
So you can calculate Sn using matrix exponentiation

and why you have taken the size of F1 vector as k+2, no reason
You can reduce it if you like and change the code accordingly

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.