#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, k, a[100045], b[100045], c[100045], i, mn;
  cin >> n >> k;
  if (k == 0 || k == n) {
    cout << "0 0";
    return 0;
  }
  cout << "1 ";
  if (k * 3 >= n) {
    cout << n - k;
    return 0;
  }
  cout << k * 2;
}
