There is a contest going on at the maths fair and you need to help Mr Geek to solve T polynomial expression given that you will be provided with the coefficients of polynomial and with the value for which you need to evaluate the polynomial expression.
Coefficients:- 1 5 (in increasing order starting from degree 0 )
The first line consists of T test cases. The following T lines consists of an integer N specifying the highest degree of the polynomial.
The next line contains a list of coefficients in increasing order of thier degree. The next line specifies the value V at which the expression needs to be evaluated.
Output in a single line the answer of the expression. As answers can be very large please output them modulo 109+7.
1 1 1
If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.