#include <bits/stdc++.h>
using namespace std;
int arr[1000] = {0};
int main() {
  int n, k;
  cin >> n >> k;
  int min = 0, max = 0;
  if (k == 0 || n == k)
    cout << "0"
         << " "
         << "0";
  else {
    min = 1;
    int x = n / 3;
    if (k <= x)
      max = 2 * k;
    else if (k > x)
      max = n - k;
    cout << min << " " << max;
  }
}
