#include <bits/stdc++.h>
using namespace std;
int GCD(int a, int b) {
  if (a == 0) return b;
  return GCD(b % a, a);
}
int main(int argc, char* argv[]) {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, k;
  cin >> n >> k;
  if (k == 0 || n == k) {
    cout << 0 << " " << 0 << endl;
    return 0;
  }
  int resmin = 1;
  if (k == n) resmin = 0;
  int resmax = 0;
  int kk = k;
  int li = -1;
  for (int i = 0; i < n; i += 3) {
    if (kk == 0) break;
    li = i;
    if (i == 0 || i == n - 1) {
      --kk;
      resmax++;
      continue;
    }
    resmax += 2;
    --kk;
  }
  resmax -= kk;
  if (li + 2 < n) resmax++;
  cout << resmin << " " << resmax << endl;
  return 0;
}
