static int sumOfSubset ( int a [ ] , int n ) {
  int maxi = Arrays . stream ( a ) . max ( ) . getAsInt ( ) ;
  boolean [ ] prime = new boolean [ maxi + 1 ] ;
  sieve ( maxi , prime ) ;
  int times = ( int ) Math . pow ( 2 , n - 1 ) ;
  int sum = 1 ;
  for ( int i = 0 ;
  i < n ;
  i ++ ) {
    if ( prime [ a [ i ] ] ) sum = ( int ) ( sum * ( Math . pow ( a [ i ] , times ) ) ) ;
  }
  return sum ;
}

static int sumOfSubset ( int a [ ] , int n ) { int maxi = Arrays . stream ( a ) . max ( ) . getAsInt ( ) ; boolean [ ] prime = new boolean [ maxi + 1 ] ; sieve ( maxi , prime ) ; int times = ( int ) Math . pow ( 2 , n - 1 ) ; int sum = 1 ; for ( int i = 0 ; i < n ; i ++ ) { if ( prime [ a [ i ] ] ) sum = ( int ) ( sum * ( Math . pow ( a [ i ] , times ) ) ) ; } return sum ; }
(method_declaration (modifiers) type: (integral_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (integral_type) name: (identifier) dimensions: (dimensions)) (formal_parameter type: (integral_type) name: (identifier))) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (method_invocation object: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))) name: (identifier) arguments: (argument_list)) name: (identifier) arguments: (argument_list)))) (local_variable_declaration type: (array_type element: (boolean_type) dimensions: (dimensions)) declarator: (variable_declarator name: (identifier) value: (array_creation_expression type: (boolean_type) dimensions: (dimensions_expr (binary_expression left: (identifier) right: (decimal_integer_literal)))))) (expression_statement (method_invocation name: (identifier) arguments: (argument_list (identifier) (identifier)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (cast_expression type: (integral_type) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (decimal_integer_literal) (binary_expression left: (identifier) right: (decimal_integer_literal))))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (identifier)) update: (update_expression (identifier)) body: (block (if_statement condition: (parenthesized_expression (array_access array: (identifier) index: (array_access array: (identifier) index: (identifier)))) consequence: (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (integral_type) value: (parenthesized_expression (binary_expression left: (identifier) right: (parenthesized_expression (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (array_access array: (identifier) index: (identifier)) (identifier)))))))))))) (return_statement (identifier))))