A vector with n integer elements is given. It is required the return of a new vector, dynamically allocated, that will have in position i the product of all elements in the received vector, except the element in position i.

I created the vector that receives in elements, but I do not know how to take an element then multiply it with each one less himself, and take the value of the first element in the new vector.
Example: v[i] = v[i+1] * v[i+2]
input:
3
4 5 6
output:
30 24 20