static int maxNewElements ( int [ ] a , int n ) {
  int gcd = a [ 0 ] ;
  int mx = a [ 0 ] ;
  for ( int i = 1 ;
  i < n ;
  i ++ ) {
    gcd = __gcd ( gcd , a [ i ] ) ;
    mx = Math . max ( mx , a [ i ] ) ;
  }
  int total_terms = mx / gcd ;
  return total_terms - n ;
}

static int maxNewElements ( int [ ] a , int n ) { int gcd = a [ 0 ] ; int mx = a [ 0 ] ; for ( int i = 1 ; i < n ; i ++ ) { gcd = __gcd ( gcd , a [ i ] ) ; mx = Math . max ( mx , a [ i ] ) ; } int total_terms = mx / gcd ; return total_terms - n ; }
(method_declaration (modifiers) type: (integral_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (integral_type) dimensions: (dimensions)) name: (identifier)) (formal_parameter type: (integral_type) name: (identifier))) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (array_access array: (identifier) index: (decimal_integer_literal)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (array_access array: (identifier) index: (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 (expression_statement (assignment_expression left: (identifier) right: (method_invocation name: (identifier) arguments: (argument_list (identifier) (array_access array: (identifier) index: (identifier)))))) (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (array_access array: (identifier) index: (identifier)))))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (identifier) right: (identifier)))) (return_statement (binary_expression left: (identifier) right: (identifier)))))