#include <bits/stdc++.h>
const long long int MOD = 1000000007ll;
using namespace std;
int main() {
  std::ios_base::sync_with_stdio(false);
  int n, k;
  cin >> n >> k;
  if (k == 0) {
    cout << 0 << " " << 0;
  } else {
    if (k == n) {
      cout << 0 << " " << 0;
    } else {
      cout << 1 << " " << min(n - k, k * 2);
    }
  }
  return 0;
}
