static float find_prob ( int N , float P ) {
  double dp [ ] = new double [ N + 1 ] ;
  dp [ 0 ] = 1 ;
  dp [ 1 ] = 0 ;
  dp [ 2 ] = P ;
  dp [ 3 ] = 1 - P ;
  for ( int i = 4 ;
  i <= N ;
  ++ i ) dp [ i ] = ( P ) * dp [ i - 2 ] + ( 1 - P ) * dp [ i - 3 ] ;
  return ( ( float ) ( dp [ N ] ) ) ;
}

static float find_prob ( int N , float P ) { double dp [ ] = new double [ N + 1 ] ; dp [ 0 ] = 1 ; dp [ 1 ] = 0 ; dp [ 2 ] = P ; dp [ 3 ] = 1 - P ; for ( int i = 4 ; i <= N ; ++ i ) dp [ i ] = ( P ) * dp [ i - 2 ] + ( 1 - P ) * dp [ i - 3 ] ; return ( ( float ) ( dp [ N ] ) ) ; }
(method_declaration (modifiers) type: (floating_point_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (integral_type) name: (identifier)) (formal_parameter type: (floating_point_type) name: (identifier))) body: (block (local_variable_declaration type: (floating_point_type) declarator: (variable_declarator name: (identifier) dimensions: (dimensions) value: (array_creation_expression type: (floating_point_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: (decimal_integer_literal)) right: (decimal_integer_literal))) (expression_statement (assignment_expression left: (array_access array: (identifier) index: (decimal_integer_literal)) right: (identifier))) (expression_statement (assignment_expression left: (array_access array: (identifier) index: (decimal_integer_literal)) right: (binary_expression left: (decimal_integer_literal) right: (identifier)))) (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: (binary_expression left: (parenthesized_expression (identifier)) right: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal)))) right: (binary_expression left: (parenthesized_expression (binary_expression left: (decimal_integer_literal) right: (identifier))) right: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal)))))))) (return_statement (parenthesized_expression (cast_expression type: (floating_point_type) value: (parenthesized_expression (array_access array: (identifier) index: (identifier))))))))