#include <iostream> #include <cstdio> #define ll long long using namespace std; ll n,k,pre[1005],f[1005][1005]; string h,s; int main() { scanf("%lld%lld",&n,&k); cin>>h; s=" "+h;//方便DP,将下表移至1~n f[0][0]=1; for(register int i=1;i<=n;i++) { ...