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