#include <bits/stdc++.h>
using namespace std;
const int MAX = 10005;
const int MOD = 1e9 + 7;
const int INF = 0x3f3f3f3f;
int main() {
  int n, k;
  while (scanf("%d%d", &n, &k) != EOF) {
    if (k == n || k == 0) {
      cout << 0 << " " << 0 << endl;
      continue;
    }
    cout << 1 << " ";
    if (n - k >= 2 * k)
      cout << 2 * k << endl;
    else
      cout << n - k << endl;
  }
  return 0;
}
