#K44502. Pairwise Product Computation
Pairwise Product Computation
Pairwise Product Computation
You are given a list of integers. Your task is to compute the product for every pair of distinct numbers from the list. The pairs must be taken in the order of their appearance (i.e. for any indices i and j with i < j, consider the product of the number at position i and j). Each product is defined as \(a \times b\), where \(a\) and \(b\) are two distinct numbers from the list.
If the list contains fewer than 2 numbers, there will be no pairs and you should output an empty line.
Input/Output Format: Your program should read from standard input (stdin) and write to standard output (stdout).
inputFormat
The first line of input contains a single integer \(n\) indicating the number of integers. The second line contains \(n\) space-separated integers.
outputFormat
Output the product of every pair of numbers in the order they are generated. The numbers should be separated by a single space. If there are no such pairs, output nothing.
## sample4
1 2 3 4
2 3 4 6 8 12