A ploynomial equation is a sum of terms. Here each term is either a constant number, or consists of the variable x raised to a certain power and multiplied by a number. These numbers are called weights. For example, in the polynomial: 2x^2+3x+4, the weights are: 2,3,4. You can present a polynomial with the list of its weights, for example, equation weights = [6, 4] represent the equation 6x + 4 and equation weights = [1, 3, 4] represent the equation 1x^2 + 3x + 4. In this task, you need to compute the result of a polynomial expression by substituing a given value of x in the given polynomial equation. Equation weights are given as a list.

[Q]: x = 6, equation weights = [8, 0, 6]
[A]: 294


[Q]: x = 3, equation weights = [7, 1, 6]
[A]: 72


[Q]: x = 8, equation weights = [5, 8, 1, 6, 3]
[A]:
24691