```#include<bits/stdc++.h> using namespace std; const int N=3010,mod=2333; typedef long long ll; ll ans[N][N],dp[N][N]; int n,m; //快速读入模板 template<class T>inline void read(T &res) { char c;T flag=1; while((c=getchar())<'0'||c>'9')if(c=='-')flag=-1;res=c-'0'; while((c=getchar())...