#include<iostream>
using namespace std;
#define REP(i,b,n) for(int i=b;i<n;i++)
#define rep(i,n)   REP(i,0,n)
#define UNVISITED -1

int cnt;
int tatami[20][20];

void solve(int r,int c,int now){
  int y=now/c,x=now%c;
  if ( r*c == now){
    rep(i,c)
      if (tatami[y-1][i]==UNVISITED)return;
    cnt++;
    return;
  }

  if( tatami[y][x]!=UNVISITED){
    solve(r,c,now+1);
    return;
  }

  if ( x==0 && y>0){
    rep(i,c)if ( tatami[y-1][i]==UNVISITED)return;
  }

  if (y != 0 && x>0){
    if ( tatami[y-1][x-1] != tatami[y-1][x] &&
	 tatami[y-1][x-1] != tatami[y][x-1])return;
  }

  if (y != r-1 ){
    tatami[y][x]=tatami[y+1][x]=now;
    solve(r,c,now+1);
    tatami[y][x]=tatami[y+1][x]=UNVISITED;
  }
  
  if ( x !=c-1 && tatami[y][x+1]==UNVISITED){
    tatami[y][x]=tatami[y][x+1]=now;
    solve(r,c,now+2);
    tatami[y][x]=tatami[y][x+1]=UNVISITED;
  }
  return;
}

int main(){
  int r,c;
  while(cin>>r>>c && r){
    rep(i,r)rep(j,c)tatami[i][j]=-1;
    cnt=0;
    solve(r,c,0);
    cout << cnt << endl;
  }
}
### Prompt

Construct a Cpp code solution to the problem outlined:

A tatami mat, a Japanese traditional floor cover, has a rectangular form with aspect ratio 1:2. When spreading tatami mats on a floor, it is prohibited to make a cross with the border of the tatami mats, because it is believed to bring bad luck.

Your task is to write a program that reports how many possible ways to spread tatami mats of the same size on a floor of given height and width.



Input

The input consists of multiple datasets. Each dataset cosists of a line which contains two integers H and W in this order, separated with a single space. H and W are the height and the width of the floor respectively. The length of the shorter edge of a tatami mat is regarded as a unit length.

You may assume 0 < H, W ≤ 20.

The last dataset is followed by a line containing two zeros. This line is not a part of any dataset and should not be processed.

Output

For each dataset, print the number of possible ways to spread tatami mats in one line.

Example

Input

3 4
4 4
0 0


Output

4
2

### Response

```cpp
#include<iostream>
using namespace std;
#define REP(i,b,n) for(int i=b;i<n;i++)
#define rep(i,n)   REP(i,0,n)
#define UNVISITED -1

int cnt;
int tatami[20][20];

void solve(int r,int c,int now){
  int y=now/c,x=now%c;
  if ( r*c == now){
    rep(i,c)
      if (tatami[y-1][i]==UNVISITED)return;
    cnt++;
    return;
  }

  if( tatami[y][x]!=UNVISITED){
    solve(r,c,now+1);
    return;
  }

  if ( x==0 && y>0){
    rep(i,c)if ( tatami[y-1][i]==UNVISITED)return;
  }

  if (y != 0 && x>0){
    if ( tatami[y-1][x-1] != tatami[y-1][x] &&
	 tatami[y-1][x-1] != tatami[y][x-1])return;
  }

  if (y != r-1 ){
    tatami[y][x]=tatami[y+1][x]=now;
    solve(r,c,now+1);
    tatami[y][x]=tatami[y+1][x]=UNVISITED;
  }
  
  if ( x !=c-1 && tatami[y][x+1]==UNVISITED){
    tatami[y][x]=tatami[y][x+1]=now;
    solve(r,c,now+2);
    tatami[y][x]=tatami[y][x+1]=UNVISITED;
  }
  return;
}

int main(){
  int r,c;
  while(cin>>r>>c && r){
    rep(i,r)rep(j,c)tatami[i][j]=-1;
    cnt=0;
    solve(r,c,0);
    cout << cnt << endl;
  }
}
```