#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k, b;
  cin >> n >> k;
  if (k == 0) {
    cout << 0 << " " << 0;
    return 0;
  }
  int a = n - k > 0 ? 1 : 0;
  int s = ceil((double)n / 3);
  if (k >= s) {
    b = n - s - (k - s);
  } else {
    b = k * 2;
  }
  cout << a << " " << b << endl;
}
