static long product ( long a [ ] , int n , int k ) {
  long ans = 1 ;
  Arrays . sort ( a ) ;
  long powa = C [ n - 1 ] [ k - 1 ] ;
  for ( int i = 0 ;
  i < n ;
  i ++ ) {
    long powla = C [ i ] [ k - 1 ] ;
    long powfa = C [ n - i - 1 ] [ k - 1 ] ;
    long powe = ( ( powa % MOD ) - ( powla + powfa ) % MOD + MOD ) % MOD ;
    long mul = power ( a [ i ] , powe ) % MOD ;
    ans = ( ( ans % MOD ) * ( mul % MOD ) ) % MOD ;
  }
  return ans % MOD ;
}

static long product ( long a [ ] , int n , int k ) { long ans = 1 ; Arrays . sort ( a ) ; long powa = C [ n - 1 ] [ k - 1 ] ; for ( int i = 0 ; i < n ; i ++ ) { long powla = C [ i ] [ k - 1 ] ; long powfa = C [ n - i - 1 ] [ k - 1 ] ; long powe = ( ( powa % MOD ) - ( powla + powfa ) % MOD + MOD ) % MOD ; long mul = power ( a [ i ] , powe ) % MOD ; ans = ( ( ans % MOD ) * ( mul % MOD ) ) % MOD ; } return ans % MOD ; }
(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)) (formal_parameter type: (integral_type) name: (identifier))) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (array_access array: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal))) index: (binary_expression left: (identifier) right: (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 (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (array_access array: (array_access array: (identifier) index: (identifier)) index: (binary_expression left: (identifier) right: (decimal_integer_literal))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (array_access array: (array_access array: (identifier) index: (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (decimal_integer_literal))) index: (binary_expression left: (identifier) right: (decimal_integer_literal))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (parenthesized_expression (binary_expression left: (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) right: (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) right: (identifier))) right: (identifier))) right: (identifier)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (method_invocation name: (identifier) arguments: (argument_list (array_access array: (identifier) index: (identifier)) (identifier))) right: (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (parenthesized_expression (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) right: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))))) right: (identifier)))))) (return_statement (binary_expression left: (identifier) right: (identifier)))))