Given a text T, pattern P and threshold parameter D, find a set S of pairwise disjoint intervals <a, b>, where 1 ≤ a ≤ b ≤ |T|, that satisfy:
The first input line contains a text T, the second input line contains a pattern P. Both sequences, T and P, are strings over {'a',...,'z'}.
The third line contains an integer which is the similarity threshold parameter D.
It holds 1 ≤ D ≤ 23, D < |P| ≤ 180, 1 ≤ |T| ≤ 1.1 × 106.
The output is one line containing two integers, M and H, separated by space. M is the number of intervals in an optimal set S (i.e., the number of matches to be highlighted in the editor) and H is the number of characters of T that are not covered by any interval of S (i.e., the number of characters that will not be highlighted).
aabbbcabab abb 1Output
4 1The result can be visualized as follows:
jedevvvede jede 2Output
3 1The result can be visualized as follows:
The public data set is intended for easier debugging and approximate program correctness checking. The public data set is stored also in the upload system and each time a student submits a solution it is run on the public dataset and the program output to stdout and stderr is available to him/her.
Link to public data set