#include<cstring>
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<queue>
#define x first
#define y second
using namespace std;
typedef pair<int,int> PII;
const int N = 20;
int dx[4] = {1,2,1,2};
int dy[4] = {2,1,-2,-1};
int res;
int n,m;
int bfs(){
queue<PII> q;
q.push({0,0});
while(q.size()){
PII t = q.front();
q.pop();
for(int i = 0;i < 4;i++){
int a = t.x + dx[i],b = t.y + dy[i];
if(a < 0 || a > n || b < 0 || b > m) continue;
if(a == n && b == m) res++;
q.push({a,b});
}
}
return res;
}
int main(){
cin >> n >> m;
cout << bfs();
return 0;
}
```cpp