#include <bits/stdc++.h>
using namespace std;
long long n, k, min_res, max_res;
signed main(void) {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> k;
  if (k == 0) {
    cout << "0 0";
    return 0;
  }
  if (n > k)
    min_res = 1;
  else
    min_res = 0;
  long long remain = n - k;
  max_res = min(remain, 2 * k);
  cout << min_res << " " << max_res;
  return 0;
}
