#P2724. Bit Sequence Analysis

    ID: 15987 Type: Default 1000ms 256MiB

Bit Sequence Analysis

Bit Sequence Analysis

Help the cows uncover the truth by analyzing their daily data files. They are looking for the bit sequences whose lengths are between \(A\) and \(B\) (inclusive) that have the top \(n\) highest frequencies. Overlapping occurrences are counted, and every sequence that appears at least once is considered.

inputFormat

The input begins with a line containing three integers \(A\), \(B\), and \(n\) separated by spaces, where \(A\) and \(B\) specify the range of sequence lengths to consider and \(n\) is the number of frequency groups to output. The next line contains a binary string representing the data file.

outputFormat

For each of the top \(n\) frequency groups (or all groups if there are fewer than \(n\) distinct frequency counts), output the frequency on a single line. On the following line(s), output all bit sequences that occur with that frequency in lexicographical order, with at most six sequences per line separated by a single space.

sample

2 4 3
101010101
4

01 10 101 3 010 0101 1010

</p>