how to write algorithm for the following question?

Construct an algorithm that has input an integer n 1, numbers x0, x1,...,xn, and a number x and that produces as output the product (x-xo)(x-x1)(x - xn).