#include <bits/stdc++.h>
using namespace std;
void solve();
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int t = 1;
  while (t--) {
    solve();
    cout << "\n";
  }
  cerr << "time taken : " << (float)clock() / CLOCKS_PER_SEC << " secs" << endl;
  return 0;
}
int modd(int a) {
  if (a < 0)
    return -a;
  else
    return a;
}
void solve() {
  long long int a, b, n, k;
  cin >> n >> k;
  if (k == 0 || k == n)
    cout << 0 << " ";
  else
    cout << "1 ";
  if (k == 0)
    cout << "0";
  else
    cout << ((n - k > 2 * k) ? 2 * k : n - k);
}
