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