#include <bits/stdc++.h>
using namespace std;
const long long maxN = 1e5 + 12;
long long n, p;
int32_t main() {
  cin >> n >> p;
  if (!p) {
    cout << n << " " << n << endl;
    return 0;
  }
  cout << max((long long)0, n - p * 2) << " ";
  for (long long i = 1; i <= n; i++) {
    long long x = (i * (i - 1)) / 2;
    if (p <= x) {
      cout << n - i << endl;
      return 0;
    }
  }
}
