#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;
const int INF = 1 << 29;
const double EPS = 1e-9;
const ll MOD = 1000000007;
const int dx[] = {1, 0, -1, 0}, dy[] = {0, -1, 0, 1};
ll N, K;
int main() {
  cin >> N >> K;
  ll a = N - K;
  ll b = K;
  if (a == 0 or b == 0) {
    cout << 0 << " " << 0 << endl;
    return 0;
  }
  ll min_res = 1;
  ll max_res = min(a, 2LL * b);
  cout << min_res << " " << max_res << endl;
  return 0;
}
