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