#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, i, k;
  cin >> n >> k;
  if (k == 0) {
    cout << "0 0";
    return 0;
  }
  if (n == k)
    cout << 0;
  else
    cout << 1;
  cout << " ";
  if (n % 2 == 0) {
    long long temp = 3 * k;
    if (temp <= n)
      cout << 2 * k;
    else {
      cout << n - k;
    }
  } else {
    long long temp = 3 * k;
    if (temp <= n)
      cout << 2 * k;
    else {
      cout << n - k;
    }
  }
  return 0;
}
