#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const long long int LINF = 0x3f3f3f3f3f3f3f3fll;
const long double pi = acos(-1);
int main() {
  int n, k;
  cin >> n >> k;
  if (k == 0 or k == n) {
    cout << "0 0\n";
    return 0;
  }
  cout << 1 << ' ' << min(n - k, k + k) << endl;
  return 0;
}
