#include <bits/stdc++.h>
namespace {
using i64 = long long;
using ui64 = unsigned long long;
}  // namespace
int main() {
  int N, K;
  std::cin >> N >> K;
  if (K == N || K == 0) {
    std::cout << 0 << ' ' << 0 << std::endl;
    return 0;
  }
  if (K <= N / 3) {
    std::cout << 1 << ' ' << 2 * K << std::endl;
    return 0;
  }
  int x = (3 * K - N) / 2;
  int pp = N - x;
  int result = pp / 3 * 2;
  if (pp % 3 == 2) {
    result += 1;
  }
  std::cout << 1 << ' ' << result << std::endl;
  return 0;
}
