MBEEWALK - Bee Walk
Tác giả: happyboy99x
Ngôn ngữ: C++
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
using namespace std;
#define max 100000000
int f[40][40][40];
int main()
{
int n,tc;
int d[6][2] = {{0,-1},{0,1},{-1,1},{-1,0},{1,0},{1,-1}};
f[20][20][0]=1;
scanf("%d",&tc);
for(int i=0;i<tc;i++)
{
scanf("%d",&n);
for(int k=1;k<=n;++k)
for(int x=1;x<=38;x++)
for(int y=1;y<=38;y++) {
f[x][y][k] = 0;
for(int l=0;l<=5;l++)
f[x][y][k] += f[x+d[l][0]][y+d[l][1]][k-1];
}
printf("%d\n",f[20][20][n]);
}
}