#include <bits/stdc++.h>
using namespace std;
long long int gcd(long long int a, long long int b) {
  if (a == 0)
    return b;
  else
    return gcd(b % a, a);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int n, m;
  cin >> n >> m;
  long long int max, min;
  if (n == 1)
    cout << "1 1" << endl;
  else if (m == 0)
    cout << n << " " << n << endl;
  else {
    if (n % 2 == 0) {
      long long int x = n / 2;
      if (x < m)
        min = 0;
      else if (x == m)
        min = 0;
      else
        min = (x - m) * 2;
    } else {
      long long int x = n / 2;
      if (x < m)
        min = 0;
      else if (x == m)
        min = 1;
      else
        min = (x - m) * 2 + 1;
    }
    long long int count = 0;
    vector<long long int> adj;
    for (long long int i = 2; i <= n; i++) {
      adj.push_back(i - 1);
    }
    for (long long int i = 1; i < n - 1; i++) adj[i] = adj[i] + adj[i - 1];
    long long int i;
    for (i = 0; i < n - 1; i++) {
      if (adj[i] < m)
        ;
      else {
        i++;
        break;
      }
    }
    max = n - 2 - i + 1;
    cout << min << " " << max << endl;
  }
}
