/* **************************************************************** **************************************************************** -> Coded by Stavros Chryselis -> Visit my github for more solved problems over multiple sites -> https://github.com/StavrosChryselis -> Feel free to email me at stavrikios@gmail.com **************************************************************** **************************************************************** */ #include #include #include #define gc() getchar_unlocked() using namespace std; int DP[6107][6107]; char str[6107]; int N; void init() { int i = 0; char c; c=gc(); while(isspace(c)) c=gc(); while(!isspace(c) && c!=EOF) { str[i++] = c; c = gc(); } N = i; } int main() { int T, i, j, L; //freopen("input.txt","r",stdin); scanf("%d", &T); while(T--) { init(); for(i=0; i