public static void process ( ) throws IOException {
  int n = ni ( ) ;
  int k = ni ( ) ;
  int y = ( 2 * k ) + 1 ;
  int count = 0 ;
  ArrayList < Integer > list = new ArrayList < Integer > ( ) ;
  if ( k >= ( ( n + 1 ) / 2 ) ) {
    count = 1 ;
    list . add ( ( n + 1 ) / 2 ) ;
  }
  else {
    int m = n / y ;
    int in = ( y + 1 ) / 2 ;
    int left = n % y ;
    ;
    if ( left == 0 ) {
      list = getAns ( m , in , 0 , y , n ) ;
    }
    else {
      if ( left <= k + 1 ) {
        list = getAns ( m , in , k + 1 - left , y , n ) ;
        list . add ( n ) ;
      }
      else {
        list = getAns ( m , in , 0 , y , n ) ;
        int h = list . get ( list . size ( ) - 1 ) ;
        list . add ( h + ( 2 * k ) + 1 ) ;
      }
    }
    count = list . size ( ) ;
  }
  pn ( count ) ;
  StringBuilder sb = new StringBuilder ( "" ) ;
  for ( Integer i : list ) {
    sb . append ( i ) . append ( " " ) ;
  }
  pn ( sb . toString ( ) ) ;
}

public static void process ( ) throws IOException { int n = ni ( ) ; int k = ni ( ) ; int y = ( 2 * k ) + 1 ; int count = 0 ; ArrayList < Integer > list = new ArrayList < Integer > ( ) ; if ( k >= ( ( n + 1 ) / 2 ) ) { count = 1 ; list . add ( ( n + 1 ) / 2 ) ; } else { int m = n / y ; int in = ( y + 1 ) / 2 ; int left = n % y ; ; if ( left == 0 ) { list = getAns ( m , in , 0 , y , n ) ; } else { if ( left <= k + 1 ) { list = getAns ( m , in , k + 1 - left , y , n ) ; list . add ( n ) ; } else { list = getAns ( m , in , 0 , y , n ) ; int h = list . get ( list . size ( ) - 1 ) ; list . add ( h + ( 2 * k ) + 1 ) ; } } count = list . size ( ) ; } pn ( count ) ; StringBuilder sb = new StringBuilder ( " " ) ; for ( Integer i : list ) { sb . append ( i ) . append ( " ▁ " ) ; } pn ( sb . toString ( ) ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters) (throws (type_identifier)) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation name: (identifier) arguments: (argument_list)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation name: (identifier) arguments: (argument_list)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (parenthesized_expression (binary_expression left: (decimal_integer_literal) right: (identifier))) right: (decimal_integer_literal)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (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)))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (parenthesized_expression (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) right: (decimal_integer_literal))))) consequence: (block (expression_statement (assignment_expression left: (identifier) right: (decimal_integer_literal))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) right: (decimal_integer_literal)))))) alternative: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (identifier) right: (identifier)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) right: (decimal_integer_literal)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (identifier) right: (identifier)))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) consequence: (block (expression_statement (assignment_expression left: (identifier) right: (method_invocation name: (identifier) arguments: (argument_list (identifier) (identifier) (decimal_integer_literal) (identifier) (identifier)))))) alternative: (block (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (binary_expression left: (identifier) right: (decimal_integer_literal)))) consequence: (block (expression_statement (assignment_expression left: (identifier) right: (method_invocation name: (identifier) arguments: (argument_list (identifier) (identifier) (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (identifier)) (identifier) (identifier))))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))))) alternative: (block (expression_statement (assignment_expression left: (identifier) right: (method_invocation name: (identifier) arguments: (argument_list (identifier) (identifier) (decimal_integer_literal) (identifier) (identifier))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)) right: (decimal_integer_literal)))))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (binary_expression left: (identifier) right: (parenthesized_expression (binary_expression left: (decimal_integer_literal) right: (identifier)))) right: (decimal_integer_literal))))))))) (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))))) (expression_statement (method_invocation name: (identifier) arguments: (argument_list (identifier)))) (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (type_identifier) arguments: (argument_list (string_literal))))) (enhanced_for_statement type: (type_identifier) name: (identifier) value: (identifier) body: (block (expression_statement (method_invocation object: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))) name: (identifier) arguments: (argument_list (string_literal)))))) (expression_statement (method_invocation name: (identifier) arguments: (argument_list (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))))))