#include <bits/stdc++.h>
using namespace std;
inline long long getint() {
  long long _x = 0, _tmp = 1;
  char _tc = getchar();
  while ((_tc < '0' || _tc > '9') && _tc != '-') _tc = getchar();
  if (_tc == '-') _tc = getchar(), _tmp = -1;
  while (_tc >= '0' && _tc <= '9') _x *= 10, _x += (_tc - '0'), _tc = getchar();
  return _x * _tmp;
}
bool _cmp(const pair<int, int>& i, const pair<int, int>& j) {
  return ((i.first == j.first) ? (i.second > j.second) : (i.first < j.first));
}
struct Node {
  int x, y;
  Node(int a = 0, int b = 0) : x(a), y(b) {}
  bool operator<(const Node& a) const {
    return ((x == a.x) ? (y > a.y) : (x < a.x));
  }
};
long long ncase = 1;
long long N, K;
string str;
void pre() { return; }
void init() {
  N = getint();
  K = getint();
}
void sol() {
  if (K == 0 or N == K) {
    puts("0 0");
    return;
  }
  printf("1 ");
  long long a = N / 3;
  if (a >= K) {
    cout << K * 2 << endl;
  } else {
    if (N % 3 == 1) {
      if (a + 1 == K)
        cout << 2 * a << endl;
      else
        cout << 2 * a - (K - a - 1) << endl;
    } else if (N % 3 == 2) {
      if (a + 1 == K)
        cout << 2 * a + 1 << endl;
      else if (a + 2 == K)
        cout << 2 * a << endl;
      else
        cout << 2 * a - (K - a - 2) << endl;
    } else {
      cout << N - K << endl;
    }
  }
  return;
}
int main() {
  pre();
  while (ncase--) {
    init();
    sol();
  }
}
