#include<stdio.h>
#include<stdlib.h> //·¥´ý
#include<string>
#include<math.h>
#define INT long long int
using namespace std;
char in[100], out[100];

int n, k;
int f(int a, int b, int c, int d, int e){
	
	if( a>0 and a%3==0) b++;
	if( c>0 and c%3==0) d++;
	if(e>k or b>1 or d>1) return 0;
	if(a==n and b==1 and c==n and d==1) return 1;
	if(a>=n or c>=n) return 0;
	return f(a+1,b,c+1,d,e+1)+f(a+1,b,c+2,d,e+1)+f(a+2,b,c+1,d,e+1)+f(a+2,b,c+2,d,e+1);
}

int main(){
	for(int I = 1; I<=15; I++){
		sprintf(in,".%d.in",I);
        freopen(in,"w",stdout);
        n = I+15;
        k = min(20,n - rand()%3);
		//scanf("%d", &n);
		printf("%d %d", n, k);
		sprintf(in,".%d.out",I);
        freopen(in,"w",stdout);
		printf("%d",f(0,0,0,0,1));
	}
}
