#include <bits/stdc++.h>
using namespace std;
long long n, k;
int main() {
  scanf("%lld%lld", &n, &k);
  if (k == 0)
    printf("0 ");
  else
    printf("%lld ", min(n - k, 1ll));
  printf("%lld", min(2 * k, n - k));
  return 0;
}
