Vasya has got an undirected graph consisting of $n$ vertices and $m$ edges. This graph doesn't contain any self-loops or multiple edges. Self-loop is an edge connecting a vertex to itself. Multiple edges are a pair of edges such that they connect the same pair of vertices. Since the graph is undirected, the pair of edges $(1, 2)$ and $(2, 1)$ is considered to be multiple edges. Isolated vertex of the graph is a vertex such that there is no edge connecting this vertex to any other vertex.

Vasya wants to know the minimum and maximum possible number of isolated vertices in an undirected graph consisting of $n$ vertices and $m$ edges. 


-----Input-----

The only line contains two integers $n$ and $m~(1 \le n \le 10^5, 0 \le m \le \frac{n (n - 1)}{2})$.

It is guaranteed that there exists a graph without any self-loops or multiple edges with such number of vertices and edges.


-----Output-----

In the only line print two numbers $min$ and $max$ — the minimum and maximum number of isolated vertices, respectively.


-----Examples-----
Input
4 2

Output
0 1

Input
3 1

Output
1 1



-----Note-----

In the first example it is possible to construct a graph with $0$ isolated vertices: for example, it should contain edges $(1, 2)$ and $(3, 4)$. To get one isolated vertex, we may construct a graph with edges $(1, 2)$ and $(1, 3)$. 

In the second example the graph will always contain exactly one isolated vertex.

Difficulty: interview

Starter code:

Solutions:
n, m = map(int, input().split())
if m == 0:
	print(n, n)
	return
if m == n * (n - 1) // 2:
	print(0, 0)
	return
L = 0
R = n + 1
while R - L > 1:
	m1 = (L + R) // 2
	if m1 * (m1 - 1) // 2 < m:
		L = m1
	else:
		R = m1
ans_max = n - R
ans_min = max(0, n - 2 * m)
print(ans_min, ans_max)

def ii():
    return int(input())
def mi():
    return list(map(int, input().split()))
def li():
    return list(mi())

n, m = mi()
x = max(0, n - 2 * m)
for i in range(n + 1):
    c = i * (i - 1) // 2
    if c >= m:
        y = n - i
        break
print(x, y)


n, m = map(int, input().split())
l = 0
r = n
for i in range(50):
    md = (l + r) // 2
    if md * (md - 1) // 2 < m:
        l = md
    else:
        r = md
   # print(l, r, md)
print(max(0, n - m * 2), n - r)

n, m = map(int, input().split())

mn = max(0, n - 2 * m)

for i in range(n + 1):
    if i * (i - 1) // 2 >= m:
        mx = n - i
        break

print(mn, mx)

n, m = map(int, input().split())
if m == 0:
	print(n, n)
	return
left, right = 0, n + 1
while left != right - 1:
	mid = (left + right) // 2
	if mid * (mid - 1) // 2 < m:
		left = mid
	else:
		right = mid
print(max(0, n - 2 * m), n - right)

n, m = map(int, input().split())
ans2 = 0
if (n + 1) // 2 > m:
    print(n - m * 2, end=' ')
else:
    print(0, end=' ')
for i in range(n, -1, -1):
    now = n - i
    if (now * (now - 1) // 2) >= m:
        print(i)
        break

n, m = list(map(int,input().split()))
imin = max(0,n - 2 * m)
s = 0
k = 1
while s < m:
	s = (k * (k - 1) // 2)
	k += 1
print(imin, n - k + 1)


import sys
import os

def solve(n, m):
    if m == 0:
        return (n, n)
    minimum = max(0, n - m * 2)
    for i in range(1, n + 1):
        if i * (i - 1) // 2 >= m:
            return (minimum, n - i)

def main():
    n, m = (int(x) for x in input().split())
    print(' '.join(str(x) for x in solve(n, m)))

def __starting_point():
    main()
__starting_point()

USE_STDIO = False

if not USE_STDIO:
    try: import mypc
    except: pass

def main():
    n, m = list(map(int, input().split(' ')))
    if m == 0:
        print(n, n)
        return

    minc = max(0, n - m * 2)

    x = int((m*2)**0.5)
    if x * (x + 1) < m * 2:
        x += 1
    maxc = n - (x + 1)

    print(minc, maxc)

def __starting_point():
    main()




__starting_point()

n, m = list(map(int, input().split()))

mini = max(0, n - 2 * m)
maxi = 10 ** 10
for i in range(n + 1):
    if i * (i - 1) // 2 < m:
        continue
    maxi = min(maxi, i)
print(mini, n - maxi)


import sys
from math import *

def minp():
	return sys.stdin.readline().strip()

n,m = list(map(int,minp().split()))
k = int(sqrt(m))
while k*(k-1)//2 > m:
	k -= 1
while k*(k-1)//2 < m:
	k += 1
#if k*(k-1)//2 == m:
print(max(0,n-m*2), n-k)


n,m=map(int,input().split())
print(max(0,n-2*m),end=' ')
l = -1
r= n+1;
while(r-l>1):
    s=(l+r)//2
    if(s*(s-1)<2*m):
        l=s
    else:
        r=s
print(max(0,n-r))


(n, m) = map(int, input().split())

if (n + 1) // 2 <= m:
    print(0, end = ' ')
else:
    print(n - m * 2, end = ' ')
    
k = 0
while k < n:
    if (k * (k - 1)) // 2 < m:
        k += 1
        continue
    else:
        break

print(n - k)




n, m = list(map(int, input().split()))

min_v = max(0, n - m * 2)

in_clique = 1
while m > 0:
    m -= in_clique
    in_clique += 1

max_v = n - in_clique + (in_clique == 1)



print(min_v, max_v)


import os
import sys

n, m = [int(num) for num in sys.stdin.readline().split()]

# for _ in range(t):
#     s, a, b, c = [int(s) for s in sys.stdin.readline().split()]
#     s = s // c
#     res = (a + b) * (s // a) + s % a
#     sys.stdout.write("{0}\n".format(res))

res1 = max([0, n - 2 * m])
res2 = 0
while res2 * (res2 - 1) < (2 * m):
    res2 += 1

print(res1, n - res2)


n, m = list(map(int, input().split()))
l, r = 0, n
while l < r:
    c = (l + r) // 2
    if (c * (c - 1) // 2) < m:
        l = c + 1
    else:
        r = c
mn = 0
if m <= n // 2:
    mn = n - m * 2
print(mn, n - l)

n,m=list(map(int,input().split()))
i=0
while (i*(i-1)/2<m) and (i<=n):
    i+=1
if n//2+n%2<=m:
    print(0,n-i)
else:
    print(n-2*m,n-i)


import math
x=input()
x=x.split()
n=int(x[0])
m=int(x[1])
if m>=n/2:
    min=0
else:
    min=n-2*m
max=n-math.ceil((2*m+(2*m)**(1/2))**(1/2))
print(str(min)+" "+str(max))

import math

n,m=list(map(int,input().split()))

MINANS=max(0,n-m*2)

def combi(m):
    return m*(m-1)//2

for i in range(int(math.sqrt(2*m)),n+1):
    if combi(i)>=m:
        break

MAXANS=n-i
#n*(n-1)/2=m
#n^2-n+2m=0


print(MINANS,MAXANS)


n,m=list(map(int,input().split()))
mn=n-min(2*m,n)
k=0
while k*(k-1)//2<m:
	k+=1
mx=n-k
print(str(mn)+" "+str(mx))


import math
def most_edge(n):
    return n*(n-1)//2
def can(n,m):
    return most_edge(n)>=m

n,m=[int(x) for x in input().split()]
minn=n-2*m
minn=max(0,minn)

np=max(0,int(math.sqrt(2*m))-10)

for i in range(np,np+20):
    if not can(i,m):
        continue
    else:
        maxx=i
        break

maxx=n-maxx

print(minn,maxx)


n,m = map(int, input().split())
if n > 1 and m >= n/2:
    ans1 = 0
else:
    if n > 1:
        ans1 = n - m*2
    else:
        ans1 = 1
k = 1
while k*(k-1)//2 < m:
    k += 1
if m > 0:
    ans2 = n - k
else:
    ans2 = n
print(ans1, ans2)

3

import math
import sys


DEBUG = False


def inp():
    return sys.stdin.readline().rstrip()


def dprint(*value, sep=' ', end='\n'):
    if DEBUG:
        print(*value, sep=sep, end=end)


def getpf(E):
    if E == 0:
        return 0

    e = 0
    for k in range(2, E + 100):
        e += k - 1
        if e >= E:
            return k

    assert False


def solve(V, E):
    mx = V - getpf(E)
    mn = max(0, V - E * 2)
    return mn, mx


def main():
    N, M = [int(e) for e in inp().split()]
    print(*solve(N, M))


def __starting_point():
    main()

__starting_point()