Diferente pentru problema/words intre reviziile #1 si #3

Nu exista diferente intre titluri.

Diferente intre continut:

== include(page="template/taskheader" task_id="words") ==
Poveste şi cerinţă...
William loves words and likes to collect them in special dictionaries. Today, he's building a dictionary that contains all the words. Or actually: all the words that can be formed with the $26$ English letters.
 
The size of this dictionary is, naturally, infinite. This means that it wouldn't be practical to generate the dictionary to, say, a text file on disk, since it would require an infinite amount of space. However, William would still like to be able to identify the location in the dictionary of a given word.
 
The ordering rule in this special dictionary is a bit unusual: we consider shorter words to always come before longer ones. For example, the word xy comes before abc, simply because it is shorter. If two words have the same length, they are ordered in the traditional (lexicographic) way, so xyz > abc.
 
This means that the first 26 words in the dictionary are formed by only one character: a, b, ..., z. The next words are formed by only two characters, and so on.
 
Help William by writing a program that, given a word, calculates its zero-based index in the dictionary. That is: 'a' = 0, 'b' = 1, and so on. Since this value can be really big, we need its value modulo $10^9 + 7$.
h2. Date de intrare
Fişierul de intrare $words.in$ ...
The input file $words.in$ contains the word $W$, a string consisting of lowercase English letters.
h2. Date de ieşire
În fişierul de ieşire $words.out$ ...
The output file $words.out$ will contain the zero-based index in the dictionary modulo $10^9 + 7$.
h2. Restricţii
* $... ≤ ... ≤ ...$
* $1 ≤ |W| ≤ 10^5$
* For tests worth $20$ points, $1 ≤ |W| ≤ 3$.
* For tests worth $20$ more points, $W$ has only 'a' in it.
* For tests worth $40$ more points, $1 ≤ |W| ≤ 10^3$.
h2. Exemplu
table(example). |_. words.in |_. words.out |
| This is some
  text written on
  multiple lines.
| This is another
  text written on
  multiple lines.
| abba
| 18980
|
h3. Explicaţie
 
...
table(example). |_. words.in |_. words.out |
| verylongstring
| 315607945
|
== include(page="template/taskfooter" task_id="words") ==

Nu exista diferente intre securitate.

Topicul de forum nu a fost schimbat.