Notice: task description has been slightly modified with regard to
original version from competition, to allow sending programs instead of output files.
We are given a sequence of positive integers (for
). This sequence is used to encrypt -bit
messages. If we have a message consisting of consecutive bits() ( is either or ), then
its encryption it the number:
Task
You are given encrypted messages and sequences of numbers (), that
have been used to encrypt the messages. Your task is to decrypt the encrypted
messages and to save them in particular files. You are not expected to present
any program. It is sufficient that you write the decrypted messages.
Input
In the first line of the standard input there is one integer ,
. In the successive lines there is a
sequence of numbers () written: in the line of number
there is one positive integer . The sum of the
numbers does not exceed . In the
line of number there is one integer - the encrypted
message, .
Output
In the first line of standard output you should write the
successive numbers , without any spaces between them. The test
data were chosen so that the encrypted messages are unambiguously determined.
In the event of technical difficulties with Szkopuł, please contact us via email at [email protected].
If you would like to talk about tasks, solutions or technical problems, please visit our Discord servers. They are moderated by the community, but members of the support team are also active there.