Processing math: 100%
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 S1,S2,...,Sn. Find the maximum score string subset. ### Input - The first line contains an integer n. - The second line contains the string Si. ### Output - Print the maximum score. ### Constraints - 1≤n≤105. - The total length of Si does not exceed 106. ### Example Input: 3aaaabaac Output: 6