luogu#P4723. 【模板】常系数齐次线性递推
【模板】常系数齐次线性递推
Problem Description
Find the -th term of a -th order homogeneous linear recurrence sequence , that is:
Input Format
The first line contains two integers and , as described in the statement.
The second line contains integers, representing .
The third line contains integers, representing .
Output Format
Output one integer, the value of .
6 4
3 -1 0 4
-2 3 1 5
73
Hint
Constraints: , .
It is guaranteed that all input numbers are integers in the range .
Translated by ChatGPT 5