static void findfactors ( int n ) {
  Vector < Integer > vec = new Vector < Integer > ( ) ;
  for ( int i = 1 ;
  i * i <= n ;
  i ++ ) {
    if ( n % i == 0 ) {
      vec . add ( i ) ;
      vec . add ( n / i ) ;
    }
  }
  Collections . sort ( vec ) ;
  System . out . println ( "All the factors are -> " ) ;
  for ( int i = 0 ;
  i < vec . size ( ) ;
  i ++ ) {
    System . out . print ( vec . get ( i ) + " " ) ;
  }
  System . out . println ( ) ;
  int maxProduct = 1 ;
  boolean flag = true ;
  for ( int i = 0 ;
  i < vec . size ( ) ;
  i ++ ) {
    for ( int j = i ;
    j < vec . size ( ) ;
    j ++ ) {
      for ( int k = j ;
      k < vec . size ( ) ;
      k ++ ) {
        int y = n - vec . get ( i ) - vec . get ( j ) - vec . get ( k ) ;
        if ( y <= 0 ) {
          break ;
        }
        if ( n % y == 0 ) {
          flag = false ;
          maxProduct = Math . max ( vec . get ( i ) * vec . get ( j ) * vec . get ( k ) * y , maxProduct ) ;
        }
      }
    }
  }
  if ( flag == false ) {
    System . out . println ( "Product is -> " + maxProduct ) ;
  }
  else {
    System . out . println ( "Not possible" ) ;
  }
}

static void findfactors ( int n ) { Vector < Integer > vec = new Vector < Integer > ( ) ; for ( int i = 1 ; i * i <= n ; i ++ ) { if ( n % i == 0 ) { vec . add ( i ) ; vec . add ( n / i ) ; } } Collections . sort ( vec ) ; System . out . println ( " All ▁ the ▁ factors ▁ are ▁ - > ▁ " ) ; for ( int i = 0 ; i < vec . size ( ) ; i ++ ) { System . out . print ( vec . get ( i ) + " ▁ " ) ; } System . out . println ( ) ; int maxProduct = 1 ; boolean flag = true ; for ( int i = 0 ; i < vec . size ( ) ; i ++ ) { for ( int j = i ; j < vec . size ( ) ; j ++ ) { for ( int k = j ; k < vec . size ( ) ; k ++ ) { int y = n - vec . get ( i ) - vec . get ( j ) - vec . get ( k ) ; if ( y <= 0 ) { break ; } if ( n % y == 0 ) { flag = false ; maxProduct = Math . max ( vec . get ( i ) * vec . get ( j ) * vec . get ( k ) * y , maxProduct ) ; } } } } if ( flag == false ) { System . out . println ( " Product ▁ is ▁ - > ▁ " + maxProduct ) ; } else { System . out . println ( " Not ▁ possible " ) ; } }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (integral_type) name: (identifier))) body: (block (local_variable_declaration type: (generic_type (type_identifier) (type_arguments (type_identifier))) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (generic_type (type_identifier) (type_arguments (type_identifier))) arguments: (argument_list)))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (identifier)) update: (update_expression (identifier)) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (decimal_integer_literal))) consequence: (block (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier)))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (identifier) right: (identifier))))))))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier)))) (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (string_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: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list))) update: (update_expression (identifier)) body: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))) right: (string_literal))))))) (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (local_variable_declaration type: (boolean_type) declarator: (variable_declarator name: (identifier) value: (true))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list))) update: (update_expression (identifier)) body: (block (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (identifier))) condition: (binary_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list))) update: (update_expression (identifier)) body: (block (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (identifier))) condition: (binary_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list))) update: (update_expression (identifier)) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (binary_expression left: (binary_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier)))) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier)))) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier)))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) consequence: (block (break_statement))) (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (decimal_integer_literal))) consequence: (block (expression_statement (assignment_expression left: (identifier) right: (false))) (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (binary_expression left: (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier)))) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier)))) right: (identifier)) (identifier))))))))))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (false))) consequence: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (binary_expression left: (string_literal) right: (identifier)))))) alternative: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (string_literal))))))))