#include <bits/stdc++.h>
using namespace std;
const int INF = ~(1 << 31);
const double pi = acos(-1);
int main() {
  cin.sync_with_stdio(false);
  int n, k;
  cin >> n >> k;
  int mn = 0, mx = 0;
  if (n > k && k >= 1) mn = 1;
  int threetimes = n / 3;
  int left = n % 3;
  if (threetimes >= k) {
    mx = k * 2;
  } else {
    mx = threetimes * 2;
    k -= threetimes;
    if (left == 1) {
      k -= 1;
    } else if (left == 2) {
      mx += 1;
      k -= 1;
    }
    mx -= k;
  }
  cout << mn << " " << mx << endl;
  return 0;
}
