private static int solve ( int n , int [ ] a ) {
  int max = 0 ;
  if ( n == 1 || n == 2 ) max = n ;
  else {
    int i , j = 0 ;
    for ( i = 2 ;
    i < n ;
    i ++ ) {
      if ( a [ i ] != ( a [ i - 1 ] + a [ i - 2 ] ) ) {
        max = Math . max ( max , i - j ) ;
        j = i - 1 ;
      }
    }
    max = Math . max ( max , i - j ) ;
  }
  return max == 0 ? 2 : max ;
}

private static int solve ( int n , int [ ] a ) { int max = 0 ; if ( n == 1 || n == 2 ) max = n ; else { int i , j = 0 ; for ( i = 2 ; i < n ; i ++ ) { if ( a [ i ] != ( a [ i - 1 ] + a [ i - 2 ] ) ) { max = Math . max ( max , i - j ) ; j = i - 1 ; } } max = Math . max ( max , i - j ) ; } return max == 0 ? 2 : max ; }
(method_declaration (modifiers) type: (integral_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (integral_type) name: (identifier)) (formal_parameter type: (array_type element: (integral_type) dimensions: (dimensions)) name: (identifier))) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (binary_expression left: (identifier) right: (decimal_integer_literal)))) consequence: (expression_statement (assignment_expression left: (identifier) right: (identifier))) alternative: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier)) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (for_statement init: (assignment_expression left: (identifier) right: (decimal_integer_literal)) condition: (binary_expression left: (identifier) right: (identifier)) update: (update_expression (identifier)) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (parenthesized_expression (binary_expression left: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal))) right: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal))))))) consequence: (block (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (binary_expression left: (identifier) right: (identifier)))))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (decimal_integer_literal)))))))) (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (binary_expression left: (identifier) right: (identifier)))))))) (return_statement (ternary_expression condition: (binary_expression left: (identifier) right: (decimal_integer_literal)) consequence: (decimal_integer_literal) alternative: (identifier)))))