P0007. Egyptian numbers

This problem can not be seen correctly in HTML. Consult the PDF or the PS.

Input

The input is a sequence of cases, each one in a line. Every line starts with a word that identifies it, and continues with a sequence of natural numbers ending with 1-1. The sum of the natural numbers of each sequence will have seven digits at most.

Output

For each input case, print the identifier, followed by the stamp corresponding to the sum of the natural numbers of the case. Your program must print an empty line after each case.

Problem information

Author: Unknown
Translator: Carlos Molina

Generation: 2026-01-25T12:19:42.862Z

© Jutge.org, 2006–2026.
https://jutge.org