static void calc2 ( int n , int [ ] a , int x , boolean f ) {
  int k = f ? i : j ;
  if ( t <= a [ k ] ) {
    t = a [ k ] + x ;
    k ++ ;
    ans ++ ;
  }
  else {
    while ( k < n && a [ k ] < t ) k ++ ;
    if ( k < n ) {
      t = a [ k ] + x ;
      ans ++ ;
    }
  }
  if ( f ) i = k ;
  else j = k ;
}

static void calc2 ( int n , int [ ] a , int x , boolean f ) { int k = f ? i : j ; if ( t <= a [ k ] ) { t = a [ k ] + x ; k ++ ; ans ++ ; } else { while ( k < n && a [ k ] < t ) k ++ ; if ( k < n ) { t = a [ k ] + x ; ans ++ ; } } if ( f ) i = k ; else j = k ; }
(method_declaration (modifiers) type: (void_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)) (formal_parameter type: (integral_type) name: (identifier)) (formal_parameter type: (boolean_type) name: (identifier))) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (ternary_expression condition: (identifier) consequence: (identifier) alternative: (identifier)))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (array_access array: (identifier) index: (identifier)))) consequence: (block (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (identifier)))) (expression_statement (update_expression (identifier))) (expression_statement (update_expression (identifier)))) alternative: (block (while_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (identifier)))) body: (expression_statement (update_expression (identifier)))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (block (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (identifier)))) (expression_statement (update_expression (identifier))))))) (if_statement condition: (parenthesized_expression (identifier)) consequence: (expression_statement (assignment_expression left: (identifier) right: (identifier))) alternative: (expression_statement (assignment_expression left: (identifier) right: (identifier))))))