public static void main ( String [ ] args ) throws IOException {
  BufferedReader f = new BufferedReader ( new InputStreamReader ( System . in ) ) ;
  StringTokenizer st = new StringTokenizer ( f . readLine ( ) ) ;
  long n = Long . parseLong ( st . nextToken ( ) ) ;
  long m = Long . parseLong ( st . nextToken ( ) ) ;
  System . out . print ( Math . max ( 0 , n - 2L * m ) + " " ) ;
  int max = ( int ) Math . ceil ( 0.5 + Math . pow ( 1L + 8L * m , 0.5 ) * 0.5 ) ;
  if ( m == 0 ) max = 0 ;
  System . out . println ( Math . max ( n - max , 0 ) ) ;
}

public static void main ( String [ ] args ) throws IOException { BufferedReader f = new BufferedReader ( new InputStreamReader ( System . in ) ) ; StringTokenizer st = new StringTokenizer ( f . readLine ( ) ) ; long n = Long . parseLong ( st . nextToken ( ) ) ; long m = Long . parseLong ( st . nextToken ( ) ) ; System . out . print ( Math . max ( 0 , n - 2L * m ) + " ▁ " ) ; int max = ( int ) Math . ceil ( 0.5 + Math . pow ( 1L + 8L * m , 0.5 ) * 0.5 ) ; if ( m == 0 ) max = 0 ; System . out . println ( Math . max ( n - max , 0 ) ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (type_identifier) dimensions: (dimensions)) name: (identifier))) (throws (type_identifier)) body: (block (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (type_identifier) arguments: (argument_list (object_creation_expression type: (type_identifier) arguments: (argument_list (field_access object: (identifier) field: (identifier)))))))) (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (type_identifier) arguments: (argument_list (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))))) (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (decimal_integer_literal) (binary_expression left: (identifier) right: (binary_expression left: (decimal_integer_literal) right: (identifier))))) right: (string_literal))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (cast_expression type: (integral_type) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (decimal_floating_point_literal) right: (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (decimal_integer_literal) right: (binary_expression left: (decimal_integer_literal) right: (identifier))) (decimal_floating_point_literal))) right: (decimal_floating_point_literal)))))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) consequence: (expression_statement (assignment_expression left: (identifier) right: (decimal_integer_literal)))) (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (identifier) right: (identifier)) (decimal_integer_literal))))))))