#include using namespace std; #define LL long long #define VI vector #define VL vector #define VVL vector> #define VVI vector> #define VS vector #define ITR(var, start, end) for(int var = start; var < end; var++) #define PUB push_back #define POB pop_back //macro for printing values of a one dimensional array (line by line) #define OUT1(arr) ITR(i, 0, arr.size()) cout << arr[i] << endl; //macro for printing values of a one dimensional array (space by space) #define OUT2(arr) do {\ ITR(i, 0, arr.size()){\ i == arr.size() - 1 ? cout << arr[i] : cout << arr[i] << " ";\ }\ cout << "\n";\ } while(0) //macro for printing values of a one dimensional array (line by line and with CASE) #define OUT3(arr) do{\ ITR(i, 0, arr.size()){\ cout << "Case " << i + 1 << ": " << arr[i] << "\n";\ }\ } while(0) //macro for printing the values of a two dimensional array (space by space) #define OUT4(arr) do{\ ITR(i, 0, arr.size()){\ ITR(j, 0, arr[i].size()){\ j == arr[i].size() - 1 ? cout << arr[i][j] : cout << arr[i][j] << " ";\ }\ cout << "\n";\ }\ } while(0) //macro for printing the values of a two dimensional array (space by space and with CASE) #define OUT5(arr) do{\ ITR(i, 0, arr.size()){\ cout << "Case " << i + 1 << ":" << "\n";\ ITR(j, 0, arr[i].size()){\ j == arr[i].size() - 1 ? cout << arr[i][j] : cout << arr[i][j] << " ";\ }\ cout << "\n";\ }\ } while(0) int main(void){ ios::sync_with_stdio(false); cin.tie(nullptr); //if the goal is lying on the diagonal where row and col abs diff is the same //then the bishop will always be able to reach it in one step //otherwise, if the bishop cannot directly in one step reach the goal //then whichever cell it may be, the rook will always reach it in 2 steps //only check if a == b since origin is always 0,0 LL a, b; cin >> a >> b; a = abs(a); b = abs(b); a == b ? cout << 1 << endl : cout << 2 << endl; }