#include using namespace std; typedef signed long long ll; #undef _P #define _P(...) (void)printf(__VA_ARGS__) #define FOR(x,to) for(x=0;x>S; L=S.size(); int ma=0; FOR(x,L) for(y=1;x+y<=L;y++) par[x][x+y]=palin(S.substr(x,y)); par[0][0]=1; MINUS(dp); dp[0]=1; for(x=0;x<=L;x++) { FOR(y,x) if(dp[y]>=0 && par[y][x]) dp[x]=max(dp[x],max(dp[y],x-y)); } cout<