#pragma GCC target("avx2") #include using namespace std; #define int long long signed main(){ ios::sync_with_stdio(false); std::cin.tie(0); int T; cin>>T; while(T--){ int N,M; cin>>N>>M; vector A(N); for(int i=0;i>A[i]; for(int i=2;i<=N;i++)for(int j=0;i+j<=N;j++) A[j] = (A[j]+A[j+1])*(A[j]+A[j+1])%(1<