O(n)用数组记录字母出现的个数,最大减最小,在判断是不是质数。var i,k,m,n:longint; a:string; t:array[97..122] of longint;begin readln(a); m:=10000; for i:=1 to length(a) do inc(t[ord(a[i])]); for i:=97 to 122 do begin if (t[i]<m)and(t[i]<>0) then m:=t[i]; if t[i]>n then n:=t[i]; end; n:=n-m; for i:=1 to n do if n mod i=0 then inc(k); if k=2 then begin writeln('Lucky Word');writeln(n);end else begin writeln('No Answer');writeln('0');end;end.