public static void solve ( int T ) throws IOException {
  long n = sc . nextLong ( ) ;
  int ans = 0 ;
  for ( int i = 26000 ;
  i >= 1 && n > 0 ;
  i -- ) {
    long x = i - 1 ;
    long val = ( 3 * x * ( x + 1 ) / 2 ) + 2 * ( x + 1 ) ;
    if ( val <= n ) {
      ans += n / val ;
      n %= val ;
    }
  }
  System . out . println ( ans ) ;
}

public static void solve ( int T ) throws IOException { long n = sc . nextLong ( ) ; int ans = 0 ; for ( int i = 26000 ; i >= 1 && n > 0 ; i -- ) { long x = i - 1 ; long val = ( 3 * x * ( x + 1 ) / 2 ) + 2 * ( x + 1 ) ; if ( val <= n ) { ans += n / val ; n %= val ; } } System . out . println ( ans ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (integral_type) name: (identifier))) (throws (type_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: (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: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (binary_expression left: (identifier) right: (decimal_integer_literal))) update: (update_expression (identifier)) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (identifier) right: (decimal_integer_literal)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (parenthesized_expression (binary_expression left: (binary_expression left: (binary_expression left: (decimal_integer_literal) right: (identifier)) right: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal)))) right: (decimal_integer_literal))) right: (binary_expression left: (decimal_integer_literal) right: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (block (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (identifier))))))) (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (identifier))))))