For an array {1, 2, 3, 4, 5}:
The required product array generated from the given array is {120, 60, 40, 30, 24 }
This can be generated in the following manner:
For generating 120 we have 2 * 3 * 4 * 5 i.e. the product of other array elements except 1.
For generating 60 we have 1 * 3 * 4 * 5 i.e. the product of other array elements except 2.
For generating 40 we have 1 * 2 * 4 * 5 i.e. the product of other array elements except 3.
For generating 30 we have 1 * 2 * 3 * 5 i.e. the product of other array elements except 4.
For generating 24 we have 1 * 2 * 3 * 4 i.e. the product of other array elements except 5.
The first line contains an Integer 'T' which denotes the number of test cases/queries to be run.
Then the test cases follow.
The first line of input for each test case/query contains an integer N representing the size of the array.
The second line of input for each test case/query contains N space-separated integers representing the elements of the array.
For each test case, print 'N' single space-separated integers denoting elements of the product array P.
Output for every test case will be printed in a separate line.
1. You do not need to print anything, it has already been taken care of. Just implement the function.
2. The value of P[i] will fit into a 64-bit data type.
1 <= T <= 50
1 <= N <= 10
1 <= ARR [i] <= 20
Time Limit: 1 sec
Longest Subarray With Zero Sum
Merge Two Sorted Arrays Without Extra Space
Ninja And The Strictly Increasing Array
Negative To The End
Fizzbuzz Problem