#include <bits/stdc++.h>
using namespace std;
struct P {
  int x, y, z, w;
  bool operator<(const P &a) const {
    if (y != a.y) return y > a.y;
    return x > a.x;
  }
};
vector<int> v[200456];
int a, b, c, n, m, i, k, o[1032010], d, e, dy[5] = {0, 0, -1, 1, 0},
                                           dx[5] = {0, 1, 1, 1, 2};
int l[1100][1111];
long long x[300100], y[300100], z;
P u[100100];
int j[600100];
priority_queue<P> q[100100], q1[100100];
map<int, P> p[2222];
string r[1555], r1;
int g(int t) {
  int i = 0;
  for (; t > 0; i += (t % 2), t >>= 1)
    ;
  return i;
}
int f(int i, int h) {
  if (i < h) swap(i, h);
  for (; h;) {
    int u = h;
    h = i % h;
    i = u;
  }
  return i;
}
bool asd(P a, P b) { return a.y < b.y; }
int main() {
  scanf("%d %d", &a, &b);
  if (a == b || b == 0) {
    puts("0 0");
    return 0;
  }
  if ((long long)b * 3 <= (long long)a) {
    printf("1 %d", b * 2);
  } else
    printf("1 %d", a - b);
}
