Aoccdrnig to a rscheearch at Cmabrigde Uinervtisy, it deosn't mttaer in waht oredr the
ltteers in a wrod are,
the olny iprmoetnt tihng is taht the frist and lsat ltteer be at the rghit pclae. The rset
can be a toatl mses
and you can sitll raed it wouthit porbelm. Tihs is bcuseae the huamn mnid deos not raed
ervey lteter by istlef,
but the wrod as a wlohe.
-- Unknown Author.
"Ennyn Durin Aran Moria. Pedo mellon a Minno. Im Narvi hain echant. Celebrimbor o Eregion
tethant. I thiw
"The Doors of Durin, Lord of Moria. Speak friend and enter. I Narvi made them. Celebrimbor
of Hollin drew these
-- "The Fellowship of the Ring" J. R. Tolkien
The Doors of Durin were opened by Gandalf and the Fellowship entered in
As they found, this underground kingdom has gates on every passageway. Each gate has a written
contains the key word. Luckily, Gimli knows how to recognize the key in these messages. It's the
most "like" word,
which has the greatest average "likeness" coefficient with other words in the message.
You are given a message. You need to pick out all words (a consecutive sequence of letters or a
calculate the "likeness" coefficients with other words, take an average of them and choose the
"likeness" coefficient even for the same words (of course it's 100). If several words have the
same resulting value,
then choose the word closest to the end of the message. Words in the message...