#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, k, i, j;
  cin >> n >> k;
  if (k == 0 || k == n)
    cout << 0 << " " << 0;
  else if (2 * k >= n)
    cout << 1 << " " << n - k;
  else if (3 * k <= n)
    cout << 1 << " " << 2 * k;
  else {
    cout << 1 << " " << k + n % k;
  }
  return 0;
}
