#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, k, l, r;
  cin >> n >> k;
  if (k == n || k == 0) {
    cout << "0"
         << " "
         << "0";
    return 0;
  }
  l = 1;
  if (n >= (long long)3 * k)
    r = 2 * k;
  else
    r = n - k;
  cout << l << " " << r;
  return 0;
}
