# 「POJ3693」Maximum repetition substring

2015年1月14日3,2922

Description

The repetition number of a string is defined as the maximum number R such that the string can be partitioned into R same consecutive substrings. For example, the repetition number of “ababab” is 3 and “ababa” is 1.

Given a string containing lowercase letters, you are to find a substring of it with maximum repetition number.

Input

The input consists of multiple test cases. Each test case contains exactly one line, which
gives a non-empty string consisting of lowercase letters. The length of the string will not be greater than 100,000.

The last test case is followed by a line containing a ‘#’.

Output

For each test case, print a line containing the test case number( beginning with 1) followed by the substring of maximum repetition number. If there are multiple substrings of maximum repetition number, print the lexicographically smallest one.

Sample Input

Sample Output

ps：此题数据很水，发现我代码若有漏洞请留言

### 说点什么

Orz

Fifa Coins

Thank you, I’ve just been looking for information approximately this topic for a long time and yours is the greatest I’ve discovered till now. But, what about the conclusion? Are you sure concerning the source?|