0.SVMC 2017 SubString


Submit solution

Points: 1 (partial)
Time limit: 1.0s
Memory limit: 98M

Author:
Problem type
Allowed languages
Ada, Assembly, Awk, C, C++, C11, CLANG, CLANGX, Classical, COBOL, Coffee, CSC, D lang, DART, F95, FORTH, Fortrn, GAS32, GO, Haskell, Itercal, Java, kotlin, LEAN, LISP, LUA, MONOVB, Nasm, OCAML, Pascal, Perl, php, PIKE, prolog, Pypy, Python, Ruby 2, RUST, Scala, SCM, SED, SWIFT, TCL, TUR, V8JS, VB, ZIG

As we all know Utkarsh is very good at solving number based problems, this time Arpit thinks smartly and gives Utkarsh to solve a problem on Strings. Arpit gives Utkarsh a string and challenges him to find the length of largest substring that have its mirror string same as its original one and number of such substrings. Now Utkarsh is buzy at preparing Avishkar papers so he asks you to help him in doing this task.

Eg. for mirror string : Consider string "lalit" then its mirror string will be "tilal".

Input :

There are t numbers of test cases (t<=200) followed t lines where each line contains a character string of lower case characters (a-z) of length l (1>=l<=3000).

Output :

There will be two integers per line separated by space indicating the length of largest substring which have its mirror string same and number of such substrings.

Sample test cases :

Input :

3

lalit

abedcdetr

abcde

Output :

3 1

5 1

1 5


Comments

There are no comments at the moment.