[BOJ 13809] Champernowne Constant

View as PDF

Submit solution

Points: 3
Time limit: 8.0s
Memory limit: 512M

Problem types
Allowed languages
Assembly, Awk, C, C++, Java, Pascal, Perl, Python, Sed, Text

Champernown constant is an irrational number represented in decimal by “0.” followed by concatenation of all positive integers in the increasing order. The first few digits of this constant are: 0.123456789101112 .. .</p>

Your task is to write a program that outputs the K digits of Chapnernown constant starting at the N-th place for given two natural numbers K and N.

입력 형식

The input has multiple lines. Each line has two positive integers N and K (N ≤ 109 , K ≤ 100) separated by a space.</p>

The end of input is indicated by a line with two zeros. This line should not be processed.

출력 형식

For each line, output a line that contains the K digits.

예제 입력

4 5
6 7
0 0

예제 출력

45678
6789101

Comments

There are no comments at the moment.