#include <bits/stdc++.h>
using namespace std;
const int mod = (int)1e9 + 7;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  int n, k;
  cin >> n >> k;
  if (k < n) {
    if (k == 0)
      cout << 0 << ' ';
    else
      cout << 1 << ' ';
  } else
    cout << 0 << ' ';
  if (k <= n / 3)
    cout << k * 2;
  else
    cout << n - k;
  return 0;
}
