2340: Identify the text

内存限制:128 MB 时间限制:1.000 S
评测方式:文本比较 命题人:
提交:1 解决:1

题目描述

The extraction of webpage contents has great importance in information retrieval systems. In HTML, the contents and tags are always mixed together, which makes it difficult to extract contents form HTML pages.

Now some people have come up with a new algorithm of contents extraction which requires deleting all tags, leaving all the contents and blank position information of deleted tags. The remaining contents are called Ctext(n lines) and it is defined as follows:

1. Cblock : Continuous k lines(3<=k<=5, as thickness of Cblock) begins form a certain line of Ctext. Cblock[i] is a Cblock begins from line i of Ctext.

2. Y[i] (Length of Cblock[i]): the number of characters besides blank line(“blank”)

You can find a continuous sub-sequence from startX to endX as follows:

1.      Y[startX]>p (prepresents the minimum length)

2.      The Cblock of longest length must appear in [startX, endX]

3.      Y[m]=0 (m=endX+1 or m = n)

4.      Y[n]!=0 (startX <=n < startX+k)

Your task is to find the longest continuous sub-sequence of Y. 

输入

The first line contains three integers n(10<=n<=100),k(3<=k<=5),p(3<=p<=10)

Then there are n lines ,each line is a string. A blank line is descript by “blank”(besides quotation marks)

输出

Just output the startX and endX of the longest continuous sub-sequence of Y in one line.

样例输入 复制

10 3 3
blank
aaaa
blank
blank
blank
aaa
blank
blank
aaaaa
blank

样例输出 复制

4 8

来源/分类