#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long int n;
  cin >> n;
  long long int m;
  cin >> m;
  if (n < m * 2)
    cout << "0 ";
  else
    cout << n - (m)*2 << " ";
  if (m == 0)
    cout << n;
  else {
    long long int ans = n - (sqrt(8 * m + 1) + 1) / 2;
    cout << ans;
  }
  return 0;
}
