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