#include <bits/stdc++.h>
using namespace std;
int main() {
  long long m, n;
  cin >> m >> n;
  cout << max(0ll, m - n * 2) << ' ';
  long long p;
  for (p = 0ll; (p * (p - 1) / 2) < n;) {
    p++;
  }
  cout << m - p;
  return 0;
}
