P0015. Format of the numbers

Given a natural nn, a basis bb and a natural number cc, we want to write nn in basis bb using exactly cc characters, following the next format:

Your task is to write a program that, given a sequence of triplets nn, bb, cc, prints for each one a line following this format.

Input

The input is a sequence of triplets nn, bb, cc, with n0n \ge 0, 2b102 \le b \le 10 and c>0c > 0.

Output

For each triplet of the input, print a line according to the described format.

Observations

Problem information

Author: Unknown
Translator: Carlos Molina

Generation: 2026-01-25T11:28:11.747Z

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