#include <iostream>
#include <cstdio>
#include <fstream>
#include <algorithm>
#include <cmath>
#include <deque>
#include <vector>
#include <queue>
#include <string>
#include <cstring>
#include <map>
#include <stack>
#include <set>
#include <list>
#define INF 0x3f3f3f
#define maxn 105000
#define juzheng 300
#define ll long long
using namespace std;
int main() {
cin.sync_with_stdio(false);
int n,k;
while(cin >> n >> k) {
if(k == 0 || n == k)
cout << "0 0" << endl;
else {
cout << "1 ";
cout << min(n - k,k * 2) << endl;
}
}
return 0;
}