#include <bits/stdc++.h>
using namespace std;
inline int gcd(int x, int y) {
  int z;
  while (y) {
    z = x % y;
    x = y;
    y = z;
  }
  return x;
}
int main() {
  ios_base::sync_with_stdio(false);
  int n, k;
  cin >> n >> k;
  if (k == n) {
    cout << 0 << " " << 0;
    return 0;
  } else {
    if (k == 0) {
      cout << 0 << " " << 0;
      return 0;
    } else {
      cout << 1 << " ";
      if (n / k >= 3) {
        cout << k * 2;
      } else {
        cout << n - k;
      }
    }
  }
  return 0;
}
