ll@h,@w,@k,a[]={0,1,2,4,6,12,18,34,58,106,1,5,12,38,106,2,12,62,0,0,2,9,30,91,258,729,2018,5613,0,9,91,738,5613,2,91,2022};if(h>w)swap(h,w);w-=h>2?52:47;wt(k>1?a[18k+10h+w]:1);