the
a surrounded is black by n rows of n columns of small lattice box, each can choose a square that has been surrounded by the black box will be a row of its one line of black requirements of the partition is also square, ask how many different coating K can be painted
train of Thought
because it can only be divided into squares, so it must be the most intermediate row and the middle column each time, then you can apply the number of times is constantly on N minus one divided by 2 to see how many layers, as for the answer to use DP calculation, from small to large, first turn to twice times, and then up and down into twice times, ans[i][j]= (ans[i ][j]+ (Temp[k]*temp[j-1-k]) (%mod)%mod,ans[i][j] means that the coating I layer has been coated with the number of J, Temp[k] means that the upper and lower half of the number of ways to apply K, temp[j]= (temp[j]+ (ans[i) [K]*ans[i][j-k])%mod, this is to do the extension of the left,%mod, the right tu j-k times, the total spread of the J, the last ans[layer][k] is the answer
Code
#include <cstdio> #define MOD 7340033 long long ans[31][1001],temp[1001]; int main () {L
Ong Long q,n,k,cnt;
Ans[0][0]=1;
Temp[0]=1;
For (long long i=1;i<=30;i++) {ans[i][0]=1; For (long long j=1;j<=1000;j++) for (long Long k=0;k<j;k++) ans[i][j]= (ans[i][j]+ (temp[k]*
TEMP[J-1-K])%mod)%mod;
For (long long j=1;j<=1000;j++) temp[j]=0;
Temp[0]=1; For (long long j=1;j<=1000;j++) for (long Long k=0;k<=j;k++) temp[j]= (temp[j]+ (ans[i][k]*a
NS[I][J-K])%mod)%mod;
} scanf ("%i64d", &q);
For (long long i=0;i<q;i++) {scanf ("%i64d%i64d", &n,&k);
cnt=0;
while ((n%2) &&n>1) {cnt++;
n/=2;
printf ("%i64d\n", Ans[cnt][k]);
return 0; }