Maximum score - MarisaOJ: Marisa Online Judge

Maximum score

Time limit: 1000 ms
Memory limit: 256 MB
The score of a set of strings is defined as the product of the longest common prefix and the number of strings in it. Given $n$ strings $S_1,S_2,...,S_n$. Find the maximum score string subset. ### Input - The first line contains an integer $n$. - The second line contains the string $S_i$. ### Output - Print the maximum score. ### Constraints - $1 \le n \le 10^5$. - The total length of $S_i$ does not exceed $10^6$. ### Example Input: ``` 3 aabb aab aac ``` Output: ``` 6 ```