Mr. Shim is a kind and caring teacher. He wants you to feel the love by giving you very difficult math problems! The harder the math problem, the greater amount of love you will feel. Math problems will be represented by a sequence of characters.
The difficulty of the problem is determined by complexity. All of the sequences contain a repeating pattern. The complexity of a sequence is determined by the length of the pattern, divided by the number of times it repeats.
For example abababab
would have a pattern length of ab
ababababababab
however, will have length
You'll be given
Constraints
Input Specification
The first line will contain
The following
Output Specification
The complexity value of the sequence that will cause you to feel the most love.
Sample Input 1
3
12 'shl,g'shl,g
12 pgpgpgpgpgpg
30 7hl7hl7hl7hl7hl7hl7hl7hl7hl7hl
Sample Output 1
7.50
Sample Input 2
5
40 uxquhwbtgauxquhwbtgauxquhwbtgauxquhwbtga
40 i''g-a0jn6i''g-a0jn6i''g-a0jn6i''g-a0jn6
42 5-oq=v=5-oq=v=5-oq=v=5-oq=v=5-oq=v=5-oq=v=
36 vfb9vfb9vfb9vfb9vfb9vfb9vfb9vfb9vfb9
30 ==.=s==.=s==.=s==.=s==.=s==.=s
Sample Output 2
10.50
Comments