Sum of digits (2)

Write a program that reads a basis for numeration and several numbers and prints the sum in base 10 of the digits in base bb of each one.

Input

Input consists of the value of b2b\geq 2 followed by a sequence of natural numbers.

Output

For every number, print the sum (in base 10) of its digits in base bb following the format of the examples.

Problem information

Author: Unknown
Translator: Maria Serna

Generation: 2026-01-25T21:25:49.999Z

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