Given a grid with uppercase letters, compute the sum of the values of
the letters in each rectangle with a corner in the upper-left extreme.
The values of the letters are
’A’,
’B’,
’C’,
’D’,
etcetera, up to
’Z’.
Input consists of lines, all of them with the same number of uppercase letters .
Print lines with numbers each. The -th number of the -th row must be the sum of the values of the letters of the rectangle whose corners are the first letter of the input, and the -th letter of the -th row.
Consider using the inclusion-exclusion principle.
Author: Unknown
Translator: Salvador Roura
Generation: 2026-01-25T12:16:15.416Z
© Jutge.org, 2006–2026.
https://jutge.org