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