#include <bits/stdc++.h>
using namespace std;
const int INF = 2034567891;
const long long int INF64 = 4234567890123456789ll;
long long int gcd(long long int a, long long int b) {
  return (b == 0 ? a : gcd(b, a % b));
}
long long int lcm(long long int a, long long int b) {
  return (a * (b / gcd(a, b)));
}
int main() {
  long long int n, k;
  cin >> n >> k;
  if (k == 0) {
    cout << "0"
         << " "
         << "0";
    return 0;
  }
  if (n <= k) {
    cout << "0"
         << " "
         << "0";
    return 0;
  }
  cout << "1"
       << " " << (3 * k <= n ? 2 * k : n - k);
}
