public static float getAverage ( int n , int k , int l ) {
  int totalDigits = countDigits ( n ) ;
  if ( totalDigits < ( k + l ) ) return - 1 ;
  int sum1 = sumFromEnd ( n , l ) ;
  int sum2 = sumFromStart ( n , k , totalDigits - k ) ;
  return ( ( float ) ( sum1 + sum2 ) / ( float ) ( k + l ) ) ;
}

public static float getAverage ( int n , int k , int l ) { int totalDigits = countDigits ( n ) ; if ( totalDigits < ( k + l ) ) return - 1 ; int sum1 = sumFromEnd ( n , l ) ; int sum2 = sumFromStart ( n , k , totalDigits - k ) ; return ( ( float ) ( sum1 + sum2 ) / ( float ) ( k + l ) ) ; }
(method_declaration (modifiers) type: (floating_point_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (integral_type) name: (identifier)) (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: (method_invocation name: (identifier) arguments: (argument_list (identifier))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))))) consequence: (return_statement (unary_expression operand: (decimal_integer_literal)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation name: (identifier) arguments: (argument_list (identifier) (identifier))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation name: (identifier) arguments: (argument_list (identifier) (identifier) (binary_expression left: (identifier) right: (identifier)))))) (return_statement (parenthesized_expression (binary_expression left: (cast_expression type: (floating_point_type) value: (parenthesized_expression (binary_expression left: (identifier) right: (identifier)))) right: (cast_expression type: (floating_point_type) value: (parenthesized_expression (binary_expression left: (identifier) right: (identifier)))))))))