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