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