#include <bits/stdc++.h>
using namespace std;
int arr[100005], flag = 0, cnt = 0;
int arr2[100005];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, k;
  cin >> n >> k;
  if (k == 0 | k == n) {
    cout << 0 << " " << 0 << endl;
    return 0;
  } else {
    cout << "1 " << min(n - k, k * 2) << endl;
  }
}
