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