1776: 笨小猴

Memory Limit:50 MB Time Limit:1.000 S
Judge Style:Text Compare Creator:
Submit:16 Solved:4

Description


题目描述

笨小猴的词汇量很小,所以每次做英语选择题的时候都很头疼。但是他找到了一种方法,经试验证明,用这种方法去选择选项的时候选对的几率非常大!

这种方法的具体描述如下:假设 lns="http://www.w3.org/1998/Math/MathML">maxn 是单词中出现次数最多的字母的出现次数,lns="http://www.w3.org/1998/Math/MathML">minn 是单词中出现次数最少的字母的出现次数,如果 lns="http://www.w3.org/1998/Math/MathML">maxnminn 是一个质数,那么笨小猴就认为这是个 Lucky Word,这样的单词很可能就是正确的答案。

输入格式

一个单词,其中只可能出现小写字母,并且长度小于 lns="http://www.w3.org/1998/Math/MathML">100

输出格式

共两行,第一行是一个字符串,假设输入的的单词是 Lucky Word,那么输出 Lucky Word,否则输出 No Answer

第二行是一个整数,如果输入单词是 Lucky Word,输出 lns="http://www.w3.org/1998/Math/MathML">maxnminn 的值,否则输出 lns="http://www.w3.org/1998/Math/MathML">0

输入输出样例

输入 #1
error
输出 #1
Lucky Word
2
输入 #2
olympic
输出 #2
No Answer
0

说明/提示

【输入输出样例 1 解释】

单词 error 中出现最多的字母 lns="http://www.w3.org/1998/Math/MathML">r 出现了 lns="http://www.w3.org/1998/Math/MathML">3 次,出现次数最少的字母出现了 lns="http://www.w3.org/1998/Math/MathML">1 次,lns="http://www.w3.org/1998/Math/MathML">31=2lns="http://www.w3.org/1998/Math/MathML">2 是质数。

【输入输出样例 2 解释】

单词 olympic 中出现最多的字母 lns="http://www.w3.org/1998/Math/MathML">i 出现了 lns="http://www.w3.org/1998/Math/MathML">1 次,出现次数最少的字母出现了 lns="http://www.w3.org/1998/Math/MathML">1 次,lns="http://www.w3.org/1998/Math/MathML">11=0lns="http://www.w3.org/1998/Math/MathML">0 不是质数。

(本处原题面错误已经修正)

noip2008 提高第一题

Sample Input Copy

error

Sample Output Copy

Lucky Word
2