#include <bits/stdc++.h>
using namespace std;
const int MX = 1e5 + 5;
const int INF = 1e9 + 5;
int main() {
  long long n, k;
  scanf("%I64d%I64d", &n, &k);
  if (k == 0 || k == n) {
    printf("0 0\n");
    return 0;
  }
  long long a, b;
  a = 1;
  if (n >= 3 * k)
    b = 2 * k;
  else
    b = n - k;
  printf("%I64d %I64d\n", a, b);
  return 0;
}
