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