Given a natural number , a base , and a natural number , print in base , but placing the digits of in groups of at every line.
Input consists of several cases, each with , , and .
For every case, print in base , but placing digits at every line. If the number of digits of in base is not a multiple of , the first line must be the shortest. Print a line with 10 dashes at the end of every case.
You should not use vectors or alike to solve this problem.
Input
12345 10 3 123456 10 3 1234567 10 3 12 10 3 14 2 1 1000000000 2 10
Output
12 345 ---------- 123 456 ---------- 1 234 567 ---------- 12 ---------- 1 1 1 0 ---------- 1110111001 1010110010 1000000000 ----------