#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  int n, k, x;
  cin >> n >> k;
  if (k == 0) {
    std::cout << 0 << " " << 0 << '\n';
  } else if (n == k) {
    std::cout << 0 << " " << 0 << '\n';
  } else {
    x = n - k;
    int y = min(x, k * 2);
    std::cout << 1 << " " << y << '\n';
  }
  return 0;
}
