#include<bits/stdc++.h>
using namespace std;
#define int long long
#define ld long double
#define nline "\n"
#define ff first
#define ss second
#define pb push_back
#define int long long
#define fl(i,k,n) for (int i = k; i < n; i++)
#define rfl(i,n, k) for (int i = n; i >= k; i--)
#define fel(a,x) for (auto& a : x)
#define mp make_pair
#define ppb pop_back
#define ps(x, y) fixed << setprecision(y) << x
#define setbit(x) __builtin_popcount(x);
#define all(var) var.begin(), var.end()
#define desc greater<int>()
#define spc <<" "<<
#define YES cout << "YES\n";
#define NO cout << "NO\n";
#define Yes cout << "Yes\n";
#define No cout << "No\n";
#define minus1 cout << "-1\n";
#define one cout << "1\n";
#define gcd(a, b) __gcd(a, b)
#define PI 3.141592653589793238462
#define sz(x) ( (int)(x).size())
#define jay_shri_ram ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
// Builtin data types
typedef pair<int, int> pii ;
typedef vector<int> vi ;
typedef vector<string> vs ;
typedef vector<pii> vpi ;
typedef vector <pair<int , int> > vpi ;
typedef vector<bool> vb ;
typedef vector<vector<int>> vvi ;
typedef map<int, int> mpii ;
typedef set<int> seti ;
typedef multiset<int> mseti ;
typedef unordered_set<int> useti ;
typedef unordered_map<int, int> umapii ;
typedef unsigned long long ull ;
//constants
const int MAX_N = 1e5 + 5;
const int MOD = 1e9 + 7;
const int INF = 1e9;
const int EPS = 1e-9;
//debugger
#ifndef ONLINE_JUDGE
#define db(x) cerr << #x <<" "; _print(x); cerr << endl;
#else
#define db(x)
#endif
void _print(int t) {cerr << t;}
void _print(string t) {cerr << t;}
void _print(char t) {cerr << t;}
void _print(ld t) {cerr << t;}
void _print(double t) {cerr << t;}
template <class T, class V> void _print(pair <T, V> p);
template <class T> void _print(vector <T> v);
template <class T> void _print(set <T> v);
template <class T, class V> void _print(map <T, V> v);
template <class T> void _print(multiset <T> v);
template <class T, class V>
void _print(pair <T, V> p) {
cerr << "{"; _print(p.ff); cerr << ","; _print(p.ss); cerr << "}";
}
template <class T>
void _print(vector <T> v) {
cerr << "[ ";
for (T i : v) {
_print(i);
cerr << " ";
}
cerr << "]";
}
template <class T>
void _print(set <T> v) {
cerr << "[ ";
for (T i : v) {
_print(i);
cerr << " ";
}
cerr << "]";
}
template <class T>
void _print(multiset <T> v) {
cerr << "[ ";
for (T i : v) {
_print(i);
cerr << " ";
}
cerr << "]";
}
template <class T, class V>
void _print(map <T, V> v) {
cerr << "[ ";
for (auto i : v) {
_print(i);
cerr << " ";
}
cerr << "]";
}
//-------------------------------Think&Code----------------------------------*/
void solve() {
int v , e ;
cin >> v >> e ;
if (2 * e >= v) {
cout << 0 << " ";
} else {
cout << v - 2 * e << " ";
}
if (e == 0) {
cout << v << nline;
return ;
}
for (int i = 1 ; i <= v ; i++) {
if (((i * (i + 1)) / 2 ) >= e) {
cout << v - i - 1 << nline;
break;
}
}
}
int32_t main() {
#ifndef ONLINE_JUDGE
freopen("Error.txt", "w", stderr);
#endif
jay_shri_ram;
// int t ; cin >> t;
int t = 1;
while (t--) {
solve();
}
}
/* -----------------END OF PROGRAM --------------------*/
803B - Distances to Zero | 291A - Spyke Talks |
1742E - Scuza | 1506D - Epic Transformation |
1354G - Find a Gift | 1426F - Number of Subsequences |
1146B - Hate "A" | 1718C - Tonya and Burenka-179 |
834A - The Useless Toy | 1407D - Discrete Centrifugal Jumps |
1095B - Array Stabilization | 291B - Command Line Arguments |
1174B - Ehab Is an Odd Person | 624B - Making a String |
1064C - Oh Those Palindromes | 1471A - Strange Partition |
1746A - Maxmina | 1746B - Rebellion |
66C - Petya and File System | 1746C - Permutation Operations |
1199B - Water Lily | 570B - Simple Game |
599C - Day at the Beach | 862A - Mahmoud and Ehab and the MEX |
1525A - Potion-making | 1744D - Divisibility by 2n |
1744A - Number Replacement | 1744C - Traffic Light |
1744B - Even-Odd Increments | 637B - Chat Order |