Function to find product of all elements in all subsets
int product ( int a [ ] , int n ) { int ans = 1 ; int val = pow ( 2 , n - 1 ) ; for ( int i = 0 ; i < n ; i ++ ) { ans *= pow ( a [ i ] , val ) ; } return ans ; }