public static int calc ( int k , int count , int incrementValue , int sum ) {
  if ( count > k ) {
    return sum ;
  }
  return Math . min ( calc ( k , count + 1 , incrementValue , sum * 2 ) , calc ( k , count + 1 , incrementValue , sum + incrementValue ) ) ;
}

public static int calc ( int k , int count , int incrementValue , int sum ) { if ( count > k ) { return sum ; } return Math . min ( calc ( k , count + 1 , incrementValue , sum * 2 ) , calc ( k , count + 1 , incrementValue , sum + incrementValue ) ) ; }
(method_declaration (modifiers) type: (integral_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)) (formal_parameter type: (integral_type) name: (identifier))) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (block (return_statement (identifier)))) (return_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (method_invocation name: (identifier) arguments: (argument_list (identifier) (binary_expression left: (identifier) right: (decimal_integer_literal)) (identifier) (binary_expression left: (identifier) right: (decimal_integer_literal)))) (method_invocation name: (identifier) arguments: (argument_list (identifier) (binary_expression left: (identifier) right: (decimal_integer_literal)) (identifier) (binary_expression left: (identifier) right: (identifier)))))))))