Push all the composite numbers from the array to the heaps
for ( int i = 0 ; i < n ; i ++ ) if ( ! prime [ arr [ i ] ] ) { minHeap . push ( arr [ i ] ) ; maxHeap . push ( arr [ i ] ) ; } long long int minProduct = 1 , maxProduct = 1 , minSum = 0 , maxSum = 0 ; while ( k -- ) {