Corridors of Hogwarts castle are well illuminated: there
is a row of magical torches going along each corridor.
The torches are situated at small equal intervals,
so the illumination of a corridor can be controlled by
igniting or putting out some of the torches (of course,
using magic).
The Hogwarts caretaker Argus Filch doesn't like it when
the illumination is not uniform, because he suspects that
rule-breakers may hide in dark places. Your task is to
create a uniform illumination of a given brightness.
Input
The first line contains the number N
(1 ≤ N ≤ 106) of torches in a corridor.
The second line contains the required brightness b, which is
an integer in the range from 0 to 100. The brightness is given
as a percentage of the maximal brightness (0 corresponds to the
state when all torches are put out, 100 is when all torches are
ignited).
Output
Output a sequence of N zeros and ones (0 corresponds to
an extinguished torch, 1 corresponds to an ignited torch)
such that for each segment of the corridor comprising L
torches the number of ignited torches differs from L*b/100 by not more than 2.
Sample
input | output |
---|
10
33
| 0100100100
|
Problem Author: Idea by Alexander Mironenko, text and programming by Stanislav Vasilyev
Problem Source: The Xth Urals Collegiate Programing Championship, March 24-25, 2006