2424. FAN Mail Analyzer

单点时限: 3.0 sec

内存限制: 256 MB

You are a producer employed by Maximum Production. A lot of fan mails are sent to idols. However, there are some crazy fan mail and it may cause of loss of her motivation of an idol. So, it is a good way to throw such crazy fan mails away to a trash box before idols read. However, the number of fan mails is increasing and it is hard to check them all by hand. As a result, you decides to write a program to analyze fan mails and automatically select suspicious mails.

The content of a fan mail is constructed by the BNF shown below. You should consider that indicates one alphabet.

    ::= ' ' | ::= ' ' | . ::= |

To check whether a mail is suspicious, you should calculate NG score of each mail at first. To calculate the NG score, we should compare a fan mail and a crazy fan mail. In this calculation, every words are basically case insensitive and articles in English “the”, “a” and “an” should be ignored. First, we should calculate similarities between each sentence in a fan mail and each sentence in a crazy fan mail. To calculate the similarity between two sentences, we should consider a sentence as a sequence of words and the length of the longest common subsequence is the similarity. In this calculation, you should consider that these words are case insensitive. In addition, we should add 1 to the length of the longest common subsequence if a sentence in a fan mail contains a word including capital letter but the first letter of the word is not a capital letter. For each sentence in a fan mail, we should calculate the maximum similarity. The NG score of the fan mail is calculated by dividing the total sum of these maximum similarities into the number of words in the fan mail. You should notice that the NG score is infinity if there is no word in a fan mail. If the NG score exceeds threshold t, the fan mail considered a suspicious one.

Your job is to write a program to check whether a fan mails is suspicious.


Input consists of multiple test cases. The first line of each test case contains single non-negative real number t ( t <= 2.0 ) The second line contains a crazy fan mail, and third line contains a fan mail. Input is terminated by a case of t = -1.0, and it should not be processed.

You can assume that crazy mail and fan mail completely follow the grammar, and the number of words in fan mail is less than or equal to 1,000. You can also assume that the number of digits after the decimal point of t should be less than or equal to 3.


For each test case, you should output “SUSPICIOUS” if the fan mail is suspicious, otherwise output “OK”.


You must be dead. I kill you.
Your song is so wonderful. I love you. I stand by you forever.
You must be dead. I kill you.
You must be dead. I kill you.

0 人解决,1 人已尝试。

0 份提交通过,共有 5 份提交。

9.9 EMB 奖励。

创建: 12 年,10 月前.

修改: 4 年前.

最后提交: 9 月,4 周前.

来源: International Maximum-Cup 2008