l,k = map(int,input().split()) if l % 2*k == 0: print('1') print(int((l/(2*k)) - 1) * k) elif 2*k < l: print('2') print(int(l/(2*k)) * k) elif 2*k >= l: print('3') print(0)