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