#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0), cout.tie(0);
  long long n, k, mi, ma;
  cin >> n >> k;
  if (k == n || k == 0)
    mi = 0;
  else
    mi = 1;
  ma = min(n - k, k * 2);
  cout << mi << " " << ma;
  return 0;
}
