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