#C7076. Adjacent Product Array
Adjacent Product Array
Adjacent Product Array
Given an array of n integers, compute a new array where each element is the product of two consecutive elements from the input array.
The constraints are as follows:
- The array length n is between 2 and 1000 (inclusive).
- Each element of the array is an integer between 1 and 1000 (inclusive).
Mathematically, if the input array is \( a = [a_1, a_2, \dots, a_n] \), then the output array should be:
\[ result = [a_1 \times a_2,\; a_2 \times a_3, \; \dots, \; a_{n-1} \times a_{n}] \]Your program should read the input from standard input and write the answer to standard output.
inputFormat
The first line of input contains an integer n representing the number of elements in the array. The second line contains n space-separated integers representing the array a.
outputFormat
Output a single line with n-1 space-separated integers, each representing the product of two adjacent elements in the given array.
## sample5
1 2 3 4 5
2 6 12 20