private static long getCombination ( int n , int r ) {
  long [ ] modDp = new long [ n + 1 ] ;
  long [ ] modInvDp = new long [ n + 1 ] ;
  modDp [ 0 ] = 1 ;
  modInvDp [ n ] = 1 ;
  for ( int i = 1 ;
  i <= n ;
  i ++ ) modDp [ i ] = ( modDp [ i - 1 ] * i ) % INF ;
  long tmp = modDp [ n ] ;
  long doubling = INF - 2 ;
  while ( doubling > 0 ) {
    if ( doubling % 2 == 1 ) modInvDp [ n ] = ( modInvDp [ n ] * tmp ) % INF ;
    tmp = ( tmp * tmp ) % INF ;
    doubling /= 2 ;
  }
  for ( int i = n ;
  i > 0 ;
  i -- ) modInvDp [ i - 1 ] = modInvDp [ i ] * i % INF ;
  long ans = modDp [ n ] ;
  ans = ans * modInvDp [ r ] % INF ;
  ans = ans * modInvDp [ n - r ] % INF ;
  return ans ;
}

private static long getCombination ( int n , int r ) { long [ ] modDp = new long [ n + 1 ] ; long [ ] modInvDp = new long [ n + 1 ] ; modDp [ 0 ] = 1 ; modInvDp [ n ] = 1 ; for ( int i = 1 ; i <= n ; i ++ ) modDp [ i ] = ( modDp [ i - 1 ] * i ) % INF ; long tmp = modDp [ n ] ; long doubling = INF - 2 ; while ( doubling > 0 ) { if ( doubling % 2 == 1 ) modInvDp [ n ] = ( modInvDp [ n ] * tmp ) % INF ; tmp = ( tmp * tmp ) % INF ; doubling /= 2 ; } for ( int i = n ; i > 0 ; i -- ) modInvDp [ i - 1 ] = modInvDp [ i ] * i % INF ; long ans = modDp [ n ] ; ans = ans * modInvDp [ r ] % INF ; ans = ans * modInvDp [ n - r ] % INF ; return ans ; }
(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))) body: (block (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 (binary_expression left: (identifier) right: (decimal_integer_literal)))))) (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 (binary_expression left: (identifier) right: (decimal_integer_literal)))))) (expression_statement (assignment_expression left: (array_access array: (identifier) index: (decimal_integer_literal)) right: (decimal_integer_literal))) (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (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: (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (binary_expression left: (parenthesized_expression (binary_expression left: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal))) right: (identifier))) right: (identifier))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (array_access array: (identifier) index: (identifier)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (identifier) right: (decimal_integer_literal)))) (while_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (decimal_integer_literal))) consequence: (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (binary_expression left: (parenthesized_expression (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (identifier))) right: (identifier))))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) right: (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (decimal_integer_literal))))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (identifier))) condition: (binary_expression left: (identifier) right: (decimal_integer_literal)) update: (update_expression (identifier)) body: (expression_statement (assignment_expression left: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal))) right: (binary_expression left: (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (identifier)) right: (identifier))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (array_access array: (identifier) index: (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (binary_expression left: (identifier) right: (array_access array: (identifier) index: (identifier))) right: (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (binary_expression left: (identifier) right: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (identifier)))) right: (identifier)))) (return_statement (identifier))))