private static void doCase ( int caseNum , Scanner in ) {
  int H = in . nextInt ( ) ;
  int W = in . nextInt ( ) ;
  int R = in . nextInt ( ) ;
  int [ ] [ ] memoized = new int [ W ] [ H ] ;
  for ( int [ ] arr : memoized ) for ( int i = 0 ;
  i < arr . length ;
  i ++ ) arr [ i ] = - 1 ;
  for ( int i = 0 ;
  i < R ;
  i ++ ) {
    int rockY = in . nextInt ( ) ;
    int rockX = in . nextInt ( ) ;
    memoized [ W - rockX ] [ H - rockY ] = 0 ;
  }
  int total = findMoves ( W - 1 , H - 1 , memoized ) ;
  System . out . println ( "Case #" + caseNum + ": " + total ) ;
}

private static void doCase ( int caseNum , Scanner in ) { int H = in . nextInt ( ) ; int W = in . nextInt ( ) ; int R = in . nextInt ( ) ; int [ ] [ ] memoized = new int [ W ] [ H ] ; for ( int [ ] arr : memoized ) for ( int i = 0 ; i < arr . length ; i ++ ) arr [ i ] = - 1 ; for ( int i = 0 ; i < R ; i ++ ) { int rockY = in . nextInt ( ) ; int rockX = in . nextInt ( ) ; memoized [ W - rockX ] [ H - rockY ] = 0 ; } int total = findMoves ( W - 1 , H - 1 , memoized ) ; System . out . println ( " Case ▁ # " + caseNum + " : ▁ " + total ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (integral_type) name: (identifier)) (formal_parameter type: (type_identifier) name: (identifier))) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (local_variable_declaration type: (array_type element: (integral_type) dimensions: (dimensions)) declarator: (variable_declarator name: (identifier) value: (array_creation_expression type: (integral_type) dimensions: (dimensions_expr (identifier)) dimensions: (dimensions_expr (identifier))))) (enhanced_for_statement type: (array_type element: (integral_type) dimensions: (dimensions)) name: (identifier) value: (identifier) body: (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (field_access object: (identifier) field: (identifier))) update: (update_expression (identifier)) body: (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (unary_expression operand: (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 (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (expression_statement (assignment_expression left: (array_access array: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (identifier))) index: (binary_expression left: (identifier) right: (identifier))) right: (decimal_integer_literal))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation name: (identifier) arguments: (argument_list (binary_expression left: (identifier) right: (decimal_integer_literal)) (binary_expression left: (identifier) right: (decimal_integer_literal)) (identifier))))) (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (binary_expression left: (binary_expression left: (binary_expression left: (string_literal) right: (identifier)) right: (string_literal)) right: (identifier)))))))