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